Skip to Content

Problem with updating fields in organization unit using c4codataapi

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jun 12, 2019 at 09:23 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.