In your Consumer Goods Modeler workspace, add a method to the Display module to launch a
third-party app from the Consumer Goods offline mobile app. Sales reps can tap the maps app launch
button in CG offline mobile app to launch apps such as Google Maps. Customize the business logic
method to pass the latitude and longitude parameters, so that sales reps navigate to the correct
coordinates.
Required Editions
Available in: Professional, Enterprise, and Unlimited Editions
that have Consumer Goods Cloud enabled
User Permissions Needed
To add a method to launch Google Maps:
CG Cloud Developer, Admin
Note If you’re a Salesforce developer or a partner developer, make sure you don’t pass any
sensitive information to the third-party app.
To create a business logic method to open Google Maps, open the 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: NavigateTo
? Select the module to which the NavigateTo business logic is added: MyDisplay
? Select a suitable option for the NavigateTo business logic: async method
? Select the reference object to add the business logic method: BoMyDisplays
In the customization range of the new business logic method, enter this code.
var customer = me.getLuCustomer();
let latitude =0;
let longitude= 0;
if (customer) {
latitude=customer.getLatitude();
longitude=customer.getLongitude();
}
const url = `http://maps.google.com/maps?mode=d&daddr=${latitude}+${longitude}`;
var promise = Facade.startThirdPartyAsync(url,{});
Save your changes.
Build your contracts to check for validation errors. Run sf mdl
build.
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.