How To: Advanced Custom Form Tasks

As part of the Custom Form & Custom Task Architecture we have added some advanced task that allow you to write customizations based on differant actions in the form lifecycle.

​On Ready Tasks

Create Tasks that run was the form has loaded and is ready
  • Start by registering your new task with app.custom.formTask as described in this Article
  • Set the TaskLinkText to NULL
  • Then in your ClickFunction add a new function to the boundReady event via the formObj object.
EXAMPLE in custom.js
app.custom.formTasks.add('Incident', null, function (formObj, viewModel) { formObj.boundReady(function () { //do whatever you need here //you have access to the viewModel from here as well }); }); 

​On Value Change Tasks

Create Tasks that are run when a value changes.
  • Start by registering your new task with app.custom.formTask as described in this Article
  • Set the TaskLinkText to NULL
  • Then in your ClickFunction bind to the change of a value by registering the viewModel index and function via formObj.boundChange().
EXAMPLE in custom.js
app.custom.formTasks.add('Incident', null, function (formObj, viewModel) { formObj.boundChange("Status.name",function () { //do whatever you need here //you have access to the viewModel from here as well }); });