Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
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
          Generate a Datasource Preview

          Generate a Datasource Preview

          To verify that you correctly defined the datasource contract, review the SQL statement generated from the datasource contract.

          Required Editions

          To explore and query SQLite databases, we recommend that you use the SQLite (or equivalent) extension in Microsoft Visual Studio Code.

          Available in: Enterprise, Performance, and Unlimited Editions
          User Permissions Needed
          To generate datasource preview: Customizer, Admin

          Extract the SQL query statement that’s constructed from your datasource contract. Then, execute the SQL query against the database to confirm that the query is constructed properly.

          1. At the command prompt or in a Terminal window, change directory to your workspace.
          2. Build the workspace. Run: sf modeler workspace build
            Alternatively, run one of these alias commands:
            • mdl ws build
            • mdl build
          3. Start the server. Run: sf modeler workspace server start
            Alternatively, run one of these alias commands:
            • mdl ws server start
            • mdl ws simulate
            • mdl simulate
          4. To view the reference application or the app in a simulated UI, open the URL http://localhost:3000/framework/index.html?desktop in a Google Chrome browser in incognito mode.
          5. Open Chrome Dev Tools and enable Toggle device toolbar (⌘ ⇧ M).
            Make sure Info logs are available.
          6. On the simulator app in the development mode, press F12 or tap thrice on the header or any area outside the widgets to open the logs. On the Log Settings tab, ensure that Enable Logs / AppLogs is enabled and Logs to console is selected.
          7. To locate the SQL statements constructed from the DS file, use one of these options:
            • On the Logs tab, scroll to the log entry containing the desired SQL statement.
            • On Chrome Dev Tools → Console tab, run a search and go to the desired SQL query in the logs.
            SQL Statement from DS file
          8. Copy the SQL statement to a new query in SQLite and format the statement to make it readable. Run the query on the database.
            Important
            Important Make sure that you replace the ‘?’ character in the SQL statement with the necessary parameters for a successful execution of the SQL query.
          9. Review and verify that the generated output is as expected.
            If the query returns empty or incomplete results, make the necessary changes to the datasource contract and repeat the procedure.
           
          Loading
          Salesforce Help | Article