Skip to main content

We are migrating from Salesforce CPQ to Revenue Cloud (Agentforce Revenue Management), API v67/v68. We have a custom picklist field Action_Type__c (Add, Amend, Cancel, Renew, No Change, Transfer, Cancel and Renew) that we stamp on Quote Line Item and Quote Action, and it flows to Order Product through the Sales Transaction context definition (Sales Transaction Item attribute mapped in QuoteEntitiesMapping and OrderEntitiesMapping). That part works.

We want the same value on Asset Action and Asset Action Source after the order is activated and assets are created or updated (createOrUpdateAssetFromOrder, called from a record-triggered flow on Order).

What we tried:

  1. Created Action_Type__c (picklist) on Asset Action and Asset Action Source.
  2. In the context definition: added a custom attribute on the Asset Action Source and Asset Action nodes, hydration mapping in AssetEntitiesMapping (Asset Action Source to Asset Action Source), and in AssetToSalesTransactionMapping the Asset Action Source to Sales Transaction Item mapping with ctxAttrHydrationCtxs, following the same pattern we use for another custom field (Average Unit Price).
  3. Activated new versions and ran fresh amendment and renewal orders.

Result: Order Product has the value, but Asset Action and Asset Action Source stay blank. Asset Action and Asset Action Source are not createable or updateable through the API or Apex, so we cannot backfill them either. The only link we have is AssetActionSource.ReferenceEntityItemId (polymorphic to OrderItem or OrderItemDetail).

Questions:

  1. Is it supported to persist a custom field value onto Asset Action or Asset Action Source when assets are created from orders? If yes, which context mapping, node or setting is required (is the Asset context mapping used on the write path, or only for hydration)?
  2. Does createOrUpdateAssetFromOrder copy any custom fields from Order Product to Asset Action Source, and if so how is the mapping defined?
  3. If it is not supported, what is the recommended pattern for reporting the originating action type per Asset Action (sidecar object populated by an Apex trigger on Asset Action Source, or something else)?

Any pointers to documentation or a release note would be appreciated. 

 

#Revenue Cloud  #Salesforce Revenue Cloud

1 resposta
  1. 23 de out., 11:46

    @Pratik Pawar  

    You need to configure the context definition and the relevant SObject mappings for this to work. below steps will help

     

    First you need to add the Action_Type__c attribute and tag to the below nodes in the Sales Transaction or relevant context definition:

    • SalesTransactionItem
    • SalesTransactionAction
    • AssetAction
    • AssetActionSource

     

    Then update the SObject mapping under 

    QuoteEntitiesMapping for context hydration for Quote

    • QuoteLineItem.Action_Type__c → SalesTransactionItem.ActionType__c
    • QuoteAction.Action_Type__c → SalesTransactionAction.ActionType__c

     

    Then update the SObject mapping under 

    OrderEntitiesMapping for context hydration for Order

    • OrderItem.Action_Type__c → SalesTransactionItem.ActionType__c
    • OrderAction.Action_Type__c → SalesTransactionAction.ActionType__c

      

    Then update the SObject mapping under 

    AssetEntitiesMapping for context hydration for Asset

    • AssetActionSource.Action_Type__c → AssetActionSource.ActionType__c 
    • AssetAction.Action_Type__c → AssetAction.ActionType__c

      

    Then update the SObject mapping under 

    AssetToSalesTransaction for cross-context mapping, Legacy View makes it easier to map. Add the Sales Transaction context definition you are currently using to the Connected Objects list on the right-hand side.

    • Map AssetAction.ActionType__c to SalesTransactionAction.ActionType__c.
    • Map AssetActionSource.ActionType__c to SalesTransactionItem.ActionType__c

     

    In my experience, Quote Actions are created for amendments, Renewals and manually created ones don't really work.

     

    Salesforce provides a step-by-step example for mapping a custom field from Order Item to Asset Action Source:

    Example: Map an Installation Date Field – Salesforce Help

     

    Hope this helps!!

    #crystal lotus solutions.

0/9000