Loading
Set Up Trade Promotion Management
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
          Schedule Server Processes

          Schedule Server Processes

          To fulfill business processes, run the batch server processes available with the Trade Promotion Management package. These server processes manage recalculations for updates in interfaced data and require that the master data be loaded into the system. When you schedule the TPM Calculation chain, the server process runs Promotion Reorganization—cleaning up deleted or inactive promotions, Promotion Calculation, Account Product List, and Account Plan Add-Ons.

          Required Editions

          Available in: Lightning Experience in Enterprise, Professional, and Unlimited Editions that have Consumer Goods Cloud enabled

          Ensure that tenant pairing is successfully completed and that the master data be loaded into the system

          User Permissions Needed
          To schedule server processes: CGCloud Business Admin
          1. From Setup, select Developer Console.
          2. Click Debug | Open Execute Anonymous Window.
            The Enter Apex Code window opens.
          3. To run the batch process, run one of these Apex classes:
            Batch Process To Apex Class Code Snippet
            Remove all promotion attachments that aren’t linked to any promotion. PromotionAttachmentClearNotUsedBatch Database.executeBatch(new PromotionAttachmentClearNotUsedBatch());
            Transfer all KPI sets to off-core. KpiSetTransferBatch

            Database.executeBatch(new KpiSetTransferBatch());

            The maximum batch size is 40.

            Trigger the TPM calculation chain. When the TPMCalculationChain class is triggered, processes are run as per the flow that’s set for the calculation chain.

            The default calculation chain flow is only for demonstration. Use it as a model to set up your customized calculation chain. After you configure your calculation chain, you can’t change the order of the processes. The calculation chain calculates promotions for only one level.

            TPMCalculationChain

            Use one of these code snippets:

            • To include all processes:

              new cgcloud.TPMCalculationChain('##SALES_ORG##').startProcess();

              .
            • cgcloud.TPM_BC_Settings s = new cgcloud.TPM_BC_Settings('##SALES_ORG##');cgcloud.TPMCalculationChain c = new cgcloud.TPMCalculationChain(s);c.startProcess();: To exclude single processes by changing the configuration of the TPM_BC_Settings object, change the settings, such as time range, and accounts of the TPM_BC_Settings object to adjust the scope of the configuration.

            Enter a valid sales org, for example, 0001 in: ##SALES_ORG##.

          4. Click Execute.
          5. To view the logs, perform one of these steps:
            • To open Log Inspector, select Open Log.
            • To open the log manually, double-click the log.
            For more information, see Schedule an Apex Class.
            After the code run, the debug log is listed on the Logs tab.
           
          Loading
          Salesforce Help | Article