Server code error after v6 update

Hi - Noticed a couple of my event handlers are breaking after the v6 update. Backendless console is showing this error message:
Thu Jun 18 2020 16:03:11 GMT-0500 (Central Daylight Time) | SERVER_CODE | ERROR | [17017] Error: Entity with ID undefined not found at new ResponseError (/usr/local/lib/node_modules/backendless-coderunner/node_modules/backendless-request/lib/index.js:42:116) at checkStatus (/usr/local/lib/node_modules/backendless-coderunner/node_modules/backendless-request/lib/index.js:237:9) at processTicksAndRejections (internal/process/task_queues.js:97:5)

Not sure what this error means but this was working fine prior to the update. Please assist. Thanks so much!

Hi Sean,

Would it be possible to trace it to the API call which results in the error? It looks like a request is made to do something with an an object whose ID is undefined.

Regards,
Mark

Hi Mark- Thanks for the reply! Yeah it’s actually a PUT request causing the issue. Ran the api outside of business logic and it is returning a 400 response:
{
“code”: 1000,
“message”: “Entity with ID undefined not found”,
“errorData”: {}
}

The interesting thing is that the record does actually update fine with the body I pass but it returns this error which then breaks rest of business logic script.

Hi Sean,

When you invoke the API outside of BL, are there any business logic before/after event handlers which would be engaged in the execution of the API call?

Regards,
Mark

Hi Mark, Yes there is! Amazing how you guys can point someone in the right direction without knowing much about the application :slight_smile:. I have an after update event handler on that api which will try to grab a field from that request object and use that field to delete another object. The issue was that i try to grab a field from that request object that until now was there for me to grab. It appears the change is that the request objects on an update request no longer contain all of the fields for the object being updated. Just the field that was updated, updated timestamp and the objectid. The field i needed for my script was no longer there. I switched the code to look at the response object now and it is working fine. Hopefully, this might help someone else with similar functionality. Thanks again for your help!