locked
Composite Address in Account entity RRS feed

  • Question

  • Hi CRM Folks,

    We have a requirement in Account entity and below is the requirement and issue which we are facing.

    Requirement

    In Account entity, we are having Parent and Child account types. We have created two individual sections for both Parent and Child accounts. Account form will display based on chosen Account type in Account entity. To capture Account address, we used composite address(composite_address1) in both the forms. Now customer want to change the field Postal Code to custom title in composite address field.

    Issue

    We have tried to modify the label using below statement but no success, because the composite_address1 is used in both the sections.

    Xrm.Page.getControl('address1_composite_compositionLinkControl_address1_postalcode').setLabel('My Postal Code');

    Can any one help me to fix the issue instead of changing the form structure.

    Regards,

    Kumar R


    • Edited by Kumar_R Saturday, March 26, 2016 3:09 PM
    Saturday, March 26, 2016 3:08 PM

Answers

All replies

  • The address fields however cannot be changed through the UI(by changing the display name). These do not appear to use the field display names, and instead appear to be hard-coded into the composite control.

    The supported code "control.setLabel()" does not work as we cannot get the control of the field inside the fly-out menu. The last resort was to try “unsupported” JavaScript code.

    Code: document.getElementById("address1_composite_compositionLinkControl_address1_postalcode").firstChild.firstChild.innerHTML = "My Postal Code";

    Success!!!

    This approach is unsupported, so please use it at your own risk.

    If you find my answer to be helpful please vote it as answered.

    Thanks.

    • Edited by Modi Bhavin Thursday, March 31, 2016 7:22 AM Adjusting the reply
    Thursday, March 31, 2016 7:21 AM
  • Thanks

    • Marked as answer by Kumar_R Monday, May 16, 2016 3:17 AM
    Monday, May 16, 2016 3:17 AM