on 12-10-2020 5:58 PM
Hi,
I am trying to upsert ToDoV2 entity into Successfactors from SAP CPI.I am using a SuccessFactors Adapter to upsert.
But the upsert operation fails with the below error for property userID.
My input payload is :
<?xml version="1.0" encoding="UTF-8"?>
<TodoEntryV2>
<TodoEntryV2>
<categoryId>41</categoryId>
<linkUrl>https://www.test.com/</linkUrl>
<status>2</status>
<todoEntryName>Test123_Odata_2</todoEntryName>
<userNav>
<User>
<empId>123</empId>
</User>
</userNav>
</TodoEntryV2>
</TodoEntryV2>
Response Payload :
<?xml version='1.0' encoding='utf-8'?>
<UpsertResponses>
<TodoEntryV2UpsertResponse>
<key null="true"/> <status>ERROR</status>
<editStatus null="true"/>
<message>Property userNav does not support inline insert operation</message>
<index type="Edm.Int32">0</index>
<httpCode type="Edm.Int32">400</httpCode>
<inlineResults type="Bag(SFOData.UpsertResult)"/>
</TodoEntryV2UpsertResponse>
</UpsertResponses>
Can you help me to resolve this error?
Kindly let me know how to handle this in CPI?
Solution is to add a link property in the XML and then add the userNav and upsert it using HTTP Adapter
<?xmlversion="1.0" encoding="UTF-8"?><TodoEntryV2><TodoEntryV2><link><userNav><userId>123</userId></userNav></link><categoryId>41</categoryId><status>2</status><todoEntryName>Test123_Odata_2</todoEntryName></TodoEntryV2></TodoEntryV2>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shruthi,
You are filling the userId on the User entity, using the userNav navigation property. You should try to fill the userId field on the TodoEntryV2 itself. Like so:
(the position within TodoEntryV2 does not matter, as long as it's a direct child of it)
<?xml version="1.0" encoding="UTF-8"?>
<TodoEntryV2>
<TodoEntryV2>
<!-- userId goes here -->
<userId>123</userId>
<categoryId>41</categoryId>
<status>2</status>
<todoEntryName>Test123_Odata_2</todoEntryName>
</TodoEntryV2>
</TodoEntryV2>
If you only have the user's empId, you should first retrieve the userId by GETing that entity and extracting tje userId from it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shruthi,
I advise to always use a mapping step and in that uses the XSD that you get from the SuccessFactors ODatav2 connector. Make sure you include all key fields when setting up the connector, as the connector will put then into the url part of the call and not in the body. SuccessFactors. Then it should always work. Usinc just a content modifier to build the body for an SF Odata request can lead to unexpected behaviour
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.