Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Integration / Customization
IPA/ProcessFlow
Custom Javascript Functions in ProcessFlow
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
BDell92
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5275
People Online:
Visitors:
517
Members:
0
Total:
517
Online Now:
New Topics
Lawson S3 Financials
Applying credits to open AP invoices
4/28/2025 1:26 PM
Hello, I am new to the Lawson system and after ru
Lawson S3 Financials
Lawson APIA
4/28/2025 1:22 PM
Has anybody recently installed Lawson's APIA m
Lawson S3 Procurement
Tolerance Settings
3/31/2025 2:01 PM
I've been trying to set a tolerance for some t
Dealing with Lawson / Infor
Printing Solutions other than MHC
3/27/2025 1:00 PM
What are others using for printing solutions besid
Lawson S3 Procurement
Green check marks in Lawson 9.0.1
3/20/2025 4:55 PM
Hi, How to remove green check mark on items when o
Lawson S3 HR/Payroll/Benefits
Pay Rate History to Show All Positions
2/26/2025 3:34 PM
Does anyone know how to modify payratehistory.htm
Infor CloudSuite
How to build a Pre-Prod tenant
2/7/2025 1:28 AM
After we finished our implementation and ended our
Lawson S3 Procurement
Browser issue with RQC Shopping
1/28/2025 5:49 PM
Since the recent Chrome/Edge updates, our RQC shop
Lawson S3 Procurement
S3-Procurement New Company
1/22/2025 10:38 PM
My Accounting Department has created a new Company
S3 Customization/Development
JUSTIFIED RIGHT
1/15/2025 7:41 PM
Is there a way in Lawson COBOL to make a character
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3291
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1375
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Integration / Customization
IPA/ProcessFlow
Custom Javascript Functions in ProcessFlow
Please
login
to post a reply.
9 Replies
1
Subscribed to this topic
52 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
Kyle Jorgensen
Veteran Member
Posts: 122
5/1/2013 8:19 PM
What's the best way of using a file with custom javascript functions in ProcessFlow?
I know I can add to the provided "pflow.js", but I'd rather not alter delivered code.
Is there some javascript expressions I can use inside an "Assign" node so that it will read my custom functions file?
I found a few solutions using Google, but they rely on the browser's DOM...which doesn't appear available in ProcessFlow.
Woozy
Veteran Member
Posts: 709
5/1/2013 9:09 PM
Split
This is a timely question. Last week at Inforum I chatted with some of the folks who designed the IPA/Pflow tools about this exact question. I have always avoided modifying the pflow.js because I was afraid our functions would be wiped out by an upgrade (we are under Managed Services).
I found out that it is possible to create your own "user" Javascript library named "pflow_user.js" in the same folder as the delivered "pflow.js" file. The designer will treat your custom file exactly like (and in parallel with) the functions in the pflow.js file. In fact, your custom functions will also appear in the assign node "Functions" drop down list, as long as you formatted the file exactly like the pflow.js.
As a side benefit, if you create a function within your library that is named the same as one of the "delivered" functions, it will override or extend those functions.
I know this works on both the Pflow Classic 9.0.1 version and the IPA (Landmark) 9.2.x version, and perhaps earlier versions.
I hope this is helpful to you. I know it made me very happy...
Good Luck!
Kyle Jorgensen
Veteran Member
Posts: 122
5/1/2013 10:02 PM
Split
Oh my gosh, that's exactly what I was hoping to find out. I can't wait to try it tomorrow.
John Henley
Posts: 3351
5/1/2013 10:16 PM
Split
Very interesting! Thanks for letting us know.
Kyle Jorgensen
Veteran Member
Posts: 122
5/2/2013 12:55 PM
Split
This works! I placed a copy of our custom pflow_user.js in my C:\Program Files\Lawson Software\ProcessFlow901\ directory and now I have access to them in the "Assign" nodes within the designer. Next test will be to place the pflow_user.js file on the Lawson server and restart the pfserver. I don't see why it won't work there. I'll keep the forum posted.
Woozy
Veteran Member
Posts: 709
5/2/2013 1:43 PM
Split
In my case (using IPA) a restart of pflow services was not required after adding the pflow_user.js file. I think the fact that it is there makes it available immediately.
Kyle Jorgensen
Veteran Member
Posts: 122
5/2/2013 4:00 PM
Split
Yep, sure enough. This just keeps getting easier!! Coolest undocumented feature of ProcessFlow I've found yet.
Shane Jones
Veteran Member
Posts: 460
5/14/2013 1:59 AM
Split
great topic.... I modified the pflow.js file in the past but it was a pain everytime we patched the system. This sounds like it is a bit more forgiving than in the past. Thanks for sharing....
Terry P
Veteran Member
Posts: 234
6/28/2013 8:37 PM
Split
Ok - so is there a similar way to do this for Design Studio Javascript Functions? I have several functions that I use over and over (like converting to proper case) etc etc. I came across another one that works great, but I couldn't get it to work within Design Studio script.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
String.prototype.toTitleCase = function () {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i;
return this.replace(/([^\W_]+[^\s-]*) */g, function (match, p1, index, title) {
if (index > 0 && index + p1.length !== title.length &&
p1.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
title.charAt(index - 1).search(/[^\s-]/) < 0) {
return match.toLowerCase();
}
if (p1.substr(1).search(/[A-Z]|\../) > -1) {
return match;
}
return match.charAt(0).toUpperCase() + match.substr(1);
});
};
George Graham
Veteran Member
Posts: 201
7/18/2013 2:50 AM
Split
Terry - know this is a little late in replying but in Design Studio there is an include function in the file menu. This allows you to "include" any file that contains javascript functions and routines as part of your DS form. You can keep different files for different purposes and include only what you need on a form by form basis.
Please
login
to post a reply.