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
          Activate Custom Font

          Activate Custom Font

          The setup of a custom font depends on your project requirement or usecase. This sample implementation uses a custom businesslogic method (setPrintFont) that is configured in a business object (BoUSer) to determine the custom font to use through the Facade.setPrintFont API.

          Required Editions

          Available in Lightning Experience in Professional, Enterprise, and Unlimited Editions that have Consumer Goods Cloud enabled.
          User Permissions Needed
          To activate a custom font: Customizer, Admin
          1. In your project in VS Code based Modeler, add a business logic method to the BoUser module by using the sf modeler workspace add command. For example:
            ? Select the resource you want to add. businesslogic
            ? Specify a name for the businesslogic: SetPrintFont
            ? Select the module to which businesslogic 'SetPrintFont' should be added. User
            ? Select a suitable option for businesslogic 'SetPrintFont'. method
            ? Select the reference object to which you want to add the businesslogic method.BoUser
            ? Do you really want to create the businesslogic 'SetPrintFont'? Yes
            Successfully created businesslogic 'BoUser.MySetPrintFont'. */Users/abc/modeler_abc/src/User/BO/BoUser/Mv1/BoUser.MySetPrintFont.bl.js
            * /Users/abc/modeler_abc/src/User/BO/BoUser/BoUser.businessobject.xml
          2. Define the SetPrintFont function in the method file. Here’s a sample configuration of BoUser.MySetPrintFont.bl.js.
            function mySetPrintFont() {
                var me = this;
            
                //set custom printfont, e.g. based on user locale/sales org / etc.
                var printFont = 'MyPrintFont_Korean';
                if (Utils.isDefined(printFont)) {
                   Facade.setPrintFont(printFont);
                }
            }
          3. Save your changes.
          4. To invoke the MySetPrintFont business logic function, add an action in Application_StartProcess.processflow.xml at $workspace/src/Application/PR/Application_Start, and then integrate the action to transition to the SetPrintFont function in the existing process action flow. For example:
            <Action name="PostSfLogin" actionType="LOGIC" call="ApplicationContext::User.login">
                  <TransitionTo action="SetPrintFont"  /> <!-- previously: LoadSfUserFavorites -->
            </Action> 
            <Action actionType="LOGIC" name="SetPrintFont" call="ApplicationContext::User.mySetPrintFont"> <!- Facade.setPrintFont-->
                  <TransitionTo action="LoadSfUserFavorites" />
            </Action>
            <Action name="LoadSfUserFavorites" actionType="LOGIC" call="Facade. loadAdvancedSearchFavoritesAsync"›
                  <TransitionTo action="LoadLuSalesOrg" />
            </Action>
          5. Save your changes.
          6. Build the contracts by using this command: sf modeler workspace build.
          7. To test your changes in the simulator app, start the server by using this command: sf modeler workspace server start.
          8. To verify that the PDF report appears in the configured custom font, generate a print preview of an order in the simulator app.
          9. If you’re satisfied with the preview, deploy the custom print fonts to CG Cloud offline mobile app on sales reps’ devices. To generate the deployment package, run: sf modeler workspace package.
           
          Loading
          Salesforce Help | Article