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

Report
All responses (
Answers (