Loading
Ongoing maintenance for Salesforce HelpRead More
Get Started with Communications, Media, and Energy & Utilities (CME)...
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Invoke the Repricing API

          Invoke the Repricing API

          You can use the Repricing API to reprice all lines or to reprice specific items for orders, quotes, and opportunities.

          • To reprice all the line items for a particular Order, Quote, or Opportunity, replace the ID with the appropriate Order, Quote, or Opportunity ID whose line items need to be repriced. This is highly recommended for bulk repricing.

            List<Order/Quote/Opportunity> a = [SELECT Id FROM Order/Quote/Opportunity];
            Map<String, Object> repricingInput = new Map<String, Object>{'objectList' => a};
            Map<String, Object> repricingOutput = new Map<String, Object>();
            Map<String, Object> repricingOptions = new Map<String, Object>();
            vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance();
            voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
          • To reprice OrderItems, QuoteLineItems, or OpportunityLineItems, replace the following query with a more suitable query based on the requirements, for example, reprice all lineItems created after 1/1/2019.

            List<OrderItem/OpportunityLineItem/QuoteLineItem> a = [SELECT Id,RootItemId__c From OrderItem/OpportunityLineItem/QuoteLineItem];
            Map<String,Object> repricingInput = new Map<String,Object>{'objectList' => codea};
            repricingInput.put('repriceProvidedLineItemsOnly', false);
            // mark it true to reprice only provided itemId, else the whole bundle associated with this ItemId needs to get repriced
            Map<String,Object> repricingOutput = new Map<String,Object>(); 
            Map<String,Object>; repricingOptions = new Map<String,Object>(); 
            vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance(); 
            voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
          • To reprice assets, replace the query for assets with a more suitable query based on the requirements, for example, reprice all assets created after 1/1/2019:

            List<Asset> a = [SELECT Id,RootItemId__c From Asset]; 
            Map<String,Object> repricingInput = new Map<String,Object>{'objectList' =>; a}; 
            repricingInput.put('repriceProvidedLineItemsOnly', false);
            // mark it true to reprice only provided itemId, else the whole bundle associated with this ItemId needs to get repriced
            Map<String,Object> repricingOutput = new Map<String,Object>(); 
            Map<String,Object> repricingOptions = new Map<String,Object>(); 
            vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance(); 
            voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
          • To reprice a particular account, replace the ID with the appropriate account ID whose assets need to be repriced. This is highly recommended for bulk repricing.

            List<Account> a = [SELECT Id FROM Account WHERE Id = '0011I00000DBYUK'];
            Map<String, Object> repricingInput = new Map<String, Object>{'objectList' => a};
            Map<String, Object> repricingOutput = new Map<String, Object>();
            Map<String, Object> repricingOptions = new Map <String, Object>();
            vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance();
            voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
          • To reprice a particular account, Order, Quote, or Opportunity using filters:

            Map<String, Object> input = new Map<String, Object>();
            //here by can be Order/Account/Opportunity/Quote 
            input.put('repriceBy', 'Order'); 
            //here objectId can be orderId,AcountId,OpptyId,QuoteId 
            input.put('objectId', '8011I000000dHQo'); 
            //rootItemIds are nothing but root line items or asset Id of the root in a bundle present in Order/Account/Opportunity/Quote input.put('rootLineItemIds', new List<Id>{'8021I000001s5saQAA'});
            input.put('repriceProvidedLineItemsOnly', false); 
            RepricingBatchProcessor repricingBatchJob = new RepricingBatchProcessor(input); 
            ID batchprocessid = Database.executeBatch(repricingBatchJob,1);

            This is the preferred way of repricing lineItems to avoid hitting SOQL limits. Use less than 10 rootItemIds at a time.

           
          Loading
          Salesforce Help | Article