Hi,
I've got the following scenario:
- Create an Invoice (invoice entity)
- Create a payment transaction (paymentTrans entity)
- use AddLink() to link the above entities via 1:N relationsihp
- call Context.SaveChanges() to save data
PaymentTrans entity has a CREATE plugin step that requires an invoiceID so it can re-adjust balance remaining value in the invoice entity.
When the PaymentTrans plugin is triggered, there is no invoiceID in the paymentTrans entity at this stage because they are both new records being saved.
How can i get around this issue without having to do the following workarounds:
- Save Invoice separately, then save PaymentTrans and populate it with the new invoiceID
- Manually assigning a GUID to the invoice entity (instead of letting CRM give it a sequental guid)
thanks,
Paul