Summary: | In this example we will show you how to add a new Custom action on the standard Person search profile, which will allow you to search LinkedIn directly from a result card (using default renderer). |
Article Type: | FAQ/How-To Guide/Technical Article/ |
Related Product(s): | This article relates to the following products:
|
Adding a Custom Action to search LinkedIn from a result card
Task:
We are going to add a new Custom action on the standard Person search profile which will allow us to search LinkedIn from within a result card (using default renderer).
Prerequisites:
- A Dynamics 365/CRM environment with an installation of Paribus Interactive™. If you don’t have Paribus Interactive yet, please request a free trial here.
- A basic understanding of Dynamics web resource customization
- Appropriate Dynamics security role privileges to access Dynamics Customizations and Solution Manager Client application
- A LinkedIn account to access search results
Steps:
- Sign in to the Solution Manager and locate the Person Search rule (shown) in the CRM General Search Rules Double click this or click on the Edit button to open this Rule for editing.
- Click Paribus Search Operators tab and double click on Lead Search
- Click Paribus/CRM Entities tab and double click on CRM Lead
- With the Paribus Result Actions tab selected click on the Add button
- Configure a Custom Entity Action as shown below. For this example we will add our custom button to the “More Menu” within the result card.
- OK each screen and then Commit the changes
- In the CRM instance navigate to the Paribus Interactive™ search screen and perform a search using the Person Search profile that we just edited (you will need to ensure a Lead is returned). You should see the new LinkedIn Entity Action you just configured.
- Click the new button, and nothing will happen as we still need to define the custom function.
- In CRM go to Settings, Customizations, Customize the System.
- Click Web Resources in the left navigation and locate the web resource called Paribus Interactive Custom Functions (note: you will need to have installed the Paribus Interactive Custom solution to have this in your system, and it will need to be included in the OnLoad of the form if you are not on the Paribus Interactive™ search screen).
- You will need to edit this web resource. This can either be done by uploading a new file or editing in the Text Editor. For this example we will use the Text Editor. Click on the web resource to open it and then click on the Text Editor.
- Scroll to the bottom of the file and add the following script in between the end of the last function and the return block.
//This is an example of a custom result card action that can be defined in the search operator
//The below will open a new window and search LinkedIn for the Name provided
function customLeadSearchLinkedIn(context) {
var url = ‘https://www.linkedin.com/search/results/index/?keywords=’ + encodeURIComponent(context.EntityInfo.Name);
window.open(url, ‘_blank’);
}
- You will also need to add the following return (make sure all return functions are separated by commas).
CustomLeadSearchLinkedIn: customLeadSearchLinkedIn
- The end of the file should now look something like this
…}
//This is an example of a custom result card action that can be defined in the search operator
//The below will open a new window and search LinkedIn for the Name provided
function customLeadSearchLinkedIn(context) {
var url = ‘https://www.linkedin.com/search/results/index/?keywords=’ + encodeURIComponent(context.EntityInfo.Name);
window.open(url, ‘_blank’);
}
return {
RenderPBiResultsForPeople: renderPBiResultsForPeople,
CustomLeadSearchLinkedIn: customLeadSearchLinkedIn
};
}();
- Click OK, click SAVE, and then click PUBLISH. You can then close the customization windows.
- Refresh/navigate to the Paribus Interactive™ search screen and perform the same search as before.
- Click on the new LinkedIn button and a new window/tab should open with the search results from LinkedIn for the Lead that was clicked.
Congratulations, you have just created your first Custom Paribus Interactive™ Action Button. This example combines the fuzzy search ability of Paribus Interactive™ with a simple keyword search within LinkedIn using the first and last name of a Lead result.
Why stop there? Now you know the basics of custom actions, you can create much more complicated scenarios by following the same steps as above to call upon your own more advanced JavaScript functions.
Further Information: |