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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Microsoft Dynamics Nav API Error: Customer Posting Group must have a value in Customer

(0) ShareShare
ReportReport
Posted on by
I have some trouble with API method for posting order info into 'API for Dynamics 365 Business Central'.

So in official doc about order says for create order you must add 'Customer Info' to the request body. Before that you must create Customer(doc for customer).

But if i try to create order with info from Customer request, i have error:

Error: "Application_FieldValidationException","message":"Customer Posting Group must have a value in Customer"

So main question is: How to create(or get) and set Posting Group into Customer request?

Or if it wrong way, how to do this right?

Categories:
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    This is a problem in the Customer Setup. For posting, you have some fields that are necessary. Go to your Customer Card and fill that fields.

    I hope you're not creating the customers via API when posting :)

  • Community Member Profile Picture
    on at

    Thanks for you answer!

    Why i can't use API for creating customers?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    You can use the API to create customers.

    What I said before was that if you want to post documents, the customer must be completely created with an associated setup (categories, posting groups and so on).

  • Community Member Profile Picture
    on at

    Okay, and can i "reated with an associated setup (categories, posting groups and so on)" via API?

    I just try to think in situation when i haven't another way. Only API.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    You can call a codeunit that creates the customer by passing some parameters to this codeunit, but if you use a POST to the customer API you cannot call the setup in the body. The request body needs the JSON object.

    Creating a customer ready for posting (with all posting setup) is something that in my personal opinion should do by an interanl user (administrative/financial dpartment) and not by an API. The API can create the basic customer card, but posting groups and so on could depend on different administrative parameters that you could not always know.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans