Hi,
Im trying to create a sales invoice using the odata client (classes generated from metadata stub)
im using the following code.
Uri uri = new Uri("oursandbox-sandbox.financials.dynamics.com/.../Company('CRONUS UK Ltd.')/");
NAV nav = new NAV(uri);
nav.Credentials = new NetworkCredential("user", "key");
SalesDocuments invoice = new SalesDocuments
{
SellToCustomerNumber = "20000",
DocumentType = "invoices",
};
nav.AddObject("SalesDocuments", invoice);
SalesDocumentLines line = new SalesDocumentLines()
{
Description = "1896-S",
Quantity = 1,
DocumentType = "invoices",
};
nav.AddRelatedObject(invoice, "salesDocumentLines", line);
I currently get an error thrown on nav.addRelatedObject
error message: SalesDocuments does not have a corresponding salesDocumentLines settable property
can anyone provide me any assistance on this issue?
Thanks,
Leon