on 2019 Jun 11 11:13 AM
Hi all,
I have a requirement to update Employee in Organisation unit in C4C.
I am using standard odata service (c4codataapi) for this purpose.
entity: OrganisationalUnitEmployeeAssignmentCollection
property that i am trying to update: JobID and EmployeeID
Property of the Fields
I am sending a PATCH request with the following path and with json data
/sap/c4c/odata/v1/c4codataapi/OrganisationalUnitEmployeeAssignmentCollection('00163E832F9B1EE9A3850019AE940236')
{
"EmployeeID": "10000021"
}
I am getting an error , <message xml:lang="en">Change not possible; object does not exist</message>
Internal server Error : 500
When i do the GET for the same request , I get the Object.
Am i missing something?
Best regards,
Prat
Hi Pratyush,
I made some tests in our internal system, and was able to reproduce the same error. In fact, it seems that it is not possible to change the employee ID from an object of the OrganisationalUnitEmployeeAssignment collection, as it is a key field. In this context, the "updatable" property that you mentioned means that the object can be removed in case of a DELETE request, rather than meaning it's value can be changed.
So the best approach for this would be to perform two operations. First send a DELETE request to the collection object ('00163E832F9B1EE9A3850019AE940236'), and then perform a POST operation with the required data (the new employee ID) to create a new entry in the collection.
Kind regards,
Leonardo
Support Consultant | SAP Product Support
Community:
SAP Business ByDesign: https://www.sap.com/community/topics/business-bydesign.html
SAP Cloud for Customer: https://www.sap.com/community/topics/cloud-for-customer.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The root cause of the issue, is that the incoming value is the same with the current value in the object.
If you try to Patch passing the value <d:EndDate>9999-12-31T00:00:00</d:EndDate> without changing anything else and the current value is 9999-12-31T00:00:00 the request will fail, with the known error message.
If you try to pass the value 9999-12-30T00:00:00, that will work. I don't know why that happens, but makes no sense for a Patch request.
User | Count |
---|---|
25 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.