locked
Updating a field on Entity A when a field on Entity B is changed. RRS feed

  • Question

  • I have a field on my Customer Entity which contains the customer's Soc Sec # called SSN-C.

    I have another Entity - Application.  Every application HAS to have an existing customer.  So, once a customer's name is entered into the application, I have used a work flow to copy the SSN-C field from the customer entity over to the SSN-A field on the Application. 

    Now, I need to be able to possibly change the Soc Sec Number on the Application if the SSN-C value is changed on the Customer Entity.  This might happen if there was a typo, or the customer initially gave an incorrect number to begin with, etc.

    I'm thinking that I will have to write some Jscript code in order to do this.  What do you think?

    Thanks!

    Michelle

    Monday, September 15, 2014 7:06 PM

Answers

  • Hi,

    Since you do not have prior experience with coding, please try the following steps in your dev area.

    1. Import the managed solution from http://crm2011distributewf.codeplex.com/releases/view/79042

    2. download the solution into your organisation.

    3. create a new copy of your existing workflow.

    4. mark it to run as child process.

    5. Create a new workflow on Customer Entity to execute on modification of SSN-C

    6. Add a new step to distribute the workflow to all child records ( specify the releation name between Customer Entity and Application) - for this please refer to codeplex site.

    7. add the child workflow as the workflow you created as part of step 3.

    Good luck :)

    Regards,

    Jithesh

    Tuesday, September 16, 2014 2:12 PM

All replies

  • I think the best approach for this is to write a plugin on the customer entity (Update Message, Post Operation Stage).

    Inside the plugin check whether the SSN has changed and then only get the Applications related to that Customer and update the SSN.

    This way it will work when you update a customer in all means (i.e. through UI, through SDK, etc.)


    Sachith Chandrasiri

    Tuesday, September 16, 2014 5:48 AM
  • Michelle,

    since you already have a workflow, you could leverage that workflow to update the records when the field is modified.

    I am not sure how you have implemented the current workflow, can you post a picture of your workflow?

    ideally you could create a child workflow to update your application when the contact's ssn is updated.

    if you know .net you could also write a plugin to do the same.

    alternative is to use JavaScript to update the child records on save of contact form.

    let me know if you need any further help.

    regards

    Jithesh

    Tuesday, September 16, 2014 8:06 AM
  • You can do a field mapping. It will work on create of opportunity from the Account form.

    OR

    On create of opportunity create a workflow to copy SNo from account to Opportunity

    Both options will work on create.

    Now on update you need either a plugin or javascript(oData). On update of the required field bring all child opportunities and update a specific field.


    Regards Faisal

    Tuesday, September 16, 2014 9:53 AM
  • Hi Sachith

    I am kind of a newbie - I've made some basic customizations (added fields, etc. to forms) and have also written a few Jscript scripts, but I have NO experience in creating a plugin (the plugins that are currently used in our system were written by an outside vendor when the system was created).  So, if you think that I should create a plugin, please give me some guidance as to where you think would be the best sources of information for me.

    Thanks!

    Michelle

    Tuesday, September 16, 2014 1:16 PM
  • Here's the workflow...

    Tuesday, September 16, 2014 1:33 PM
  • Hi,

    Since you do not have prior experience with coding, please try the following steps in your dev area.

    1. Import the managed solution from http://crm2011distributewf.codeplex.com/releases/view/79042

    2. download the solution into your organisation.

    3. create a new copy of your existing workflow.

    4. mark it to run as child process.

    5. Create a new workflow on Customer Entity to execute on modification of SSN-C

    6. Add a new step to distribute the workflow to all child records ( specify the releation name between Customer Entity and Application) - for this please refer to codeplex site.

    7. add the child workflow as the workflow you created as part of step 3.

    Good luck :)

    Regards,

    Jithesh

    Tuesday, September 16, 2014 2:12 PM
  • Thanks Jithesh!!!!

    I will try this out soon and let you know the outcome!

    Michelle

    Tuesday, September 16, 2014 2:23 PM