cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to bind PCF control output to address fields

I am developing a PCF control for Dynamics that outputs address fields.

 

When I attach the control to a field and try to select the address fields from the binding dropdown in the control tab of the field properties page they are not available. (address line 1 etc.)

 

Are the address lines not of type SingleLine.Text? If not what type should I be using?

 

Is there a way to access other fields in the form directly within the component?

 

Is there a way to create custom fields that I can output to that will save as address line 1 etc.?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: How to bind PCF control output to address fields

Client API / Form scripts are not deprecated - what will be deprecated is the use of Xrm.Page which is being replaced by the context being (optionally) passed as the first parameter to the function.

 

And the reason for the link to the other thread was just to show that it's a known issue which doesn't currently have an easy fix. The fix I was thinking about was the editting of the formxml to bind your controls to the appropriate addressfields - it's not something I would recommend or do myself but it's the cleanest solution at the moment.

 

Hopefully a proper fix is in the works.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

3 REPLIES 3
Highlighted
Solution Sage
Solution Sage

Re: How to bind PCF control output to address fields

This is a well known issue as address fields are a special case in the Account and Contact records.

 

https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/Binding-to-address-fields-on-contact-acco... is one of the original discussions about the issue and has a fix on how to bind to them (it works but isn't for the faint of heart).

 

The other way is as you say to create a set of custom fields on your form and then write a business rule or javascript to copy the values over as the record is saved.

 

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Highlighted
Frequent Visitor

Re: How to bind PCF control output to address fields

Whey you say they have a fix, are you referring to the accepted solution where they suggest using duplicate fields with PBL/ClientAPI script? Or the other solution that suggests using the webapi?

 

Will users still be able to load Client API scripts after December? My understanding was that this would be deprecated. 

 

The WebAPI solution would only seem to work for existing records. My solution would mainly be used with new records.

Highlighted
Solution Sage
Solution Sage

Re: How to bind PCF control output to address fields

Client API / Form scripts are not deprecated - what will be deprecated is the use of Xrm.Page which is being replaced by the context being (optionally) passed as the first parameter to the function.

 

And the reason for the link to the other thread was just to show that it's a known issue which doesn't currently have an easy fix. The fix I was thinking about was the editting of the formxml to bind your controls to the appropriate addressfields - it's not something I would recommend or do myself but it's the cleanest solution at the moment.

 

Hopefully a proper fix is in the works.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (6,818)