ProcessFlow Custom Functions

I've mentioned this before but it won't hurt to get a reminder.

You can build your own custom JavaScript functions to be used by ProcessFlow in the Assign node. I have a client who wanted their requisitions approved based upon Company & Acct Unit instead of requesting locations.

They also wanted that requisition reviewed by all Approvers associated to the various company/acct unit combinations on the requisition. This meant that in both level 1 and level 2 of their approval process, all level 1 approvers (and then level 2 approvers) had to approve that requisition.

So each approver has to review the requisition and approve it and then it would move on to the next possible approver at the same level. Once all have approved at level 1 it then repeats this for level 2.

To do this I read through the requisition with a query loop and assign the company/acct unit values to a variable. I then use the Assign node to pass that variable to a custom function which excluded the duplicates and passes that back to another variable.

I then pass that new variable to an Assign node to read the current category filter value for each approver. I also track who has approved thus far and use another custom function to check that the current approver hasn't already approved the requisition under a different company/acct unit combination they may have been set up for.

The custom function needs to be added to the pflow.js file in order to be available to your flow file.

Releasing PO's with ProcessFlow

I've had several clients recently who've wanted to use ProcessFlow to "Approve" purchase orders. Using Design Studio we removed the "Release" function from PO20 & PO23 and instead added a button to trigger ProcessFlow.

This has worked out very well but (of course) we had a couple of issues to resolve:

In the notice back to the buyer that their PO was approved or not approved we wanted to include the URL back to the PO in question. This required us to "escape" the PO number, release and code string so that the buyer could click the URL link in the email notice.

Using an Assign node, we assigned the following value to the "PO" variable: URLEncoder(PCR_PO_NUMBER+PCR_PO_RELEASE+PCR_PO_CODE) and then we referenced that variable in the URL string: http:///lawson/portal/?_PDL=PROD&_TKN=PO20.1&_HK=0001 (Company 0001 was hard coded).

The 2nd, and more interesting of the issues, was the AGS call to PO22 to perform the Release of the purchase order. The AGS call we originaly designed worked for all of our PO's except for Blanket PO Releases. The sames AGS call that released standard PO's wouldn't work for blanket PO's. We opened a case with Lawson, they duplicated our issue and even wrote up a PT to resolve.

When this got to the developers they came back with a simple, but obscure workaround. We had to reference the PO number, release and code twice (see below) but once we did that, the issue was resolved. Now all PO's release correctly.

AGS call to release PO's via ProcessFlow: