Before You Begin
This 10-minute tutorial shows you how to create a JavaScript Code for a filter.
Creating
a JavaScript Code for a Filter
You must create a JavaScript function to remove the duplicate Originator values returned by the orchestration.
- On the Functions section of the po_approval_home-filter
page, enter this code inside define:
PageModule.prototype.removeOriginatorDuplicates = function (arrayValues){ var j=0; var retarray=new Set(); for (var i = 0; i < arrayValues.length ; i++ ) { console.log(arrayValues[i].z_DL01_127); retarray.add(arrayValues[i].z_DL01_127) } return Array.from(retarray); }The JavaScript code to remove duplicate values in the Originator values returned by the orchestration should look like this:
Remove Originator Duplicates Code
Creating
a JavaScript Code for a Filter