0
votes

I am currently working on a little crm 2011 Plugin which should update all assoiated contacts when an accounts data is changed. So the plugin works on the Update Message in the Post-Operation stage.

It is working nearly as I would like it to, but there is one small problem. In the case a user opens up an account and changes the data of this account, when he fills out a previously empty field these changes will not be transfered to all contacts.

My problem in this case is, since I check if the changed attribute names (keys in the AttributeCollection) are also available on the contacts, that when a empty field got filled out, the affected contacts will not have a key value pair I could check if the key is presenent.

e.g. an account has no value for the field "street_1", afterwards this field gets a value from a user. Now every contact, which belongs to this account, should be updated and get this value copied into the contact field "street_1" but since in the contact, "street_1" was empty, the contacts I retrive which belong to the account don`t have a "street_1" attribute key.

so my question is, how do I get all attribute names of an entity, in this case contact, even when the attribute have no value.

PS: I would like to bypass, using the early bound class.

1

1 Answers

0
votes

You can use a PreImage in your plugin, in this way you can check the previous values.

Reference: http://msdn.microsoft.com/en-us/library/gg309673.aspx#bkmk_preandpost