validateAndEnrich
This API validates and enriches data for a Customer Purchase Order.
API Details
| API | Signature | 
|---|---|
| acceptOrder | 
                               | 
| Parameters | ||
|---|---|---|
| Name | Type | Description | 
| request | 
                               | The request data object. | 
| Request Data Object - Apttus_Config2.CPQStruct.DataValidateEnrichResult validateAndEnrichSO | |||
|---|---|---|---|
| Field | Type | Required? | Description | 
| bObjectId | 
 | Yes | Customer Purchase Order ID, Order Item ID to enrich and validate. | 
API Response
| Response Data Object - DataValidateEnrichResult | ||
|---|---|---|
| Field | Type | Description | 
| IsSuccess | 
 | Validation and Enrichment is a success. True- If there are no issue logs created for validation error as part of the execution. False- If there are issue logs create for validation error as part of the execution. | 
| IssueLogs | 
 | List of Issue logs generated for a given PO Item / PO while running the validation rule and enrichment rule against it. | 
| ModifiedSObjects | 
 | Objects Modified as Part of Enrichment rule. Key-Value Pair where Key is ID of modified record and Value is record SObject with modified Value. | 
| NumErrorsByObject | 
 | The number of Validation/Enrichment Error for each record. Key is record Id and value is the number of Error Issue logs created for that record. | 
| NumWarningsByObject | 
 | The number of Validation/Enrichment Warning for each record. Key is record Id and value is the number of Warning Issue logs created for that record. | 
Code Sample
The following enables you to validate and enrich the data in the customer purchase order.
Id customerPOId = 'a6PW00000008wGY';
Apttus_Config2.CPQStruct.DataValidateEnrichResult response = Apttus_Config2.DataValidationService.validateAndEnrichSO(customerPOId);
system.debug('IsSuccess=>'+response.IsSuccess);
system.debug('IssueLogs=>'+response.IssueLogs);
system.debug('NumErrorsByObject=>'+response.NumErrorsByObject);
system.debug('NumWarningsByObject=>'+response.NumWarningsByObject);
   
