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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Create custom API for existing table

(0) ShareShare
ReportReport
Posted on by 77

Hello all,

I've created an app for our employees and the app needs to be able to POST to the Item Journal Line table. I'm working with this walkthrough https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-develop-custom-api (I adapted the table in the walkthrough to the Item Journal Line) which has gotten me 90% there. I can GET from the API perfectly. But I keep getting an error when trying to POST and I can't figure out why.

pastedimage1655327084124v2.png

Here is the code for the API page: https://paste.mod.gg/koccooxpvubw/0

POST body: 

{
    "journalTemplateName": "OUTPUT",
    "lineNo": "10000",
    "itemNo": "PN00019",
    "postingDate": "2022-06-15",
    "entryType": "Output",
    "documentNo": "RMS 22-000609",
    "operationNo": "03010",
    "outputQuantity": "1"
}


I am confident that what I've put in the body here is valid. It has all of the fields that I included in the API page, named correctly, and the values are valid values. I am wondering, does every field in the 'Item Journal Line' table need to be in the API page for it to allow you to POST? There are a lot of fields in the Item Journal Line table, so I don't want to start trying to add them all to the API page extension/POST body if it is not the issue.

Thank you for your help!

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi,

    Please define the "Journal Batch Name" field, and then please try,

    Thanks.

  • Leo Chu Profile Picture
    10 on at

    Have you tried using Postman to send a POST request?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans