Accelerator Salesforce Global Orders System API
Data mappings
This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables.
Module | Description |
---|---|
CommonTools | This module provides utility functions and mappings for Order transformations |
create-orderlineitem-request | CIM Mapping of SalesOrder Product to Salesforce Sales Order LineItem |
retrieve-order-by-id-product-items-response | Retrieve LineItems for a Sales Order in CIM |
create-order-request | Create Sales Order in Global Data System |
orders-search-response | Retrieve Orders response CIM mapping |
retrieve-order-by-id-response | Get OrderById response mapping |
update-order-request | Update Sales Order in Global Data System |
CommonTools
This module provides utility functions and mappings for Order transformations
Source:
./src/main/resources/dwl/common/CommonTools.dwl
Functions
fun getFormattedDateTime (toFormat)
Formats the date-time to the type accepted by CIM
fun filterObjectsByTypeAndId (objects: Array<Any>, objectType: String, objectId: String)
Function to filter objectType and objectID from an Array or records
return array of externalIDs mapped in CIM
fun appendObjectTypeAndIdToExternalIds (externalIdsArr, objectType, objectId)
Function to append objectType property to externalIds.
return Sobject of Managed_External_Id__c type
fun getExternalIdsWithObjectTypeToUpdate (existingExtIdsArr, currExtIdsArr)
Function to return ExternalIDs Array to update. This function takes existing externalIds array in global system and input externalIds array as parameters. It generates the list of externalId objects that requires update.
return array of ExternalID objects
fun getExternalIdsWithObjectTypeToCreate (existingExtIdsArr, currExtIdsArr)
Function to return ExternalIDs Array to create. This function takes existing externalIds array in global system and input externalIds array as parameters. It generates the list of externalId objects that needs to be created.
return array of ExternalID objects
fun getManagedExternalIdsMap (externalIds)
Function to return the ManagedExternalID map. This function takes externalIDs array as input parameters This uses the function getManagedExternalIdObj
return Map of Managed_External_Id__c
fun getManagedExternalIdsMap (externalIds, objectId, objectType)
Function to return the ManagedExternalID map. This function takes externalIDs array as input parameters This uses the function getManagedExternalIdObj
return Map of Managed_External_Id__c
fun getManagedExternalIdObj (externalIdObj, objectId, objectType)
Function to return the ManagedExternalID object with mapped values from externalId object, object ID and object type as input parameters.
return Sobject of Managed_External_Id__c type
fun isCompositeRequestSuccess (response)
Function to check if all the sub-requests of a Composite Request are successful
return true if all the sub-requests response status starts with "2"
fun generateMDMIDObj (refId)
Function to generate externalID obj with externalID as RefId & externalIdType as MDM
return generated MDM externalID object
fun generateSFDCIDObj (refId)
Function to generate externalID obj with externalID as RefId & externalIdType as SFDC External ID Type configured
return generated SFDC externalID object
fun generateSFDCIDObj (refId, externalIdType)
Function to generate externalID obj with externalID as RefId & externalIdType as externalIdType
return generated externalID object
fun getExternalIdsMapForOrder (orderExternalIds, orderType, objectId)
Function to return ExternalIDs for Order. This function takes order and objectId as parameters. It generates the externalIdType of MDM and SALESFORCE_CORE and adds if any externalIds on the order object. Appends the objectType and objectId to the result array. This will be used to generate the ManagedExternalIdsMap.
return array of ExternalIDsMap
create-orderlineitem-request
CIM Mapping of SalesOrder Product to Salesforce Sales Order LineItem
Source:
./src/main/resources/dwl/orderLineItems/create-orderlineitem-request.dwl
Variables
var s
Mapping Tables
Salesforce Order LineItem | CIM | Description |
---|---|---|
OrderId | orderId | Order ID |
Description | description | LineItem Description |
Product2Id | orderProductNumber | Product ID |
PricebookEntryId | PricebookEntryId from Query Response | PriceBook Entry ID |
SBQQOrderedQuantityc | orderedQuantity | Order Quantity |
UnitPrice | unitPriceAmount | Unit Price of the Product |
Quantity | orderedQuantity | Order Quantity |
retrieve-order-by-id-product-items-response
Retrieve LineItems for a Sales Order in CIM
Source:
./src/main/resources/dwl/orderLineItems/retrieve-order-by-id-product-items-response.dwl
Mapping Tables
CIM | Salesforce Order LineItem | Description |
---|---|---|
id | Id | LineItem ID |
code | Product2Id | Product ID |
description | Description | LineItem Description |
orderedQuantity | Quantity | Order Quantity |
unitPriceAmount | UnitPrice | Unit Price of the Product |
UnitPrice | unitPriceAmount | Unit Price of the Product |
totalPriceAmount | TotalPrice | Total Price |
create-order-request
Create Sales Order in Global Data System
Source:
./src/main/resources/dwl/orders/create-order-request.dwl
Mapping Tables
Salesforce Source field | CIM Field | Description of source field |
---|---|---|
Description | description | name of the Order |
Status | salesOrderStatus | Sales Order status |
AccountId | soldToCustomer | Salesforce Account Id Info |
EffectiveDate | Current Date | Order Date |
Type | salesOrderType | Salesforce Order Type |
Pricebook2Id | Default | Default PriceBook Id |
orders-search-response
Retrieve Orders response CIM mapping
Source:
./src/main/resources/dwl/orders/orders-search-response.dwl
Mapping Tables
CIM Field | Salesforce Source field | Description of source field |
---|---|---|
id | Id | Salesforce Order Id |
name | Description | name of the Order |
requestedStartDate | EffectiveDate | Order Requested Date |
orderNumber | OrderNumber | Order Number |
description | Description | Description of the Order |
grandTotalAmount | TotalAmount | TotalAmount of the Order |
salesOrderType | Type | Salesforce Order Type |
salesOrderStatus | status | Salesforce Order Status |
orderStartDate | EffectiveDate | Salesforce Order start date |
soldToCustomer | AccountId | Salesforce Account Id Info |
activatedDate | EffectiveDate | Effective Date |
auditInfo.createdBy | CreatedById | CreatedBy Id |
auditInfo.updatedBy | LastModifiedById | UpdatedBy Id |
auditInfo.updatedDate | LastModifiedDate | Updated Date |
auditInfo.createdDate | CreatedDate | Created Date |
externalIds.externalIdType | "MDM" | Master data management |
externalIds.externalId | Id | Global Id |
retrieve-order-by-id-response
Get OrderById response mapping
Source:
./src/main/resources/dwl/orders/retrieve-order-by-id-response.dwl
Mapping Tables
CIM Field | Salesforce Source field | Description of source field |
---|---|---|
id | Id | Salesforce Order Id |
name | Description | name of the Order |
requestedStartDate | EffectiveDate | Order Requested Date |
orderNumber | OrderNumber | Order Number |
description | Description | Description of the Order |
grandTotalAmount | TotalAmount | TotalAmount of the Order |
salesOrderType | Type | Salesforce Order Type |
salesOrderStatus | status | Salesforce Order Status |
orderStartDate | EffectiveDate | Salesforce Order start date |
soldToCustomer | AccountId | Salesforce Account Id Info |
auditInfo.createdBy | CreatedById | CreatedBy Id |
auditInfo.updatedBy | LastModifiedById | UpdatedBy Id |
auditInfo.updatedDate | LastModifiedDate | Updated Date |
auditInfo.createdDate | CreatedDate | Created Date |
externalIds.externalIdType | "MDM" | Master data management |
externalIds.externalId | Id | Global Id |
update-order-request
Update Sales Order in Global Data System
Source:
./src/main/resources/dwl/orders/update-order-request.dwl
Mapping Tables
Salesforce Source field | CIM Field | Description of source field |
---|---|---|
Id | objectId | Id |
Description | description | name of the Order |
Status | salesOrderStatus | Sales Order status |
AccountId | soldToCustomer | Salesforce Account Id Info |
EffectiveDate | Current Date | Order Date |
Type | salesOrderType | Salesforce Order Type |
Pricebook2Id | Default | Default PriceBook Id |
Global_SalesOrder_Id__c | objectId | Global Id |