Address Composite PCF Control

With the new Microsoft rebranding of Customer Engagement (CE) to Common Data Services (CDS), some features of the web UI are not available in Unified Client Interface (UCI). Composite full name and address fields are now separated into individual fields when accessing UCI. These features have been deemed to be more of an issue for activities like customization rather than a benefit, yet Microsoft claims to be working on adding these in future releases. Regardless, a client may be working with the legacy web client UI and still wish to view composite fields.

In this blog post we will be focusing on composite address fields and how we can use a PowerApps Component Framework custom control (PCF) workaround for the time being – although this could be a one-stop shop alternative depending on future release notes for CDS.

This blog post was written during Server version: 9.1.0000.8833 Client version: 1.3.2281-190924-204338 tenure of CDS.

Learn more about our Microsoft Dynamics 365 Services

Learn More

Prerequisites:

Deploying the Composite Address Control Managed Solution

  1. From the homepage of your default model driven app, click on the gear icon in the upper righthand corner and then click on advanced settings.
    model driven app
  2. Click on solutions from the settings tile.
    advanced settings
  3. Click on import and upload the file from wherever you saved it.
    import and upload file
  4. Click next, import, and then publish all customizations. The solution should now be visible in the list of solution components.
    solution components

Applying the PCF to an address composite field

  1. Navigate back to the settings tile and select customizations, then customize the system on the next page – assuming you want to place the control directly into the default solution.
  2. Navigate to the main form of an entity of your choosing. In this example we will use the lead entity.

address composite field

  1. Add a single line of text field to the form. (Remove the existing address composite field to remove clutter, if it’s there). In our case we will be appending the PCF to an address name, but it can be any managed field or a custom single line of text field.
    managed field
  2. Open the field, click on the controls tab, add the new address composite PCF control, hide the default control.
    address composite PCF control
  3. Set the fields as the following. These fields will change when we bring the solution to the XRM Toolbox. We can also set some visibility of the fields to “No” but we will leave them as below for now. If you do deviate from the selections below, ensure that you populate the mandatory fields denoted with a red asterisk:
    1. Address formatting: {street1}n{street2}n{street3}n{city}n{county}n{state}n{zipcode}n{country}
    2. Street 1: (any field from the list)
    3. Street 2: (any field from the list)
    4. Street 2 is Visible: Yes
    5. Street 3: (any field from the list)
    6. Street 3 is Visible: Yes
    7. City: (any field from the list)
    8. County: (any field from the list)
    9. County is Visible: Yes
    10. State/Province: (any field from the list)
    11. State/Province is Visible: Yes
    12. Zip Code: (any field from the list)
    13. Country: (any field from the list)
    14. Country is Visible: Yes

Your selections should look like this:

composite address control

Yes, it is odd that we cannot see the address fields even if they are added to the form. That is why we need to open the XRM Toolbox to set them explicitly on the control. We are using regex {}n to put line breaks between the address fields.

  1. Click okay on the field dialogue, click save and then publish the form.

Utilize the XRM Toolbox

We now need to swap the placeholder fields that we’ve inputted into the PCF control and set them to the more logical fields.

  1. If you haven’t already, connect the XRM Toolbox to your CDS environment by clicking on the connect button and then new connection. Follow the steps to authenticate to your environment here: https://www.xrmtoolbox.com/documentation/for-users/connecting-to-an-organization/
  2. Search for the FormXml Manager plugin and open it.
    XRM Toolbox
  3. Load the entities, click on the lead entity, click on the checkbox for the main form, and then click on edit formxml.

edit formxml

  1. Navigate to the custom controls. Find the composite address custom control. Enter in the logical names for the fields that need to be changed. For example, Street 1 will be address1_line1. You will have to do this thrice for each field.
    composite address custom control
  2. Update and publish the form.

Verify the Workaround

Verify the Workaround

Verify the Workaround address

Known Issues

  • You must click into the composite field before navigating elsewhere on the form otherwise the address dialogue will stay open.

composite field before navigating

If you don’t populate an address field, the comma delimiters will remain.

If you have any question or queries, do not hesitate to reach out to us!Â