Get URL Attachment from RQ and add to PO

Ash Gajjar contacted me recently with an interesting question. Could he get the URL for an attachment from a requisition and add that to the purchase order created from that requisition? Of course, I assured him. Now came the matter of how.

I offered Ash a solution with two methods of achieving that solution - use Design Studio when the PO was released to perform a DME on the PO Line Source Record, use the getattachrec.exe CGI to retrieve the URL Attachment, parse that for the actual URL value and then writeattach.exe to add it to the PO.

Ash chose the 2nd method I suggested and is using ProcessFlow to perform this solution. I have an old posting on how to get comments but the values are a little different when you want the URL Attachment instead of a standard comment.

Resource Update to Add New Users

Recently a client asked how to use ProcessFlow Integrator to add new users into Lawson Security from their active directory. I gave them two simple choices - we could use the SQL Query (which would require a JDBC connection to their database) or we could use the DataIterator to read a text file they created from their AD.

They decided the DataIterator would fit their business requirements and are creating a file of new users daily. That just left me to create the ProcessFlow.

I first used a FileAccess node to make sure the file exists and a Branch to connect to the DataIterator if the file is there. The DataIterator reads the line of data (instead of each data element separately) and I use an Assign node to parse out the comma separated values (see my previous post for a similar example).

The next step is the ResourceUpdate to add the users. I was surprised just how much information I could add - like Roles, Email Address, Employee Number, etc.

After looping through all of the records in the CSV text file I used another FileAccess to delete the file and the flow was complete.

Design Studio Select Line Solution 2

My previous solution example was based upon pressing a button in the form's header and detecting which line(s) had been selected within the detail section.

My client decided to add the button to the detail section (so it would appear on each line) and came up with this method of identifying which line's button was clicked:

if (id != "push2") return true
{
Invoice = lawForm.getDataValue("APD-INVOICE",formState.currentRow)
Vendor = lawForm.getDataValue("APD-VENDOR",formState.currentRow)
DisplayImageWeb()
}

The only downside to this method is that the button appears on each line of the form whether or not there is data associated to that line and the user could press the button on a line with no data.

Design Studio Select Line Solution

Do you need to determine the line you're working on based upon the user selecting it in the Line FC? Here's a simple method I used with AP95.2 to pass variables to ImageNow to display an invoice. I had to repeat this for each line of the form.

This is using the field ID's.

if (lawForm.getElementValue("_f36r0") =="X") // Line 1
{
Vendor = lawForm.getElementValue("_f39r0")
Invoice = lawForm.getElementValue("_f41r0")
DisplayImageWeb()
}
if (lawForm.getElementValue("_f36r1") =="X") // Line 2
{
Vendor = lawForm.getElementValue("_f39r1")
Invoice = lawForm.getElementValue("_f41r1")
DisplayImageWeb()
}

ProcessFlow Custom JavaScript Function

In a previous posting I mentioned modifying the pflow.js file in order to add a custom JavaScript function for use within your flow (http://consultdavidw.blogspot.com/2007/07/processflow-custom-functions.html) but with ProcessFlow Designer 9.x you can now add a JavaScript Function within your flow.

Within the Assign node properties, click the Add JavaScript button and the JavaScript Expression Builder will open allowing you to add your custom function.

Of course the advantage to using pflow.js for your JavaScript functions is that they're available to all of your flows but if you just want a quick custom function then this new feature may be the way to go.

PO Vendor Agreement Notify

Just in case you, like another one of my clients, wants to use this ProcessFlow Service to notify the Agreement Administrator that the PO's released against a Vendor Agreement have exceeded the notification percent on the PO25 setup form - you will need to make sure that ProcessFlow Administration (menu.do) has the Form and Form Field Definitions defined for the PO25.1 form.

For some reason, like for the Invoice Approval AP26.1 form, this form definition is missing and this Service won't work without it.