Having a strange issue where I have a query that will execute fine within the Epicor application, but when called with the same parameters using BaqSvc I get the below error, anyone have any ideas? Also, the query when called via REST runs sometimes with the same parameters… The server log would indicate it is related to a timeout, but it randomly gets this error and runs most of the time via REST. Any settings on the server I could check? @Olga
https://server/app/api/v1/BaqSvc/ApprovalHierachy?%24filter=LaborDtl7_TimeStatus%20ne%20%27E%27&%24top=1000&CompanyID=700&EmpID=135&emplist=205&emplist=341&emplist=344&emplist=349&emplist=S102&Days=10
{
"HttpStatus": 400,
"ReasonPhrase": "REST API Exception",
"ErrorMessage": "BAQ execution failed with error: \r\nBad SQL statement.\r\nReview the server event logs for details.",
"ErrorType": "Ice.Common.BusinessObjectException",
"ErrorDetails": [
{
"Message": "BAQ execution failed with error: ",
"Type": "Error",
"Program": "Epicor.RESTApi.dll",
"Method": "ThrowBaqRESTApiException",
"ColumnNumber": 13,
"LineNumber": 301
},
{
"Message": "Bad SQL statement.\r\nReview the server event logs for details.",
"Type": "Error",
"Program": "Epicor.RESTApi.dll",
"Method": "ThrowBaqRESTApiException",
"ColumnNumber": 17,
"LineNumber": 313
}
]
}
Further digging unveiled that if I remove one of the %24 ($ encoded) in the url (doesn’t matter if it is before filter or top) the Get request runs, question is, why?
Further investigation, if I leave the url as is and change the $top oData parameter to 500, it works