As we wrap up 2019, I’d like to let you know about some exciting new additions to System Frontier for this latest release. We have the absolute best customers and their feedback is constantly helping move the product upward and onward.
New Field Types
We’ve added a few new custom field types to make it even easier to capture user input and automatically validate it and pass it to code behind your custom tool. All of our examples to date are PowerShell, but custom tool code and preprocessor code can be any scripting language that can run on a Windows server, like Python or (if you’re feeling retro) VBScript or Batch.
With all custom fields in SF, they can be dynamically generated on the fly from the objects you are working with – no HTML code is required. The new MultiSelect field lets you search large lists of items and select multiple values. Those values will be passed to your script in CSV format.
The new Table field type automatically generates a DataTable that you can search, sort and select a row from. The selected row value will be passed to your custom tool script. One key thing to remember with this new feature as that property names of the objects you put on the databus will be used for the table headers. If the custom field is any other data type, the property names, or in the case of an array – the first value, will be ignored. Example:
$dataBus.ChartList = @("Pie","Donut","Bar")
If ChartList is a ListBox custom field, only Donut and Bar will be available in the drop-down. Instead, you’ll need to add an initial value to act as a label:
$dataBus.ChartList = @("Charts","Pie","Donut","Bar")
Custom HTML Now Possible
There are several other built-in custom field types and since they are automatically rendered for you, it takes the pain out of having to manually code a GUI front-end for your script. The ability to insert your own custom HTML in the tool output has always been available, but what if you want to completely customize the way the form looks when it loads for the user in SF? With the new HTML custom field type, now you can!
Let’s Do An Example
First, create a custom field called “HTML-Location”. Make sure you select the HTML data type. In the Default Value section, paste the code below…
It should look something like this…
Now, create a small script to output the results of the tool and save it. We’ll use PowerShell…
Write-Output "Your city: $Location"
Create a new custom tool and import the script you just created. Click on the Modify button under User Input Fields, select the new HTML-Location custom field and add it to your custom tool.
In the Arguments section, replace it with the following:
$('#user-input-html-location').val( this.value );
The HTML element id will always start with “user-input-“. Appended to that will be the name of your custom field, all lowercase.
Pretty simple, but very powerful. We can’t wait to see what you do next with System Frontier.