Cybersecurity
DevOps Cloud (ADM)
IT Operations Cloud
What are the new features in IDM 3.5.1?
What Are the New Events Exposed in the Form Script API?
Starting with IDM 3.5.1, new events have been introduced:
Notes:
WFS API
New method available for fields | Description |
/* array */ getAllValues() (Starting with IDM 3.5.1) | Allows access to all available values in a control, as opposed to the selected values only with field.getValues(). The returned array contains 2 sub arrays, the first with the data values, the second with the display - label - values |
New method available for events | Description |
/* any */ getCustomData() (Starting with IDM 3.5.1) | A form event can now transport user data : when firing a custom event you can use this to send custom data along. You set the data with an extra parameter on the field.fireEvent() method, in the triggered script use event.getCustomData() to access the data. |
Adding Print Form Functionality to your Request or Approval Forms
The library is called PrintForm.js - it is included in the UA. Here are the steps you need to follow to add preview to a form:
1. Include the library in the form, adding the external script with the URL:
./javascript/JUICE/form/PrintForm.js
2. To open the print form when doing a submit (after data is validated), add the following to the form onload event or one of the field's onload events:
var pf = new PrintForm();
form.interceptAction("SubmitAction", "around", pf.printFormInterceptor, pf);
3. To add a print button next to one of the fields, add this to the field's onload event:
var ctrl = JUICE.UICtrlUtil.getControl(field.getName());
var btn = JUICE.UICtrlUtil.addButton(ctrl, "printid", "Print", "Print",
"javascript:var p = new PrintForm(); p.printFormAfterValidation(\"printid\");");
You can also use the HTML control and have it generate the print button. The Print pop-up window looks like this:
Figure 1 - Print pop-up window
Note: There is a PrintForm library available for IDM 3.5 - send me an email if you want this. The script to use this is also slightly different from what is documented here for IDM 3.5.1.