Accelerator Salesforce Global Orders System API

(0 reviews)

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.

ModuleDescription
CommonToolsThis module provides utility functions and mappings for Order transformations
create-orderlineitem-requestCIM Mapping of SalesOrder Product to Salesforce Sales Order LineItem
retrieve-order-by-id-product-items-responseRetrieve LineItems for a Sales Order in CIM
create-order-requestCreate Sales Order in Global Data System
orders-search-responseRetrieve Orders response CIM mapping
retrieve-order-by-id-responseGet OrderById response mapping
update-order-requestUpdate 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

(back to top)

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 LineItemCIMDescription
OrderIdorderIdOrder ID
DescriptiondescriptionLineItem Description
Product2IdorderProductNumberProduct ID
PricebookEntryIdPricebookEntryId from Query ResponsePriceBook Entry ID
SBQQOrderedQuantitycorderedQuantityOrder Quantity
UnitPriceunitPriceAmountUnit Price of the Product
QuantityorderedQuantityOrder Quantity

(back to top)

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

CIMSalesforce Order LineItemDescription
idIdLineItem ID
codeProduct2IdProduct ID
descriptionDescriptionLineItem Description
orderedQuantityQuantityOrder Quantity
unitPriceAmountUnitPriceUnit Price of the Product
UnitPriceunitPriceAmountUnit Price of the Product
totalPriceAmountTotalPriceTotal Price

(back to top)

create-order-request

Create Sales Order in Global Data System

Source: ./src/main/resources/dwl/orders/create-order-request.dwl

Mapping Tables

Salesforce Source fieldCIM FieldDescription of source field
Descriptiondescriptionname of the Order
StatussalesOrderStatusSales Order status
AccountIdsoldToCustomerSalesforce Account Id Info
EffectiveDateCurrent DateOrder Date
TypesalesOrderTypeSalesforce Order Type
Pricebook2IdDefaultDefault PriceBook Id

(back to top)

orders-search-response

Retrieve Orders response CIM mapping

Source: ./src/main/resources/dwl/orders/orders-search-response.dwl

Mapping Tables

CIM FieldSalesforce Source fieldDescription of source field
idIdSalesforce Order Id
nameDescriptionname of the Order
requestedStartDateEffectiveDateOrder Requested Date
orderNumberOrderNumberOrder Number
descriptionDescriptionDescription of the Order
grandTotalAmountTotalAmountTotalAmount of the Order
salesOrderTypeTypeSalesforce Order Type
salesOrderStatusstatusSalesforce Order Status
orderStartDateEffectiveDateSalesforce Order start date
soldToCustomerAccountIdSalesforce Account Id Info
activatedDateEffectiveDateEffective Date
auditInfo.createdByCreatedByIdCreatedBy Id
auditInfo.updatedByLastModifiedByIdUpdatedBy Id
auditInfo.updatedDateLastModifiedDateUpdated Date
auditInfo.createdDateCreatedDateCreated Date
externalIds.externalIdType"MDM"Master data management
externalIds.externalIdIdGlobal Id

(back to top)

retrieve-order-by-id-response

Get OrderById response mapping

Source: ./src/main/resources/dwl/orders/retrieve-order-by-id-response.dwl

Mapping Tables

CIM FieldSalesforce Source fieldDescription of source field
idIdSalesforce Order Id
nameDescriptionname of the Order
requestedStartDateEffectiveDateOrder Requested Date
orderNumberOrderNumberOrder Number
descriptionDescriptionDescription of the Order
grandTotalAmountTotalAmountTotalAmount of the Order
salesOrderTypeTypeSalesforce Order Type
salesOrderStatusstatusSalesforce Order Status
orderStartDateEffectiveDateSalesforce Order start date
soldToCustomerAccountIdSalesforce Account Id Info
auditInfo.createdByCreatedByIdCreatedBy Id
auditInfo.updatedByLastModifiedByIdUpdatedBy Id
auditInfo.updatedDateLastModifiedDateUpdated Date
auditInfo.createdDateCreatedDateCreated Date
externalIds.externalIdType"MDM"Master data management
externalIds.externalIdIdGlobal Id

(back to top)

update-order-request

Update Sales Order in Global Data System

Source: ./src/main/resources/dwl/orders/update-order-request.dwl

Mapping Tables

Salesforce Source fieldCIM FieldDescription of source field
IdobjectIdId
Descriptiondescriptionname of the Order
StatussalesOrderStatusSales Order status
AccountIdsoldToCustomerSalesforce Account Id Info
EffectiveDateCurrent DateOrder Date
TypesalesOrderTypeSalesforce Order Type
Pricebook2IdDefaultDefault PriceBook Id
Global_SalesOrder_Id__cobjectIdGlobal Id

(back to top)


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onMar 8, 2024
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.1
1.0.0