Skip to main content

Notifications

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

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

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;
  • gdrenteria Profile Picture
    gdrenteria 12,167 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
    Andrew1986 443 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
    Saurav.Dhyani 17,965 Super User 2024 Season 2 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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans