June 14, 2019

My first PCF Control

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:
  1. First of all I added an additional Phone field (telephone1) to the form and I attached my control to it
  2. The placeholder is the string used inside Url Link and Url Text to replace the value from the Source Field
  3. 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__
  4. For this example I didn't need a third parameter so I left Source Field 3 empty
  5. Inside the Url Link I inserted https://www.google.com/search?q=__VALUE__ in this way __VALUE__ will be replaced with telephone1 value
  6. Inside the Url Text I inserted Search __VALUE2__ Phone Number, in this way __VALUE2__ will be replaced with name value
  7. Url CSS has a default value, to make the links looks similar to Dynamics UI
  8. 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
  9. Font Awesome Icon Style is to set the style property of the icon, in my case I wanted to change the color
I hope you like this control and find it useful.

2 comments:

  1. This is causing a big circle with a ! in the middle to flash across our screen when we try and use it on our CRM forms. Ended up uninstalling it. It seemed to clash with our Embedded UI plugin as well.

    ReplyDelete
    Replies
    1. Hi pvocc, yes, I am aware of this problem, it's caused by how Font Awesome load the css, I need to release a new version with that functionality removed.

      Delete