Loading
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
          Use an Apex Call to Run the Run Config Rules Action

          Use an Apex Call to Run the Run Config Rules Action

          Use an Apex call to run the Run Config Rules invocable action with the Hide/Disable, Message, or Recommend rule.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions of Revenue Cloud with the Revenue Cloud Growth license or the Revenue Cloud Advanced license
          User Permissions Needed
          To work with configuration rules Manage Configurator with Constraint Rules Engine
          To use the Run Config Rules invocable action Product Configuration Rules User
          To work with Apex Apex Author

          For information on the Run Config Rules invocable action, see Run Config Rules Action in the Agentforce Revenue Management Developers Guide.

          Make an Apex call to create, debug, and execute the Run Config Rules invocable action, similar to this example.

          Example
          Example
          public class RunConfigRulesDebugger {
              public static void debugRunConfigRules(String quoteId) {
                  try {
                      // Create the invocable action with namespace
                      Invocable.Action action = Invocable.Action.createStandardAction('runConfigRules');
                      
                      System.debug('Setting transactionContextId parameter with value: ' + quoteId);
                      
                      action.setInvocationParameter('transactionId', quoteId);
                      
                      // Debug the action parameters
                      System.debug('Action parameters: ' + action);
                      
                      // Execute the action
                      System.debug('Invoking action...');
                      List<Invocable.Action.Result> results = action.invoke();
                      
                      System.debug('Number of results: ' + results.size());
                      
                      // Process the results
                      if (!results.isEmpty()) {
                          Invocable.Action.Result result = results[0];
                          System.debug('Is Success: ' + result.isSuccess());
                          System.debug('Results are: ' + results);
                          
                      } 
                   } catch (Exception e) {
                      System.debug('=== EXCEPTION ===');
                      System.debug('Exception occurred: ' + e.getMessage());
                      System.debug('Stack trace: ' + e.getStackTraceString());
                  }
                 }
          }
          
           
          Loading
          Salesforce Help | Article