Appendix: Salesforce implementation
Suggested approach
This section is for reference to help you set up permissions and create a user interface (UI) in your Salesforce environment, enabling users to create orders on Anduin through the integration configured in this use case.
Upon going through all of steps in our configuration wizard, the following objects will be created in your Salesforce environment:
- Named Credential:
- Label:
[FundName]
(FundName
is the name of the fund subscription instance selected in step 3 - URL: The URL of the “Create Orders in Anduin” flow, which can be found in the “Trigger details” of step 1
- Authentication:
- External Credential:
Credential: [FundName]
(as described below)
- External Credential:
- Label:
- External Credential:
- Label:
Credential: [FundName]
- Name:
AnduinSFDCCredential_[InstanceId]
InstanceId
is the unique ID of the instance of the configured integration.
- Authentication Protocol:
Custom
- Related Named Credentials:
- Include the Named Credential created by the integration as described above
- Custom Header:
- Name:
Api-Key
- Value: The API key of the “Create Orders in Anduin” flow, found in the Trigger details of step 1
- Name:
- Label:
- Apex Class:
- Name:
AnduinFSOrderManager
- Invokable Method
invite
:- Securely trigger the “Create Orders in Anduin” via invoking the URL and Api-key setup in then pre-populated
Named Credential
andExternal Credential
above. - Pass the
ID
of the Salesforce record that is used to retrieve the data for creating and pre-filling the Anduin order, as configured in the Step 4 in the Configuration Wizard
- Securely trigger the “Create Orders in Anduin” via invoking the URL and Api-key setup in then pre-populated
- Name:
Sample
Configure Permissions
To grant your Salesforce users the permission to create orders on Anduin, follow these steps. Permissions can be granted through Salesforce “Profiles” or “Permission Sets.”
Grant Permission via Profile:
-
Navigate to Profiles:
- In Salesforce, go to Setup > Administration > Users > Profiles
-
Select Profile:
- Choose the profile (e.g., “Standard User”) to which you intend to grant permission.
-
Edit Permissions:
- Under the Apps section, select “External Credential Principal Access”
- Click Edit next to the “External Credential Principal Access.”
-
Assign External Credential:
- In the “External Credential Principal Access” table, select the External Credential of the integration flow
- Click “Save”
-
Verify Assigned Users:
- To see the users granted this permission, click the Assigned Users button on the Profile overview page.
Create a Screen Flow to Trigger the Create Order Flow on Anduin
This section guides you through creating a screen flow and adding a button to the record details page of the Salesforce object that generates Anduin orders. Although you may have multiple funds on Anduin, and thus multiple instances of this integration, you need to set up the screen flow only once. It will automatically work with all integration instances. This is a straightforward implementation designed to help you get started quickly. For a customized setup, consider consulting your Salesforce experts or the Anduin team.
Steps to Create a Screen Flow
-
Navigate to Flows:
- In Salesforce, go to Setup > Platform Tools > Process Automation > Flows.
-
Create New Flow:
- Click New Flow.
- Select Start From Scratch, then click Next.
- Choose Screen Flow and click Create.
-
Create recordId Variable:
- Open the left panel and select New Resource.
-
Create a variable named recordId to hold the Id of the record selected to create the new order.
- Resource Type:
Variable
- API Name:
recordId
- Data Type:
Text
- Availability Outside the Flow: Check Available for input
- Resource Type:
-
Get Anduin Named Credentials:
This component retrieves all Named Credentials created by the integration. The output of this component is a list of Named Credentials, each represents a fund subscription instance on Anduin. We will use the output of this element to create a picklist that allows users to select which fund subscription on Anduin they wish to create a new order on.
Create a new Get Records element:- Element type:
Get Records
- Label:
Get Anduin Named Credentials
- Object:
Named Credential
- Condition Requirements:
All Conditions Are Met (AND)
- Field:
DeveloperName
- Operator:
Starts With
- Value:
AnduinCreateOrder
- Element type:
-
Create a Collection Choice Set Resource:
- Open the left panel and select New Resource.
-
Create a new Collection Choice Set resource to allow selection from the output of the retrieved Named Credentials.
- Resource Type:
Collection Choice Set
- API Name:
NamedCredentialChoiceSet
- Collection:
Named Credentials from Get_Anduin_Named_Credentials
- Choice Label:
MasterLabel
- Data type:
Text
- Choice Value:
DeveloperName
- Click Done.
- Resource Type:
-
Get FS Order Record:
This element retrieves the record that is used to create and prefill data into the new order on Anduin. We will use the output of this component render some information of the selected record for users to review before proceed to create an order on Anduin.
Create a new Get Records element:
- Element type:
Get Records
- Label:
Get FS Order Record
- Object: Select the Salesforce object used to create and pre-fill orders on Anduin.
- Condition Requirements:
All Conditions Are Met (AND)
- Field:
Id
- Operator:
Equals
- Value:
Select variable recordId
- Element type:
-
Preview Anduin Order Screen:
Create a screen element for users to select a target fund, preview order information, and confirm order creation on Anduin.
-
Element type: Screen
-
Components:
-
Picklist:
- Component type:
Picklist
- Label:
Select Fund
- Choice: Select
{!NamedCredentialChoiceSet}
, the Collection Choice Set created earlier.
- Component type:
-
Display Text:
- Component type:
Display Text
- Content: Design the content to show order information for user review.
- Component type:
-
- Create Anduin Order Action:
Create an action element to invoke the pre-populated ApexClass for the configured integration.
- Element type:
Action
- Search Action:
apex-AnduinFSOrderManager
- Label:
Create Anduin Order Action
- Set Input Values for the Selected Action:
- Named Credential Name: Select Screen > Preview Anduin Order Creation Screen > Select_Fund
- Order Id: Select Single Variables > recordId
-
Save and Activate Flow:
- Save a new version of the Flow.
- Activate the Flow by clicking the Activate button in the top right of the Flow Builder screen.
Create the “Create Anduin Order” button
This section shows you how to create a button on a Lighting Record Page to open the Screen Flow created in the previous section.
- Navigate to Object Manager:
- In Salesforce, go to Object Manager.
- Select the object used to create and pre-fill orders on Anduin.
- Create New Action:
-
Go to the Buttons, Links, and Actions section.
-
Select New Action.
- Action Type:
Flow
- Flow: Select the Screen Flow created in the previous section.
- Standard Label Type:
–None–
- Label:
Create Anduin Order
- Click Save.
- Action Type:
- Add Button to Lightning Record Page:
- Go to the Lightning Record Pages section.
- Select the Page you want to add the button to and click Edit to open the Lightning App Builder.
- Add the button to the desired area of the page. For example, you can “Add Action” to the “Highlights Panel” of the record page, as shown in the screenshot below.
Updated about 2 months ago