Auto update fields in 2 entities when field changes
-
mardi 22 mai 2012 18:52
I have 2 custom new_status fields with option sets, 1 in contacts 1 in companies. When a new contact record is created from a company the new_status field copies over to the new contact record. The issue is that when the new_status field is updated at a company level I need the new_status field in the contact to update as well. Currently when enties are updated the fields are not auto updating as well.
Any suggestions?
Stefanie Long
Toutes les réponses
-
mardi 22 mai 2012 20:52
Stefanie,
You would need to create plugin on Post-Update of Account that check to see if the new_status field is updated on the Account record. If it is, the plugin would need to update the new_status on the related Contact record as well.
Alternatively, you could create a workflow that listen on change of new_status field on the Account record and update the new_status on the related Contact record.
The workflow one is a lot easier to do since you don't need to write any code. You can just use the Workflow UI Designer.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits
- Proposé comme réponse Dimaz Pramudya (www.xrmbits.com) mardi 22 mai 2012 20:52
-
mardi 22 mai 2012 21:11
I trired the workflow. In the 'Set Properties' box under Status I do not get any options to set-the status too. The field goes blank, is this because it is an option set?
Stefanie Long
-
mardi 22 mai 2012 23:03
Hi Stefanie,
What is the data type of the new_status in Account? In order for you to be able to use the workflow designer, you will need to ensure that the data type that you are mapping are the same. Eg: you can't map Text field into Option Set.
Once the data type matches, all you need is open up the "Set Properties" window and click on the new_status dropdown on the form and the CRM Form Assistant will display other fields (with the same data type) that can be mapped into the dropdown.
If your data type isn't matching up and you can't change it, you would have to create a plugin and define the mapping inside the code. You would have to register your plugin Post-Update of Account.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits
- Proposé comme réponse Dimaz Pramudya (www.xrmbits.com) mardi 22 mai 2012 23:03