We might get the below error while using Xrm.WebAPI.
‘Bad Request – Error in query syntax.’

One of the reasons could be that while setting up the Lookup field, we haven’t removed the curly brackets.
Use the below function to replace/remove them.

- let result = myGuid.replace(/[{}]/g, ”);
- let result = myGuid.replace(“{“, “”).replace(“}”, “”);
Hope it helps..
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

One thought on “Fixed – Bad Request – Error in query syntax while using Xrm.WebAPI”