Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Insert into sub page using 2018 API

Posted on by 45

Hi, I'm trying to insert into a sub page of a custom entity using the API functionality that comes with NAV 2018.

I used pages 5475 and 5476 as a reference. When I create Invoice using the following POST request on the sales invoice entity both the sales header and lines get created.

/API/beta/companies({{companyId}})/salesInvoices?$expand=salesInvoiceLines

{
  "customerNumber": "50000",
  "salesInvoiceLines":
  [
    {
      "sequence": 10000,
      "itemId": "f05a162d-35a8-4723-896c-e4eca769bf76"
    }
  ]
}


I created similar custom pages but when I try to do POST request then the parent record get's created but nothing happens in the sub page, no triggers in the sub page will run and nothing get's created.

Pages 5477 and 5479 work also, I then tried to copy those pages to new numbers and post but then I got the same results as with my custom entity, the parent get's created but no activity comes from the sub page. This tells me that rather than something is wrong with my custom entity there is something more that need's to be done for the sub page to work as API entity that can be inserted into.

*This post is locked for comments

  • Verified answer
    Vignir Einarsson Profile Picture
    Vignir Einarsson 45 on at
    RE: Insert into sub page using 2018 API

    It turned out that the name property needs to be the same as the EntitySetName property when linking then API page and the subpage together. I think I read the whole internet on the NAV API and this was never mentioned.

    2018_2D00_10_2D00_25_5F00_11_2D00_33_2D00_31.png

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans