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!

  • Leo Chu Profile Picture
    10 on at
    RE: Create custom API for existing table

    Have you tried using Postman to send a POST request?

  • Suggested answer
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: Create custom API for existing table

    Hi,

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

    Thanks.

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

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