Loading
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
          ValidationRulesFlowImplementation

          ValidationRulesFlowImplementation

          Run the active compatibility rules that are defined in the Validation Rules flow. The flow includes rule actions that invoke compatibility rules. The ValidationRulesFlowImplementation and the Validation Rules flow are included in the managed package.

          Compatibility rules determine whether products in the cart are compatible with, require, or exclude other products.

          Interface

          ProductValidationInterfaceProductValidationInterface

          Sample Code

          Note
          Note

          You can install the latest source code for this implementation, along with a definition of the flow, from the CMT managed package.

          global with sharing class ValidationRulesFlowImplementation implements vlocity_cmt.GlobalInterfaces.ProductValidationInterface
          {
             global Flow.Interview.ValidationRulesFlow myFlow
             {
                get;set;
             }
             global void validateLineItems(List<vlocity_cmt.ItemWrapper> itemsList)
             {
                List<SObject> itemList = new  List<SObject>();
                Map<Id, vlocity_cmt.ItemWrapper> masterObjectIdToItemWrapper = new  Map<Id, vlocity_cmt.ItemWrapper>();
                for(vlocity_cmt.ItemWrapper item: itemsList)
                {
                   itemList.add(item.itemSObject);
                   masterObjectIdToItemWrapper.put(item.itemSObject.Id, item);
                }
                // Set up the parameters required in the flow
                vlocity_cmt.FlowStaticMap.flowMap.put('itemList', itemList);
                vlocity_cmt.FlowStaticMap.flowMap.put('parentObjectList', itemList);
                vlocity_cmt.FlowStaticMap.flowMap.put('childItemsList', itemsList);
                vlocity_cmt.FlowStaticMap.flowMap.put('masterObjectIdToItemWrapper', masterObjectIdToItemWrapper);
                Map<string, object> myMap = new  Map<string, object>();
                myFlow = new  Flow.Interview.ValidationRulesFlow(myMap);
                try
                {
                   myFlow.start();
                }
                catch(System.FlowException e)
                {
                   System.debug(LoggingLevel.ERROR, 'exception::::' + e);
                }
             }
          }

          Related Implementations

          • DefaultProductValidationImplementationDefaultProductValidationImplementation

          • ValidationRulesImplementationValidationRulesImplementation

           
          Loading
          Salesforce Help | Article