Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Odata Post with composite key (Vendor Bank Account)

Posted on by Microsoft Employee

I'm trying to create a Vendor Bank Account record with Odata (Nav 2017).

GET and PATCH methods work on the endpoint but POST always fails.

The json payload to the server is 

{
'Vendor_No': 'V1000',
'Code': '1',
'Name': 'Test Bank',

}

The response I get from the server is:

"The Vendor Bank Account already exists. Identification fields and values: Vendor No.='',Code='1'"

Either there's a bug that drops the valid Vendor No. or because it's a foreign key and part of the composite key I need to do something different to get POST to work.

 

*This post is locked for comments

  • sami khan Profile Picture
    sami khan 45 on at
    RE: Odata Post with composite key (Vendor Bank Account)

    did you solved this issue?

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Odata Post with composite key (Vendor Bank Account)

    Check the label value for the Vendor No in your Json Request. Try to retrieve and compare it with the request you are sending

  • Suggested answer
    Rabin Profile Picture
    Rabin 2,976 on at
    RE: Odata Post with composite key (Vendor Bank Account)

    Hi Brett,

    I think the data with the information you have mentioned got created the first time and then after that you are trying to run the same code which is trying to insert the same data which is generating the error.

    I would change the Key values  and try again. Since you are inserting hard code values, you might have to change the value everytime you run the code.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans