Skip to main content
Solved

Custom LU and Project - Update using PATCH - DB_OBJECT_MODIFIED error

  • February 28, 2022
  • 5 replies
  • 514 views

Forum|alt.badge.img+6

Hi,

I have a Custom Logical Unit created and a projection of type Integration created for it. I am able to retrieve the data from Postman without issues.

When I try to update using PATCH, I keep getting the following error. If I pass a non-existing objkey, then it creates a new record in the CLU.

Do I need to do anything differently to be able to modify records in the CLU?

{

    "error": {

        "code": "DB_OBJECT_MODIFIED",

        "message": "Resource already modified.",

        "details": [

            {

                "code": 20114,

                "message": "ORA-20114: TestOrderDetails.MODIFIED2: The Test Order Details for Demo object has been modified by another user. Please refresh the object and reenter your changes."

            }

        ]

    }

}

Thank You.

Best answer by Dananjaya M.

Hi,

I am not sure whether this will be a solution but before sending the patch request did you trying adding ‘If-Match’ property to the request header?

Usually if the record is already created from the GET request you can receive the ‘@odata.etag’ like below →
 

 

Get the value for @odata.etag and Make sure to remove the red highlighted backslashes from the content as they are used to handle double quotes in JSON - W/\"Vy8iQUFBdkJNQUFHQUFCYXRHQUFDOjIwMjIwMTIyMDkxNTIzIg==\"

Then add this value to request header and send the request

 

Note that as mentioned the red-highlighted backslashes need to be removed before adding it to the header

/Dananjaya Misso.

This topic has been closed for replies.

5 replies

Ravi De Silva
Do Gooder (Partner)
Forum|alt.badge.img+4
  • Do Gooder (Partner)
  • 19 replies
  • May 5, 2022

Hi @khtdinesha , All, 

 

I got the same error for PATCH call for a Custom Entity. Did you manage to resolve this? If so could you please share how did you manage to resolve?

 

Thank you and Best regards,

Ravi


Dananjaya M.
Sidekick (Employee)
Forum|alt.badge.img+9
  • Sidekick (Employee)
  • 28 replies
  • Answer
  • May 5, 2022

Hi,

I am not sure whether this will be a solution but before sending the patch request did you trying adding ‘If-Match’ property to the request header?

Usually if the record is already created from the GET request you can receive the ‘@odata.etag’ like below →
 

 

Get the value for @odata.etag and Make sure to remove the red highlighted backslashes from the content as they are used to handle double quotes in JSON - W/\"Vy8iQUFBdkJNQUFHQUFCYXRHQUFDOjIwMjIwMTIyMDkxNTIzIg==\"

Then add this value to request header and send the request

 

Note that as mentioned the red-highlighted backslashes need to be removed before adding it to the header

/Dananjaya Misso.


Ravi De Silva
Do Gooder (Partner)
Forum|alt.badge.img+4
  • Do Gooder (Partner)
  • 19 replies
  • May 5, 2022

Thank you @Dananjaya M. . It works like a charm..!!!

 


Dananjaya M.
Sidekick (Employee)
Forum|alt.badge.img+9
  • Sidekick (Employee)
  • 28 replies
  • May 5, 2022

@Ravi De Silva  Great to hear 😀
@khtdinesha if the provided solution works for you as well maybe you can tag my answer as the solution 😉


Forum|alt.badge.img+6
  • Author
  • Do Gooder (Partner)
  • 17 replies
  • May 5, 2022

Hi @Dananjaya M. 

Yes, it worked for me too. Thank you!