Loading
Feature degradation | Gmail Email delivery failureRead More
Set Up and Maintain Retail Execution
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
          Define Company Logo on User Cockpit

          Define Company Logo on User Cockpit

          Customize the UI, lookup, datasource, and process contracts in Visual Studio (VS) Code based Modeler. Build the contracts and review the customization in the simulator app.

          Required Editions

          Available in: Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled
          1. To load the sales organization, in VS Code based Modeler, open the Application_CockpitProcess.processflow.xml contract and add this code.
            <Action name="CardUserWelcome_loadData" actionType="LOAD" type="LuCallCountByDate">
                      <Parameters>
                            <Input name="cardDate" value="ProcessContext::CardDate" />
                      </Parameters>
                      <Return name="ProcessContext::LuCallCount"/>
                      <TransitionTo action="LoadSalesOrg" />
                </Action>
                <Action name="LoadSalesOrg" actionType="LOAD" type="LuSalesOrg">
                      <Return name="ProcessContext::SalesOrg" />
                      <TransitionTo action="LoadTodoCount" />
                </Action>
                <Action name="LoadTodoCount" actionType="LOAD" type="LuTodoCountByDate"/>
          2. Save your changes.
          3. To bind the companyLogo and companyLogoFileType targets, add this code to the UserWelcome section in the Application_CockpitUI.userinterface.xml contract.
            <UserWelcome name="UserWelcomeCardUiPlugin">
                  <Bindings> 
            <Binding target="userImage" type="Blob" binding="ApplicationContext::User.profilePicture" />
            <Binding target="companyLogo" type="Blob" binding="ProcessContext::SalesOrg.mediaPath" />
            <Binding target="companyLogoFileType" type="Text" binding="ProcessContext::SalesOrg.fileType" />
            <Binding target="userName" type="Text" binding="ApplicationContext::User name" bindingMode="ONE_WAY" />
          4. Save your changes.
          5. To define the simple properties for mediaPath and fileType, add this code to the LuSalesOrg.lookupobject.xml contract.
            <SimpleProperty name="legalInformation" type="DomLongDescription" dataSourceProperty="legalInformation"
                  <SimpleProperty name="currency" type="DomCurrency" dataSourceProperty="currency" />
                  <SimpleProperty name="mediaPath" type="DomBlob" dataSourceProperty="mediaPath" />
                  <SimpleProperty name="fileType" type="DomFileType" dataSourceProperty="fileType" />
              </SimpleProperties>
          6. Save your changes.
          7. To link the Sales_Organization, SF_FileLink, and SF_File entities to each other through joins and conditions, add this code to the DsLuSalesOrg_sf.datasource.xml contract.
            <Attribute name="accountNumber" table="Sales_Organization__c" column="Account_Number__c" />
                <Attribute name="legalInformation" table="Sales_Organization__c" column="Legal_Information__c" />
                <Attribute name="currency" table="Sales_Organization__c" column="Currency__c" />
                <DerivedAttribute name="mediaPath" value="CASE SF_File.Usage__c WHEN 'Icon' THEN SF_File.VersionData ELSE ' ' END" />
                <DerivedAttribute name="fileType" value="replace(SF_File.PathOnClient, rtrim(SF_File.PathOnClient, replace(SF_File.PathOnClient, '•', ")), ")"/>
            </Attributes>
            <Entities>
                 	<Entity name="Sales_Organization alias="" idAttribute="Id" />
            <Entity name="SF_FileLink" alias="">
                     <Join Type="left outer">
                         <SimpleJoin>
                              <Condition leftSideValue="SF_FileLink.ParentId"comparator="eq" rightSideType="Attribute" rightSideValue="Sales_Organization__c.Id" />
                         </SimpleJoin>
                     </Join>
                </Entity>
                <Entity name="SF_File" alias='>
                     <Join Type="left outer">
                         <SimpleJoin>
                              <Condition leftSideValue="SF_FileLink.FileId" comparator="eq" rightSideType="Attribute" rightSideValue="SF_File.Id" />
                         </SimpleJoin>
                    </ Join>
                </Entity>
            </Entities>
          8. Save your changes.
          9. To retrieve the IDs of files from either sales folder or sales organization and to label sales organization file IDs as parent ID, add these snippets in the DsBoSfReplicationCallbacks_sf.datasource.xml contract.

            Add this SQL query statement at the highlighted position in the AllMandatoryAttachmentsForSync section.

            sqlStmt      += "UNION ";
            sqlStmt      += "SELECT SF_File.Id FROM SF_File ";
            sqlStmt      += "INNER JOIN SF_FileLink ON SF_FileLink.FileId = SF_File.Id ";
            sqlStmt      += "INNER JOIN Sales_Organization__c ON SF_FileLink.ParentId = Sales_Organization__c.Id ";
            Placement position of the SQL query snippet in the AllMandatoryAttachmentsForSync section.

            Add this snippet before the Visit section in the AllAttachments section.

            
            //######################################################
            //## Sales Org ##
            //######################################################
            sqlStmt      += "SELECT Id as parentId FROM Sales_Organization__c ";
            sqlStmt      += "UNION ";
            //#####################################################
            //############
            //## Visit  ##
            //############
          10. Save your changes.
          11. To check for validation errors, build the modified contracts by running this command in VS Code based Modeler: sf modeler workspace build
           
          Loading
          Salesforce Help | Article