Hi, I am running into problem deleting journal lines. When I do the GET query below, it returns me the row of data that I'm expecting, but when I try to delete using the DELETE query below, I get an error that says "No resources were found when selecting for update". What am I doing wrong?
GET:
https://{{HOST}}/data/VendInvoiceJournalLines?cross-company=true&$filter=dataAreaId eq '442' and JournalBatchNumber eq '002823' and LineNumber eq 1
DELETE:
https://{{HOST}}/data/VendInvoiceJournalLines(dataAreaId='442',JournalBatchNumber='002823',LineNumber=1)
I figured it out! I just needed to put cross-company after everything, outside of the parenthesis:
https://{{HOST}}/data/VendInvoiceJournalLines(dataAreaId='442',JournalBatchNumber='002823',LineNumber=1)?cross-company=true
I tried your query and it doesn't work from browser.
But the query you have for Get works well. You can try both queries directly in browser to fetch data and see the difference.
Please use the below query to delete the record
https://{{HOST}}/data/VendInvoiceJournalLines?cross-company=true&$filter=dataAreaId eq '442' and JournalBatchNumber eq '002823' and LineNumber eq 1
Hi Mohit, so I tried that but the request is not working. I don't know what I am doing wrong:
DELETE:
https://{{HOST}}/data/VendInvoiceJournalLines(cross-company=true,dataAreaId='442',JournalBatchNumber='002823',LineNumber=1)
Error:
{
"Message": "No HTTP resource was found that matches the request URI 'https://{{HOST}}/data/VendInvoiceJournalLines(cross-company=true,dataAreaId='442',JournalBatchNumber='002823',LineNumber=1)'. No route data was found for this request."
}
Hi, Can you try adding cross-company keyword in DELETE query as well. Probably, your user's default company is not 442.
By default, OData returns only data that belongs to the user's default company. To see data from outside the user's default company, specify the ?cross-company=true query option. This option will return data from all companies that the user has access to.
You can try your Delete query directly on browser and it will fail with this error 'No webpage was found for the web address'.
Please use same as Get query and issue should be fixed.
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156