Oracle by Example brandingCreating a JavaScript Code for a Filter


section 0Before You Begin

This 10-minute tutorial shows you how to create a JavaScript Code for a filter.


section 1Creating a JavaScript Code for a Filter

You must create a JavaScript function to remove the duplicate Originator values returned by the orchestration.

  1. 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:

    Description of 1.png follows
    Remove Originator Duplicates Code