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..
One thought on “Fixed – Bad Request – Error in query syntax while using Xrm.WebAPI”