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 :
Business Central forum

Use OData autogenerated proxy to add e.g. a Customer to a given Company in Business Central?

(0) ShareShare
ReportReport
Posted on by

Dear BC experts,

Is it possible to use the Microsoft.OData.Client autogenerated proxy to add e.g. a Customer to a given Company in our Business Central instance?

I followed this manual for trying the addition:
docs.microsoft.com/.../how-to-add-modify-and-delete-entities-wcf-data-services
- method AddToCustomers(Customer c)
This method is problematic because I cannot state the Company to which the customer has to be added.
- method AddRelatedObject(Company co, "Customers", Customer cu)
This one seems suitable but throws this exception: "The closed type Microsoft.NAV.Company does not have a corresponding Customers settable property".
(I tried singular "Customer" for parameter 2, but: similar result)

So, how to do it? Is a generated proxy suitable for such a purpose?

The proxy class was generated following this manual:
stoneridgesoftware.com/working-with-the-odata-endpoint-in-dynamics-365-for-operations
Tested:
- I can retrieve the list of companies from within my BC Sandbox, and
- I can get the list of Customers within a given Company
- I can update the Email property of a SalesOrder using the UpdateObject method described in the manual referenced above.

Your answer is greatly appreciated.

With best regards,
Wolter Kaper

Categories:
I have the same question (0)

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