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

Announcements

News and Announcements icon
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 89

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,812 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,050 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,351 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,200 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans