Loading
学习
目录
选择筛选器

          没有结果
          没有结果
          以下是一些搜索提示

          检查关键字的拼写。
          使用更普遍的搜索词。
          选择更少的筛选器,并扩大搜索范围。

          搜索所有 Salesforce 帮助
          使用高级交易详细信息行定价映射自定义字段

          使用高级交易详细信息行定价映射自定义字段

          用户可以使用高级详细信息行定价功能,通过定价程序更新销售交易项目或销售交易项目详细信息的自定义字段。通过此功能,用户不再需要使用自定义触发器或流来更新这些字段。此功能对修改、续订和取消用例非常有用。

          所需的 Edition

          适用于:Lightning Experience
          适用于启用了事务管理的 Revenue Cloud 的 EnterpriseUnlimitedDeveloper Edition
          所需用户权限
          设置和使用高级详细信息行定价:

          Salesforce 管理员

          定价设计时间用户权限集

          在您开始前,请完成这些任务。

          • 要打开高级详细信息行定价功能,请在“设置”中查找并选择收入设置,然后打开高级详细信息行定价设置。
          • 配置定价程序

          更新收入定价程序

          要配置高级详细信息行定价,请修改收入定价程序。

          1. 从应用程序启动程序中,查找并选择定价程序,然后选择要更新的定价程序。
          2. 通过在定价程序中的定价设置旁边添加新的地图行项目元素作为第二个元素来修改定价程序。
          3. 将上下文标记映射添加到地图行项目。

            输入变量

            输出变量

            LineItem

            SalesTrxnItemDetailSource

            LineItemQuantity

            ItemDetailQuantity

            NetUnitPrice

            ItemDetailNetUnitPrice

            price_water_fall

            DetailPriceWaterfallIdentifier

            InputUnitPrice

            ItemDetailUnitPrice

            ItemBillingReference

            ItemDetailBillingReference

            ItemNetTotalPrice

            ItemDetailTotalPrice

            TotalLineAmount

            ItemDetailTotalLineAmount

            EffectiveFrom

            ItemDetailEffectiveFrom__std

            有效收件人

            ItemDetailEffectiveTo__std

            PricingTermCount

            ItemDetailPricingTermCount__std

            itemTransientEndDate

            ItemDetailTransientEndDate__std

            ItemPricingSource

            ItemDetailPricingSource__std

            DerivedPricingAttribute

            ItemDetailDerivedPricingAttribute__std

            ItemGroupSummarySubtotal

            ItemDetailGroupSummaryTotal__std

            ListPrice

            ItemDetailListPrice__std

            IsContracted

            ItemDetailIsContracted__std

            ItemContractPrice

            ItemDetailContractPrice__std

            STI_TenantName__c

            STID_TenantName__c

            添加上下文标记映射后,您将看到 SalesTransaction 和 SalesTransactionItemDetail 之间的默认映射,以及更新的上下文定义。

          更新派生定价发现程序

          如果您正在使用派生定价,请在完成对收入定价程序的更改后对发现程序进行额外更改。这些更改对于确定有效的贡献产品和派生产品是必要的。

          1. 从应用程序启动程序中,查找并选择发现程序,然后选择要更新的发现程序。
          2. 将两个新元素添加到发现过程,以对派生产品进行定价:发现设置和映射行项目。
            将这些变量添加到发现设置。
            • 输入变量:行项目
            • 输出变量:LineItem
            将这些变量添加到地图行项目。
            • 输入变量:SalesTransactionItem
            • 输出变量:SalesTransactionItemDetail

            将这些其他变量添加到地图行项目。

            输入变量

            输出变量

            LineItem

            SalesTrxnItemDetailSource

            EffectiveFrom

            ItemDetailEffectiveFrom__std

            有效收件人

            ItemDetailEffectiveTo__std

            DerivedPricingAttribute

            ItemDetailDerivedPricingAttribute__std

          3. 通过使用修改、续订和取消 (ARC) 用例的定价程序,支持自定义字段。
            如果您使用 ARC API 并想要使用自定义字段,自定义字段设置适用。
            1. 自定义字段添加到 QuoteLineItem、QuoteLineItem 详细信息、OrderProduct 和 OrderProductDetails 对象。
            2. 上下文定义中,在 SalesTransactionItem 和 SalesTransactionItemDetail 节点中为这些自定义字段创建条目。
            3. 在 QuoteEntitiesMapping 和 OrderEntitiesMapping 中创建所需映射
          4. 修改自定义字段的收入定价程序。
            1. 在定价过程中,修改 MapLineItem 元素,以添加 SalesTransactionItem.CustomField 和 SalesTransactionItemDetail.CustomField 之间的映射。
            2. 在定价程序中创建任何必要的自定义元素,以将值分配到 SalesTransactionItem.CustomField。

              定价程序会自动检测特定行是否包含详细信息条目,并写入 SalesTransactionItemDetail.CustomField(如果存在)。否则,它会写入 SalesTransactionItem.CustomField。

              在新销售交易期间,填充 SalesTransactionItem 上的 CustomField。对于包含详细信息行的 ARC 场景,详细信息行会写入 SalesTransactionItemDetail 中的 CustomField。如果未为 ARC 创建详细信息行,详细信息行会写入 SalesTransactionItem 上的 CustomField。

          5. 要在 QuoteLineItem 或 OrderProducts 上编写带有详细信息行的自定义字段,请完成涉及程序计划和 Apex 类的其他设置。
            1. 启用手术计划。在“设置”中,查找并选择收入设置,并打开定价程序计划编排设置。
            2. 为报价和订单创建程序计划
            3. 在手术计划中,验证所有步骤是否包含 MapLineItem 元素。根据定价过程中使用的字段修改映射
            4. 使用此 ApexCustomFieldHandler Apex 类示例,如果需要,您可以增强它以更新多个自定义字段。该类查询 SalesTransactionItem 和 SalesTransactionItemDetail 节点,从详细信息项目中提取自定义字段值,然后更新 SalesTransactionItem 中的相应自定义字段。
          示例
          示例
          global class ApexCustomFieldHandler implements RevSignaling.SignalingApexProcessor {
          
              public virtual class BaseException extends Exception {}
              public class OtherException extends BaseException {}
              
              public RevSignaling.TransactionResponse execute(RevSignaling.TransactionRequest request) {
                  
                  String contextId = request.ctxInstanceId;
                  Context.IndustriesContext industriesContext = new Context.IndustriesContext();
                  
          
                  // STEP 2 - Query SalesTransactionItem nodes
                  Map<String, Object> inputQueryItem = new Map<String, Object>{
                      'contextId' => contextId,
                      'tags' => new List<String>{ 'SalesTransactionItem', 'SalesTransactionItemDetail' }
                  };
                  Map<String, Object> itemQueryOutput = industriesContext.queryTags(inputQueryItem);
                  Map<String, Object> itemQueryResult = (Map<String, Object>) itemQueryOutput.get('queryResult');
                  List<Object> itemData = (List<Object>) itemQueryResult.get('SalesTransactionItem');
                  List<Object> itemDetailData = (List<Object>) itemQueryResult.get('SalesTransactionItemDetail');
          
          
                  Map<String, String> salesTransactionItemIdToCustomAggregatedValue = new Map<String, String>();
                  
                  // STEP 3 - Custom Field Value from SalesTransactionItemDetail
                  for(Object itemDetailObj : itemDetailData) {
                      Map<String, Object> itemDetailNode = (Map<String, Object>) itemDetailObj;
                      Map<String, Object> detailTagMap = (Map<String, Object>) itemDetailNode.get('tagValue');
                      
                      String lineItemId = (String)((Map<String, Object>) detailTagMap.get('SalesTrxnItemDetailParent')).get('tagValue');
                      String cfValue = (String)((Map<String, Object>) detailTagMap.get('STID_TenantName__c')).get('tagValue');
                      
                      System.debug('Custom Field Value for Detail Item' + cfValue);
                      if(cfValue != null) {
                          salesTransactionItemIdToCustomAggregatedValue.put(lineItemId, cfValue);
                      }
                  }
          
          
                  // STEP 4 - Build update list
                  List<Map<String, Object>> itemNodeUpdates = new List<Map<String, Object>>();
          
                  for (Object itemObj : itemData) {
                      Map<String, Object> itemNode = (Map<String, Object>) itemObj;
                      Map<String, Object> tagMap = (Map<String, Object>) itemNode.get('tagValue');
                      
                      String lineItemId = (String)((Map<String, Object>) tagMap.get('LineItem')).get('tagValue');
                      
                      List<Object> dataPath = (List<Object>) itemNode.get('dataPath');
          
                      dataPath.remove(0); // Remove contextId
          
                      itemNodeUpdates.add(new Map<String, Object>{
                          'nodePath' => new Map<String, Object>{ 'dataPath' => dataPath },
                          'attributes' => new List<Object>{
                              new Map<String, Object>{
                                  'attributeName' => 'STI_TenantName__c',
                                  'attributeValue' => salesTransactionItemIdToCustomAggregatedValue.get(lineItemId)
                              }
                          }
                      });
                  }
          
                  // STEP 5 - Create collection context update
                  if (!itemNodeUpdates.isEmpty()) {
                      Map<String, Object> updateInput = new Map<String, Object>{
                          'contextId' => contextId,
                          'nodePathAndAttributes' => itemNodeUpdates
                      };
                      
                      //Step 6 - Update context
                      System.debug('--- PREHOOK: SUBMITTING CONTEXT UPDATE ---');
                      System.debug(JSON.serializePretty(updateInput));
                      industriesContext.updateContextAttributes(updateInput);
                  }
          
                  RevSignaling.TransactionResponse response = new RevSignaling.TransactionResponse();
                  response.status = RevSignaling.TransactionStatus.SUCCESS;
                  return response;
              }
          }
          
          重要
          重要 要将自定义字段信息添加到资产状态期间和资产操作源,请创建适当的跨上下文映射
           
          正在加载
          Salesforce Help | Article