Extend the standard context definition to include custom attributes for sales transactions and map them to Quote and Order objects.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and
Developer Editions |
| User Permissions Needed |
| To create user profiles and users: |
Energy & Utilities Cloud Features |
-
Navigate to Context Definitions.
-
From Setup, in the Quick Find box, enter Context Definitions, and then select Context Definitions.
-
On the Standard Definitions tab, find SalesTransactionContext.
-
Extend the standard context definition. Skip this step if you've already created a context definition with the name EUSalesTransactionContext.
-
Select the dropdown arrow next to SalesTransactionContext, and then select Extend.
The Extend Context Definition modal opens.
-
For Name, enter EUSalesTransactionContext, and then click Save.
Wait for the custom context definition to be created.
-
Add custom attributes to the context definition.
-
Select the Custom Definitions tab and select EUSalesTransactionContext.
-
Select Edit and then click Next until you reach the attributes section.
-
Under the SalesTransactionItem node, add these attributes:
- DistributionArea (Type: INPUT OUTPUT, Data Type: String)
- EstimatedConsumption (Type: INPUT OUTPUT, Data Type: Number)
- ConstraintEngineNodeStatus (Type: INPUT OUTPUT, Data Type: String)
-
Select Next and enter the tags for the new attributes:
- For DistributionArea, enter DistributionArea__c.
- For EstimatedConsumption, enter EstimatedConsumption__c.
- For ConstraintEngineNodeStatus, enter ConstraintEngineNodeStatus__c.
-
Save the attributes.
-
Map the custom attributes to Quote fields.
-
Click the Map Data tab.
-
Find QuoteEntitiesMapping, click the dropdown arrow, and select Edit SObject Mapping.
-
Select the Mark as Default checkbox and select Map.
-
Under the QuoteLineItem SObject, next to QuoteLineItemRecipientId, click the + icon and select the DistributionArea and EstimatedConsumption fields.
-
Map the attributes as follows:
- Map SalesTransactionItem.DistributionArea to QuoteLineItem.QuoteLineItemRecipient.DistributionArea.
- Map SalesTransactionItem.EstimatedConsumption to QuoteLineItem.QuoteLineItemRecipient.EstimatedConsumption.
- Map SalesTransactionItem.ConstraintEngineNodeStatus to QuoteLineItem.ConstraintEngineNodeStatus__c.
-
Save the new mappings.
-
Map the custom attributes to Order fields and activate the definition.
-
Return to the Map Data tab.
-
Find OrderEntitiesMapping, click the dropdown arrow, and select Edit SObject Mapping.
-
Under the OrderItem SObject, next to OrderItemRecipientId, select the + icon and select DistributionArea and EstimatedConsumption.
-
Map the attributes as follows:
- Map SalesTransactionItem.DistributionArea to OrderItem.OrderItemRecipient.DistributionArea.
- Map SalesTransactionItem.EstimatedConsumption to OrderItem.OrderItemRecipient.EstimatedConsumption.
- Map SalesTransactionItem.ConstraintEngineNodeStatus to OrderItem.ConstraintEngineNodeStatus__c.
-
Save the context definition and return to the definition details tab.
-
Activate the context definition.