Binding to Address Fields in a PCF Control

Jared Johnson, 04 July 2019

Recently I was working on a custom control where I wanted it to have outputs that were bound to the address fields on a contact or account. However even though I had the type set to SingleLine.Text, none of the address fields appeared in the list of fields when selecting which field to bind to.

image

According to a thread in the PCF forums, this is currently a known issue, however until this is resolved there is a workaround that involves editing the form xml.

First you need to add the Custom Control onto the form as normal but set the bound fields to whatever fields on the form you are able to select (shown in the screenshot above).

Now you want to edit the xml of the form. A nice way to do this is the FormXml Manager in XrmToolbox.

Next you’ll need to find the xml for your control, which will be inside a customControl element. You can now simply update the fields inside the parameters element to the address fields that you want.

image

After publishing the form xml changes your control will now be bound to the address fields and work as normal.

image