Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

multiple insert chart of accounts/customers through odata webservice in c#

Posted on by
Hi all,
I need to insert more than one accounts from c# console app that uses the power of odata webservices in business central. I can insert one but when it's come to more than one, the errors and exceptions start popping up.
 
here is my extract
 
var Context = new BC19.NAV(new Uri(serviceBaseAddress));
Context.Credentials = CredentialCache.DefaultNetworkCredentials;
 
try
{    
    var coa = new BC19.Chart_of_Accounts
    { 
        No = /111/,
        Name = /Banana/                
    };
               
    Context.AddToChart_of_Accounts(coa);
    Context.SaveChanges();
}
 
This works but if I want to insert more than one am not able. Context.AddToChart_of_Accounts(coa) doesn't allow if coa has more than one account. The issue is the same also in case of the multiple customers.
 
Kindly assist
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,696 Super User 2024 Season 2 on at
    multiple insert chart of accounts/customers through odata webservice in c#

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans