locked
What is the proper message? RRS feed

  • Question

  •  

    Hello All,

     

    I'm working on a plugin and I need some guidance on the proper message under which to register.

     

    There is a custom entity called new_expense.

    The expense has a many-to-many relationship with contacts. There is an I-Frame showing the associated view of contacts on the form of the expense.

    The expense also has two important fields: a total field, and a Cost Per Contact field.

     

    The plugin retrieves the contacts that are associated with this expense. It counts them, and then divides the value in the total field by the number of contacts associated with the expense, and updates the Cost Pre Contact field with the result.

     

    This works well on the Update Message, IF I have actually updated the form. But if I just open the record, add a contact, and save the record, the Update message does not fire. What message will fire when I associate a contact with the expense?

     

    I have tried AddMember and AddMembers, but I don't know how to use them and haven't seen any documentation on them. It seems as though you can't have a primary entity for those messages. Does anyone know which message is fired when one entity is associated to another in a many-to-many relationship?

     

    Thanks in Advance,

    Wednesday, October 15, 2008 4:50 PM

Answers

  • Unfortunately no plug-ins are fired in this scenario. The best work around is to create a custom entity to manage the many-many relationship - for example a ContactExpense entity with many-one relationships to the Contact and Expense entities. You can then use the create message with the ContactExpense entity

     

    Thursday, October 16, 2008 12:06 PM
    Moderator