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:
Raju
Past 24 Hours:
0
Prev. 24 Hours:
1
Overall:
5205
People Online:
Visitors:
215
Members:
0
Total:
215
Online Now:
New Topics
Lawson S3 HR/Payroll/Benefits
Post Tax Benefit Plan Table
11/14/2024 9:16 PM
Hi, totally new to Laswon. I have a repor
Lawson S3 Procurement
ED501 Error: Map 850 not supported by /law/c15vda/lawson/test10/edi/bin/laws_out_91
11/12/2024 3:47 PM
Tried runnning ED501 and getting the atathced erro
Lawson Smart Office
Error
11/6/2024 9:54 PM
When I try to enroll a retiree in 72.1 health plan
Infor CloudSuite
Syteline: New Data Maintenance Wizard (Error) Need help
11/1/2024 4:39 PM
Hi, I need help with an error on syteline while us
Infor ERP (Syteline)
Syteline: New Data Maintenance Wizard (Error) Need help
11/1/2024 4:24 PM
Hi, I need help with an error on syteline while us
Dealing with Lawson / Infor
Implementing Lawson v10 with Cerner Surginet, Case Cart Picking, and Quick Adds for the OR
10/29/2024 4:20 PM
Hi Everyone, I am wondering if there is any org
Lawson S3 HR/Payroll/Benefits
Canada Tax Calculation (Federal and Provincial) Issue
10/23/2024 5:00 AM
Initially, we had problem with CPP2 calculation is
Lawson S3 HR/Payroll/Benefits
CA Section 125 401k Plan
10/22/2024 10:13 PM
Does anyone have any recommendations on how to fac
S3 Systems Administration
Running AC120 deleted records from ACMASTER table
10/22/2024 3:40 PM
We recently ran the AC120 as normal and somehow it
Lawson S3 Procurement
RQ13 Approval Info
10/17/2024 2:12 PM
When a Requisition is approved on RQ13, what table
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
1369
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
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
Oh my gosh, that's exactly what I was hoping to find out. I can't wait to try it tomorrow.
John Henley
Posts: 3353
5/1/2013 10:16 PM
Very interesting! Thanks for letting us know.
Kyle Jorgensen
Veteran Member
Posts: 122
5/2/2013 12:55 PM
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
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
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
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
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
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.