locked
Having a field populated in two different areas RRS feed

  • Question

  • Hi,

    I am fairly new to CRM and this is why this question may be really simple but im not sure what i would need to do.

    We currently have a form which is live, users are now asking for some amendments to be made to this.

    We have a field e.g name on two different tabs on a form. Is it possible to get set this up so that when on fiel is changed the other is automatically populated. Also at the same time if the second fiel could be disabled so it cannot be edited.

    There is duplication here but users require the some information on both tabs.

    Thank you in advance

    Kind Regards,

    Kully

    Friday, February 15, 2013 9:50 AM

Answers

  • Hi,

    Using CRM4 you have 3 options:

    1. Use Jscript to updated field no2 onchange of field no1 - this would be immediate but not robust if for example field 1 was updated using bulk edit or workflow.

    2. Use a workflow to update field 2 each time field 1 changes - this would not be immediate due to workflows running asynchronously (the user would need to refresh the form after a few seconds to see the value update in field 2) but it is fairly robust and can be configured quickly.

    3. Write a plugin to update field 2 onchange of field 1. The most robust solution but requires C# development skill.

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    • Proposed as answer by Rob BoyersEditor Friday, February 15, 2013 8:03 PM
    • Marked as answer by Kully88 Monday, March 25, 2013 10:09 AM
    Friday, February 15, 2013 8:03 PM
    Answerer
  • Hi Kully,

    Have not touch CRM4 for a while but I believe you can archive the requirements this way:

    1. Make name2 field readonly in the form customisation

    2. On the Form onLoad Event, use the following javascript because you can't save values if the field is read only.
     crmForm.all.new_name2.ForceSubmit = true;

    3. Use the following Javascript in the OnChange Event of name1 field to copy the value (you may need to double check the syntax)
     var name1 = crmForm.all.new_name1.DataValue
     If (name1 != null) {
      crmForm.all.new_name2.DataValue = crmForm.all.new_name2.DataValue
     }

    Done but please note using Javascript have limitations as per Rob Boyers comments. Hope this helps.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]


    • Edited by Eric Ung Saturday, February 16, 2013 12:55 AM
    • Marked as answer by Kully88 Monday, March 25, 2013 10:09 AM
    Friday, February 15, 2013 11:36 PM

All replies

  • Hi Kully,

    Are you referring to CRM2011 and that the name field is the same field but is displayed on 2 tabs. If this is the case, then updating one name field is in fact updating the other because its the same field as far the schema is concerned. The 2nd name field will show the changed value once the record is save and the screen refreshes.

    If the name fields are different, then you can use Javascript to update the 2nd name field, based on the onchanged event of the 1st name field.

    example: Xrm.Page.getAttribute("name1").setValue(Xrm.Page.getAttribute("name2").getValue);

    Hope this helps.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    Friday, February 15, 2013 10:52 AM
  • If its CRM 2011, you can also add the field multiple times on the form in different tabs.

    Rune Daub Senior Consultant - Dynateam CRM http://www.xrmmanagement.com

    Friday, February 15, 2013 12:17 PM
  • Hi Eric,

    Thank you for your response, we have an old version of CRM and unfortunatly not looking to upgrade we are currenlty on CRM 4.0.

    At the moment the two fields are different however, ideal what the user would like is once field 1 is chanced field 2 is automatically update (but at the same time static so cannot be changed. So can only be changed from field 1)

    With this version i done think i am able to use the same field again as i did originally try that but the field does not appear in the list of fields to add to the form.

    I hope this makes sense, and i will really appreciate any assistance with this

    thank you.

    Friday, February 15, 2013 3:15 PM
  • Hi RuneDaub

    Thank you for your response, we have an old version of CRM and unfortunatly not looking to upgrade we are currenlty on CRM 4.0.

    With this version i done think i am able to use the same field again as i did originally try that but the field does not appear in the list of fields to add to the form.

    Any ideas on how to get this to work with the version we are on.

    thank you.

    Friday, February 15, 2013 3:17 PM
  • Hi,

    Using CRM4 you have 3 options:

    1. Use Jscript to updated field no2 onchange of field no1 - this would be immediate but not robust if for example field 1 was updated using bulk edit or workflow.

    2. Use a workflow to update field 2 each time field 1 changes - this would not be immediate due to workflows running asynchronously (the user would need to refresh the form after a few seconds to see the value update in field 2) but it is fairly robust and can be configured quickly.

    3. Write a plugin to update field 2 onchange of field 1. The most robust solution but requires C# development skill.

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    • Proposed as answer by Rob BoyersEditor Friday, February 15, 2013 8:03 PM
    • Marked as answer by Kully88 Monday, March 25, 2013 10:09 AM
    Friday, February 15, 2013 8:03 PM
    Answerer
  • Hi Kully,

    Have not touch CRM4 for a while but I believe you can archive the requirements this way:

    1. Make name2 field readonly in the form customisation

    2. On the Form onLoad Event, use the following javascript because you can't save values if the field is read only.
     crmForm.all.new_name2.ForceSubmit = true;

    3. Use the following Javascript in the OnChange Event of name1 field to copy the value (you may need to double check the syntax)
     var name1 = crmForm.all.new_name1.DataValue
     If (name1 != null) {
      crmForm.all.new_name2.DataValue = crmForm.all.new_name2.DataValue
     }

    Done but please note using Javascript have limitations as per Rob Boyers comments. Hope this helps.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]


    • Edited by Eric Ung Saturday, February 16, 2013 12:55 AM
    • Marked as answer by Kully88 Monday, March 25, 2013 10:09 AM
    Friday, February 15, 2013 11:36 PM