locked
CRM 2011 - Due to changes in child entity i need to update parent entity RRS feed

  • Question

  • Hi,

    currently i have an entity for a invoice, invoicedetails and payments. The entity payments and invoicedetails are child enitites from invoice. If i update one the child entities i need to update some values in the invoice. Currently i handle this in plugins for update, create and delete and update the parent accordingly. With one child entity this is working but if i add more child entities i need to write nearly the same code for update, create and delete and from coding perspective it's not nice.

    I just want to send an update message to the invoice entity to update the related fields. Is this possible? So i dont need to take care of all the update logic in the update, create and insert plugins.

    Kind Regards

    Markus

    Friday, February 28, 2014 1:55 PM

Answers

  • Hi Markus,

    You could always write a single plugin and check for the entity type in Target and update the parent accordingly based on the type of Child entity that is currently executing. In such case you can register the same plugin against various child entities that are related to invoices. That would give you a kind of a generic plugin that works for all child entities.

    • Marked as answer by Markus Benz Friday, February 28, 2014 2:18 PM
    Friday, February 28, 2014 2:15 PM

All replies

  • Hi Markus,

    You could always write a single plugin and check for the entity type in Target and update the parent accordingly based on the type of Child entity that is currently executing. In such case you can register the same plugin against various child entities that are related to invoices. That would give you a kind of a generic plugin that works for all child entities.

    • Marked as answer by Markus Benz Friday, February 28, 2014 2:18 PM
    Friday, February 28, 2014 2:15 PM
  • Thx for the hint :) ... did not thought at this solution :)
    Friday, February 28, 2014 2:19 PM
  • Glad I was able to help. :)
    Friday, February 28, 2014 2:50 PM