I want to create an invoice, based upon a custom contract.
Within a contract we have a lookup to an account, but the invoice class requires a Customer, not an account.
I don't know how to get a customer, when I only know the contact.
When I try the following code, I get an error message:
Dim insCustomer As New srv_crm.Customer
insCustomer.type = srv_crm.EntityName.account.ToString
insCustomer.Value = insContract.iact_nwaccountid.Value
Me.Log("insCustomer.Value: " & insContract.iact_nwaccountid.Value.ToString)
Dim insInvoice As New srv_crm.invoice
insInvoice.totalamount = monMaandbedrag
insInvoice.totaltax = monTaxRate
insInvoice.customerid = insCustomer
<error>
<code>0x8004022d</code>
<description>The customer is invalid.</description>
<type>Platform</type>
</error>
The customer does in fact exist. This way I cannot create an invoice programmaticaly...
I call the code from a workflow.
I am really stuck with this......