cancel
Showing results for 
Search instead for 
Did you mean: 

PATCH ODATA API call to update UserLockedIndicator Field in Entityset BusinessUserCollection in C4C

Shriaunsh
Explorer
0 Kudos
335

I want to use ODATA Receiver Adapter to update the value of a field called UserLockedIndicator to true. For this purpose, I need to invoke Entity BusinessUserCollection in C4C. ObjectID is Key field for it which i have already read using GET operation in previous step. Now I want to use this Object ID from Exchange property of last Content modifier and make a PATCH call.

Shriaunsh_0-1721739629207.pngShriaunsh_1-1721739694890.png

XML Payload in previous Content modifier Body = 

<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://my362199.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<category term="c4codata.BusinessUser" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:UserLockedIndicator>true</d:UserLockedIndicator>
</m:properties>
</content>
</entry>

Shriaunsh_2-1721739786455.png

I am getting error in IFlow for ODATA receiver adapter = com.thoughtworks.xstream.security.ForbiddenClassException: java.util.Map$Entry

ManuCasal
Discoverer
0 Kudos

I've got the same error doing something similar as you.
My payload works with postman but not in the integration flow.
Have you found the solution?

 

View Entire Topic
Shriaunsh
Explorer
0 Kudos

Yes, We need to add a Message mapping before the Batch Patch call. Via Message mapping, we need to create the payload, It will not work dynamically in the Wizard secreen. This is the Link to another Blog Post about this. Batch Operation in OData V2 Adapter in SAP Cloud P... - SAP Community

ManuCasal
Discoverer
0 Kudos
Could you send me an example?