Asked by:
Plugin - PostImage does not contains updated value for Customer Type lookup attribute in CRM 2011

Question
-
I am trying to capture the updated value in parent customer attribute which is of type "Customer" in PostImage for auditing purpose.
But this attribute contains value which is before update not the updated value, but after execution of the operation updated value is saved in the database.
Suresh Maurya
If you find this helpful then please "Vote as helpful" and mark as "Answer"
Save your favorite links here
Collection of good Dynamics CRM 2011 resourcesThursday, January 30, 2014 6:13 AM
All replies
-
hi Suresh,
I think you are looking for the changed customer value, to get changed value. you need to take care, as the changed values are passed in context and not in the postimage. the post image contains value after the records get updated. so you should look for the changed value in the current context and not in the post iimage.
one more thing you will get value in post image only if the plugin is registered in post operation mode.
let us know if you have any problem
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.
Thanks
Subhash
Thursday, January 30, 2014 6:36 AM -
Hi Subhash,
Thanks for your reply,
I am able to get changed values in context inputparameters but the same updated value should also appear in PostImage also because PostImages are supposed to contain updated value from the database after execution of the operation. My plugin is registered in asynchronous mode so it is always executing in post operation only.
When I change any other value then I am able to get that changed value in postImage but not for the customer type attribute, it is always original value.
I need to capture this in PostImage because it is generic kind of plugin and have to work on multiple entities and events.
Thanks
Suresh Maurya
Suresh Maurya
If you find this helpful then please "Vote as helpful" and mark as "Answer"
Save your favorite links here
Collection of good Dynamics CRM 2011 resourcesThursday, January 30, 2014 6:47 AM -
Are you getting the correct value if you register your plugin in sync mode?
Thanks,
Rohit
Thursday, January 30, 2014 7:09 AM -
I have tried that also, but no luck :(
Suresh Maurya
If you find this helpful then please "Vote as helpful" and mark as "Answer"
Save your favorite links here
Collection of good Dynamics CRM 2011 resourcesThursday, January 30, 2014 8:03 AM -
The Customer attribute is a special, virtual attribute which is a composite of the underlying account and contact lookups (e.g. contactid and accountid on the opportunity entity, though the names differ on some of the other entities).
I expect the account and contact lookups do behave as expected, so I suggest you use those in the PostImage, and write code to determine which value is set
Microsoft CRM MVP - http://mscrmuk.blogspot.com http://www.excitation.co.uk
- Edited by DavidJennawayMVP, Moderator Thursday, January 30, 2014 11:10 AM
Thursday, January 30, 2014 11:10 AMModerator -
Hi David,
Account lookup is also not returning correct value in postImage
Suresh Maurya
If you find this helpful then please "Vote as helpful" and mark as "Answer"
Save your favorite links here
Collection of good Dynamics CRM 2011 resourcesFriday, January 31, 2014 4:35 AM -
It's working for CRM 4.0 but not for CRM 2011 and CRM 2013 version.
Suresh Maurya
If you find this helpful then please "Vote as helpful" and mark as "Answer"
Save your favorite links here
Collection of good Dynamics CRM 2011 resourcesWednesday, February 19, 2014 5:18 AM