After launching PCF Gallery I finally created my first PCF control: Custom Url Control.
The idea behind this control is to display a custom url using record values as parameters.
In my screenshot I implemented a google search using the phone number, but the possibilities are infinite: you can implement a shipment tracking, a link to your reporting engine, open an sms gateway webpage, just one click away!
The control has several settings: It supports up to 3 fields to fetch their values, the url link, the text and some styling options
I didn't want to force the use of a specific placeholder so they are also customizable.
And now the setup example:
The idea behind this control is to display a custom url using record values as parameters.
In my screenshot I implemented a google search using the phone number, but the possibilities are infinite: you can implement a shipment tracking, a link to your reporting engine, open an sms gateway webpage, just one click away!
The control has several settings: It supports up to 3 fields to fetch their values, the url link, the text and some styling options
I didn't want to force the use of a specific placeholder so they are also customizable.
And now the setup example:
- First of all I added an additional Phone field (telephone1) to the form and I attached my control to it
- The placeholder is the string used inside Url Link and Url Text to replace the value from the Source Field
- As I want to display the name inside the Url Link I bounded Source Field 2 to Name (name) field and I used the default placeholder __VALUE2__
- For this example I didn't need a third parameter so I left Source Field 3 empty
- Inside the Url Link I inserted https://www.google.com/search?q=__VALUE__ in this way __VALUE__ will be replaced with telephone1 value
- Inside the Url Text I inserted Search __VALUE2__ Phone Number, in this way __VALUE2__ will be replaced with name value
- Url CSS has a default value, to make the links looks similar to Dynamics UI
- Inside Font Awesome Icon I inserted the classes required to show a Font Awesome Icon (version 5), I set the search icon, if for example you wanted the UPS one, you need to insert fab fa-ups
- Font Awesome Icon Style is to set the style property of the icon, in my case I wanted to change the color