Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
PriyankaChak
Active Contributor

Introduction:


In this blog post, I will explain how to use Salesforce Adapter in Cloud Integration for a case replication scenario.

Scenario:



  1. External system will send details related to the logged ticket in JSON format. This is mimicked using Postman. The message will contain requester’s email, account no of the organisation and other details related to the raised ticket.

  2. Cloud Integration flow will receive the details and send it to Salesforce either to create a new case or update an existing case. Ticket no. will be used as an External ID in Salesforce for the 'upsert' function.

  3. The response will be sent back to the calling system. In my case, Postman.


Prerequisite Setup:



  1. Set up Integration Suite. This is necessary to create Integration flow in Cloud Integration. 

  2. Download and install Salesforce Adapter in Cloud Integration. Help Link: Salesforce Adapter. Go to Integration Package in CI -> Artifacts tab -> Add -> Integration Adapter. After successful deployment, it will show up in the Overview/Manage Integration Content, shown as below.                         

  3. Create a trial account in Salesforce (https://developer.salesforce.com)


Setup in Salesforce:



  1. After creating a trial account in Salesforce, go to Settings -> Reset My Security Token. It will send a new token to the registered email. I will use this token in Cloud Integration flow later along with my login credentials for Salesforce connectivity.



Reset Security Token in Salesforce


   2. Create a Connected App in Salesforce. It will create a Consumer Key and a Secret.                          


Connected App in Salesforce


    Help Link: Connected App in Salesforce

3. Create a custom field in Salesforce for Case object which will be used as External ID.

       


Custom Field in Salesforce


   Help Link: Custom field in Salesforce

 

Design Solution in Cloud Integration:


 


Integration Flow


 

Step 1:


Configure sender channel as below.


HTTPS Sender Channel



Step 2:


Call Local Integration Process via Process Call.

Step 2.a:


Convert JSON message to XML.


JSON to XML Converter


 

Step 2.b:       


Set below properties in Content Modifier.

AccountNo will be used to get the Account ID in the next step.

queryId from Input message will be used as External ID.


Content Modifier



Step 2.c:


Use Request Reply step to fetch Account ID using account number.


Receiver Salesforce Adapter Connection tab




  • Basic Credential: Create User Credential in Manage Security Material. Login credentials will be used as user and password.

  • Security Token Alias: Create Secure Parameter in Manage Security Material to save Salesforce security token.

  • OAuth Credential: Create User Credential in Manage Security Material. Consumer key and consumer secret will be used as user and password, respectively.



Receiver Salesforce Adapter Processing tab



Step 2.d:


Configure the Content Modifier step as shown below.


Content Modifier Exchange Property



Content Modifier Message Body



Step 2.e:


Use Message Mapping to map the input fields to desired sObject XSD structure. The XSD structure for sObject can be downloaded from Eclipse plugin - Salesforce Adapter Workbench.


XSD Generator



Message Mapping


Use Groovy Script to get value of property AccountId.


Groovy Script



Step 2.f:


Use Request Reply step to send data to Salesforce.


Receiver Salesforce Adapter



Step 2.g:


Convert received XML payload back to JSON.

Test Execution:


Test Case 1: Create a new case in Salesforce


Trigger message using Postman tool to the cloud integration flow endpoint.


Postman Request/Response


The record is created in Salesforce.


New Case in Salesforce



Test Case 2: Update the case in Salesforce



Postman request/Reply


The record is updated in Salesforce.


Updated Case in Salesforce


Please note the data used in executing these scenarios is test data/ fake data only.

Behind the Scene:


While configuring the salesforce adapter, only the generic login URL of Salesforce is used. The actual execution happens in two steps. Both of these steps are handled by adapter level internally.

Step1: A call is made to https://login.salesforce.com/services/oauth2/token into Salesforce using login credentials, security token and client credentials. In response, salesforce returns an access token and instance URL.

Step 2: The next call is made to the instance URL along with a specific path (based on sObject) using the access token. That's it!

Thank you for reading this blog post. Please feel free to share your feedback or thoughts or ask questions in the Q&A tag below.

https://answers.sap.com/tags/67837800100800006801

Regards,

Priyanka Chakraborti

 

Next - SAP Cloud Integration with Salesforce - Part 2

35 Comments
Excellent blog with step by step explanation, much helpful.
PriyankaChak
Active Contributor
0 Kudos
Thanks 🙂
SyambabuAllu
Contributor
Hi Priyanka,

Thanks for sharing in detailed blog on integration with salesforce adapter.

Thank you,

Syam
ymAllen
Participant
Very well presented. Like it 🙂
PriyankaChak
Active Contributor
0 Kudos
Thanks 🙂
PriyankaChak
Active Contributor
0 Kudos
Welcome 🙂
mvalicpi40
Explorer
Hi Priyanka,

 

Nice Blog 🙂

Can you provide steps to genarate XSD or attach the XSD you used in this blog.

Thank you

 
PriyankaChak
Active Contributor
0 Kudos
Hi Mastan,

To download the XSD, you need to add Eclipse plugin for Salesforce Adapter Workbench.

Help Link:  Salesforce Adapter. It provides the path link for downloading the plugin from SAP Software Download Center. In the downloaded zip file, you will also get the documentation to use it for XSD generation.
mvalicpi40
Explorer
0 Kudos
Thank you Priyanka, it solved my problem

But when i deployed the artifact getting below error and also attached modeling


 

Error Details









[CONTENT][CONTENT_DEPLOY][GenerationFailed] : Validation failed: 1. Request Reply 1 is not supported for the adapter 2. Request Reply 2 is not supported for the adapter















PriyankaChak
Active Contributor
0 Kudos
Hi Mastan,

Try to re-deploy the Iflow again. I also faced the same issue. After 2nd try, it successfully deployed.
mvalicpi40
Explorer
Hi Priyanka,

thank you, redeployment worked 🙂

 

 
PriyankaChak
Active Contributor
0 Kudos
Welcome 🙂
0 Kudos
Hello Priyanka,

Hope you are doing well and safe.

 

I just read your article. Honestly speaking, I learnt a lot from it. Design solution in cloud makes good impact on me.Thanks for sharing.

By the way, I just wanted to divert your attention here by presenting the The Ultimate Guide to Salesforce Integration With Third-Party Apps.

I hope once you read it, you will have a different approach towards salesforce integration.

 

Cheers

Have a nice day

Priyansh
PriyankaChak
Active Contributor
0 Kudos
Thanks.
0 Kudos
Informative blog!
PriyankaChak
Active Contributor
0 Kudos
Thanks
former_member771818
Discoverer
0 Kudos
Hi Priyanka,

Excellent blog with step by step. Could you provide steps to generate XSD or attach the XSD which you used

 

Thanks.
former_member771818
Discoverer
0 Kudos
Hi Mastan,

 

Could you provide steps to generate XSD or attach the XSD which you used.

 

Thank you.
PriyankaChak
Active Contributor
0 Kudos
Hi Vasudevan,

To download the XSD, you need to add Eclipse plugin for Salesforce Adapter Workbench.

Help Link:  Salesforce Adapter. It provides the path link for downloading the plugin from SAP Software Download Centre. In the downloaded zip file, you will also get the documentation to use it for XSD generation.

Regards,

Priyanka
Vimalsap
Participant
Hi Priyanka,

 

Brilliant blog.. Covers all the details for Sales force ticketing integration.

Keep blogging!!!!

Regards

Vimal
PriyankaChak
Active Contributor
0 Kudos
Thanks Vimal 😊
0 Kudos
Hi Priyanka

Thanks for the blogpost. Sadly I got the following Problem while configuring the adapter:

  1. We created the user credentials in CPI

  2. CPI Token is configured as a secure parameter

  3. oAuth configured according to the official documentation, user = client id and password = client secret. Is this correct? 


Currently we get the following error in the CPI:

org.apache.camel.CamelException: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <array> <error>invalid_grant</error> <error_description>authentication failure</error_description> </array>

In Postman the request is working but as granttype we have set password instead of cliient_credentials.

Regards

Lucas

 
PriyankaChak
Active Contributor
0 Kudos
In OAuth Credential, you have to use consumer key and consumer secret that gets generated during creation of connected app ( step 2 of Setup in Salesforce).
0 Kudos

Hi Priyanka

 

I am beginner with CPI and Open connectors. Is there an article which explains Salesforce integration with 3rd party applications without installing the adapter. I do not have Admin in downloading the package and the eclipse setup .

I tried to import the .esa file and deploy but it do not give me the ability to edit iflow

 

former_member840362
Discoverer
0 Kudos
Hi Priyanka,

 

Excellent Blog, Thanks for sharing it.

I have question handle multiple External ID's on Upsert query. How to Handel this in CPI -Rojo SFDC adapter.

For example :Upsert

salesforce Object : Contract,Contract_Product__c

External ID: ContractNumber,Name

 
0 Kudos

Thanks Priyanka for this blog, and it really helped us alot.

In our scenario we have sender as SFDC, which post data based on CPI REST service /endpoint url.

Also, we have Oauth authentication from SFDC to CPI, and we have created Service keys from BTP Cockpit and it's working fine in postman.

In SFDC, they require - Tokem url , Client  id, Client secret & Authentication url. But in Service key we don't receive Authentication  url and it's mandatory for SFDC.

could you please help what we need to proivde?

0 Kudos
Não consegui baixar o Salesforce Adapter, existe algum outro local para baixá-lo?
revathy999
Discoverer
0 Kudos
Is SalesforceAdapter available with trail version of SAP CPI? Bcz, when I am trying to download, it was ended up with RoadMap page, and can't able to do the download and install it in my IntegrationSuite.
PriyankaChak
Active Contributor
0 Kudos
Hi Revathy,

It is not available for trial.

Regards,

Priyanka
revathy999
Discoverer
0 Kudos
Ohh Okae thanks, I also have to do leadAssignment in C4C using Salesforce MC lead data. Is there any peculiar document is available for that?
krishg
Active Participant
0 Kudos
We are using a free tier version of sales force adapter. We keep getting unknownhost exception. We are migrating from PI/PO and trying to use custom apex class (so tried Rest call with custom request or Apex call). both of them do not work.

 

when i check the salesforce logon history, it says logon successful, but no debug logs are getting generated.
markkhabosha
Explorer
0 Kudos
Hello Priyanka,

We want to integrate SAP S/4HANA 1909 on-premise with Salesforce.
Can we do it with these tools:
https://www.sap.com/assetdetail/2020/05/54722dfe-947d-0010-87a3-c30de2ffd8ff.html
https://api.sap.com/package/RojointegrationforSAPS4HANAonPremisewithSalesforce/overview
Also, are these free and included in the SAP S/4HANA 1909 on-premise package? or they are paid services?

Thanks,
Mark
sayed42
Explorer
0 Kudos
Hi Priyanka,

 

I've created app, user and case object and successfully connected my salesforce account and app with the eclipse but I'm stuck in XSD generator as It keeps on loading as shown below.


 

Please let me know whatever it is.

 

Thanks,

Sufiyan.
sayed42
Explorer
0 Kudos
Hi Vasudev,

 

Go through this link maybe you can find your solution:

https://www.youtube.com/watch?v=0n5NnbTy9E8

 

Thanks,

Sufiyan.
purusottam_agar
Explorer
0 Kudos
Hi Priyanka,

very informative blog!

Could you please help me with information on salesforce adapter deprecation?

As per SAP note 3001980 salesforce adapter will no longer be available from 1st Jan 2024. But Advantco -SFO and ROJO-salesforce will be available right.

Please let me know your comments.

Best Regards,

Purusottam Agarwal

 
Labels in this area