web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Deleting vendor invoice journal line using OData

(0) ShareShare
ReportReport
Posted on by 103

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 have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    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. 

  • tl2022 Profile Picture
    103 on at

    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."

    }

  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    I tried your query and it doesn't work from browser.

    pastedimage1684288434216v1.png

    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

  • Verified answer
    tl2022 Profile Picture
    103 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 649

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 447 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 242 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans