Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

'Page' does not contain a definition for "APIV2 - Purchase Invoices"

(0) ShareShare
ReportReport
Posted on by 19

I am getting this error "'Page' does not contain a definition for "APIV2 - Purchase Invoices" when i am trying to use the below method in my custom API, any clue why this is happening?

error line : ActionContext.SetObjectId(Page::"APIV2 - Purchase Invoices");

local procedure SetActionResponse(var ActionContext: WebServiceActionContext; InvoiceId: Guid)
    var
    begin
        ActionContext.SetObjectType(ObjectType:: Page);
        ActionContext.SetObjectId(Page::"APIV2 - Purchase Invoices");
        ActionContext.AddEntityKey(FieldNo(Id), InvoiceId);
        ActionContext.SetResultCode(WebServiceActionResultCode::Deleted);
    end;
  • Gerardo Rentería García Profile Picture
    20,957 Most Valuable Professional on at
    'Page' does not contain a definition for "APIV2 - Purchase Invoices"
    Hi
    They are not visible on this page, and will not be. They are pages that are available to be consumed from external media. Whether it is a third-party application, powerplatform, you can test it through tools like postman and others.
    BR
    GR
  • Andrew1986 Profile Picture
    63 on at
    'Page' does not contain a definition for "APIV2 - Purchase Invoices"

    Guys, thanks for the resource links.
    But, I am not a developer, but a business analyst.

    Could you explain in simple terms what needs to be done to make the objects with IDs 30011, 30009, 30012, and 20023 appear on the Web Services page in Business Central?
    We have switched to API version V2, but I don't see these objects on the Web Services page interface when I select the object type PAGE.

    This screen includes 30012.
    But in my case, their absent.

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,322 Super User 2025 Season 1 on at
    RE: 'Page' does not contain a definition for "APIV2 - Purchase Invoices"

    Hope this helps.

    [View:https://youtu.be/TSQiE42tDwU:320:240]

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans