Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Visual Studio Code Based Modeler for Consumer Goods Cloud
Prepare the Report Data

Prepare the Report Data

Create business logic methods in Visual Studio Code-based Modeler to define the data that business reports and charts show.

Required Editions

Available in: Professional, Enterprise, and Unlimited Editions that have Consumer Goods Cloud enabled
User Permissions Needed
To prepare the report data: CG Cloud Developer, Admin
  1. In your Modeler workspace, create a business logic method. In VS Code terminal, run sf mdl add and enter these details.
    ? Select the resource you want to add: Businesslogic
    ? Specify a name for the business logic: GetCompetitorRate
    ? Select the module to which the GetCompetitorRate business logic is added: MyDisplay
    ? Select a suitable option for the GetCompetitorRate business logic: method
    ? Select the reference object to add the business logic method: LoMyDisplays
  2. In the new business logic method, add this code to the jsDoc tags.
    * @returns competitorRate
  3. In the customization range, enter this code to define the Competitor Rate chart.
    let competitorRate;
    let competitorDisplays = 0;
    competitorDisplays = me.filter(function(comp){ return comp.competitorDisplay == "1";}).length;
    let Displays = me.getCount();
    competitorRate = 100 * competitorDisplays / Displays;
    
  4. Save your changes.
 
Loading
Salesforce Help | Article