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
Prerequisites:
- The prerequisites involved for PCF building, packaging and deploying a PCF managed/unmanaged solution to an environment. These are not required because I have provided the link to the solution file in bullet point 3 but are needed for knowledge transfer.
- System administrator privileges
- Software components: https://docs.microsoft.com/en-us/powerapps/developer/component-framework/get-powerapps-cli
- XRM Toolbox https://www.xrmtoolbox.com
- The composite address PCF from PCF Gallery: https://pcf.gallery/composite-address-control/
- Managed solution .zip file found here: https://github.com/a33ik/CompositeAddress_PCF/releases
Deploying the Composite Address Control Managed Solution
- 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.
- Click on solutions from the settings tile.
- Click on import and upload the file from wherever you saved it.
- Click next, import, and then publish all customizations. The solution should now be visible in the list of solution components.
Applying the PCF to an address composite field
- 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.
- Navigate to the main form of an entity of your choosing. In this example we will use the lead entity.
- 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.
- Open the field, click on the controls tab, add the new address composite PCF control, hide the default control.
- 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:
- Address formatting: {street1}n{street2}n{street3}n{city}n{county}n{state}n{zipcode}n{country}
- Street 1: (any field from the list)
- Street 2: (any field from the list)
- Street 2 is Visible: Yes
- Street 3: (any field from the list)
- Street 3 is Visible: Yes
- City: (any field from the list)
- County: (any field from the list)
- County is Visible: Yes
- State/Province: (any field from the list)
- State/Province is Visible: Yes
- Zip Code: (any field from the list)
- Country: (any field from the list)
- Country is Visible: Yes
Your selections should look like this:
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.
- 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.
- 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/
- Search for the FormXml Manager plugin and open it.
- Load the entities, click on the lead entity, click on the checkbox for the main form, and then click on edit formxml.
- 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.
- Update and publish the form.
Verify the Workaround
Known Issues
- You must click into the composite field before navigating elsewhere on the form otherwise the address dialogue will stay open.
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!Â