Installing Cognitive API based Recommendations against Products in each Sales Opportunity page

Please follow the below instructions step by step:

 Prerequisites:

  1.        Salesforce Organization
  2.        Azure Subscription
  3.        Azure Powershell
    1. Downloadable from http://aka.ms/webpi-azps.
    2. Help document: https://azure.microsoft.com/en-in/documentation/articles/powershell-install-configure/)

 Steps:

1. Please install the package (to display recommendations in SFDC) from Sales Force App Exchange using below link
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t28000000VQsV
(If using sandbox environment please replace the ‘login.salesforce.com’ part of the URI with ‘test.salesforce.com’)

2.    After installing the package, please configure the Visual Force page to Opportunity default view.

Please follow the steps to configure the default view to Visual Force page.

  •        In your Salesforce organization home page, Click on Setup.
  •        Type “Opportunities” in Quick Find / Search …
  •         Select Buttons, Links and Actions option in the opportunities entity.
  •        Select Edit link opposite to View. Select Visualforce Page as “recommendationapi”.
  •    Click Save button.

 Recommendation API in sales Force

 

Select Edit Link opposite to View.  Select VisualForce page as recommendationapi.

Override properties

 

 3.   For Recommendation API subscription please go to https://ms.portal.azure.com/ and click on New >> Intelligence + analytics >> Cognitive Services APIs.

4.   In Create dialogue provide the Account Name as ‘SFDC-Recommendation’, Subscription, Resource group as ‘SFDC-Reco-RG’, Pricing Tier and Resource group location. In API type section, select Recommendations API, then select create. In Pricing Tier section select an appropriate pricing tier according to your requirement.

 

Azure portal

 

 

Signup for Cognitive API to setup crosssell

 

 

Add Account Name

5.   In All Resources section of the portal, please search for your Cognitive Services account. From Keys section copy and save any of the two Cognitive Services account keys.

 

Select all resources

 

Filter item

 

 

Keys for Cognitive Account

 

 

6.  To test the package in developer org, please upload the test data to the Dev org following the below instructions.

 

Ignore this step if the organization contains sufficient data or sandbox version of Salesforce organization is used for testing.

a.  Download TestDataUploader from https://crosssell.codeplex.com/ and extract the files to a local directory.

b.  Click on the exe file TestDataUploader.exe. Command line will prompt the user to enter

 

      •    SFDC user id
      •   Password
      • Security token.

Enter security token

  • Please enter these details for your salesforce org and press enter.

 

7.  It will start loading data to the following SFDC’s objects.

                                                               i.      Product

                                                             ii.      PriceBook

                                                            iii.      PriceBookEntry

                                                            iv.      Account

                                                              v.      Opportunity

                                                            vi.      OpportunityLineItem

8.  Open Windows Power shell in your system and run following command and provide the below inputs when prompted.
Command:

  •        cd “<file path where files were extracted>”
  •        Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force

.\SetProdRecommendation.ps1

 Powershell

 

Inputs:

 

  1.        Salesforce User Id
  2.        Salesforce Password
  3.         Salesforce Security Token
  4.        Cognitive Services account registration User Id (azure registered Id)
  5.        Cognitive Services account Key

 

9.   Monitoring the Recommendation API Training Azure Data Factory.

  •        Go to https://ms.portal.azure.com >> All Resource >> Filter Items… text box and enter ‘SFDCReco’. In the Subscriptions filter option select ‘Select All’ option.
  •        From the displayed resources, click on the resource of TYPE ‘Data Factory’ with name of format SFDCRecoXXXX in Resource Group ‘sfdcrecorg’, where XXXX can be a random number between 0 – 9999999.
  •         In Data Factory Overview pane click on Monitor and Manage option. Which opens a new window (or tab) for https://datafactory.azure.com. Select any activity from left pane to review its state and logs related to it.

 

 

Last edited Nov 1, 2016 at 8:39 PM by prashdesh, version 13