Address Composite PCF Control

Introduction

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 separated into individual fields when accessing UCI. These features have been deemed 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 focus on composite address fields and how we can use a Power Apps Component Framework custom control (PCF) workaround for now – 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

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.
this image shows model driven app - Address Composite PCF Control
  1. Click on solutions from the settings tile.
this image shows advanced settings
  1. Click on import and upload the file from wherever you saved it.
this image shows import and upload file - Address Composite PCF Control
  1. Click next, import, and then publish all customizations. The solution should now be visible in the list of solution components.
this image shows the solution components

Maximize Efficiency with Custom Power Apps Solutions!

Ready to maximize your business efficiency with custom Power Apps solutions? AlphaBOLD is here to guide you through the process of transforming your ideas into reality. Let's create something amazing together.

Request a Demo

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.
this image shows 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.
this image shows managed field
  1. Open the field, click the controls tab, add the new address composite PCF control, and hide the default control.
this image shows address composite PCF control
  1. 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 is 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

Read more: Connecting to MFA enabled Microsoft Dynamics 365 using XrmToolBox

Your selections should look like this:

this image shows composite address control - Address Composite PCF 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 use 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 we’ve inputted into the PCF control and set them to the more logical ones.

  1. If you haven’t already done so, connect the XRM Toolbox to your CDS environment by clicking the connect button and then the 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.
this image shows XRM Toolbox
  1. Load the entities, click on the lead entity, click on the checkbox for the main form, and then click on edit formxml.
this image shows edit formxml - Address Composite PCF Control
  1. Navigate to the custom controls. Find the composite address custom control. Enter 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.
this image shows composite address custom control
  1. Update and publish the form.

Streamline Your Operations with Power Apps!

Wondering how Power Apps can streamline your business operations? Embark on a path to efficiency and growth with AlphaBOLD's expert guidance.

Request a Demo

Verify the Workaround:

this image shows Verify the Workaround - Address Composite PCF Control
this image shows Verify the Workaround address

Known Issues:

  • You must click into the composite field before navigating elsewhere on the form; otherwise, the address dialogue will remain open.
this image shows composite field before navigating - Address Composite PCF Control

The comma delimiters will remain if you don’t populate an address field.

If you have any questions or queries, please contact us

Explore Recent Blog Posts

Infographics show the 2021 MSUS Partner Award winner

Related Posts

Receive Updates on Youtube