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
Debugging JavaScript Assign in Pflow
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Pat
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5296
People Online:
Visitors:
286
Members:
0
Total:
286
Online Now:
New Topics
Lawson Portal
Lawson ESS customization
6/23/2025 10:28 AM
I want to add new links and customize the ESS (sel
S3 Security
Securing forms and programs that use Company Group
6/17/2025 5:41 PM
Is there a way to write a rule, that looks up a co
S3 Customization/Development
Self-Serve Customization and Modification of home page
6/17/2025 3:40 PM
Hi, I want to add new links and customize the E
S3 Customization/Development
Data / List view on Lawson Portal
5/21/2025 2:37 AM
Client is on S3 V10. All delivered and custom form
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
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
1377
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
Debugging JavaScript Assign in Pflow
Please
login
to post a reply.
8 Replies
0
Subscribed to this topic
52 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
Woozy
Veteran Member
Posts: 709
4/11/2012 9:02 PM
I am building a flow where I am trying to build some fairly complex logic in JavaScript assign nodes. I'm getting an "Error Evaluating Expression..." message in the log, but that isn't very helpful.
Is there any way to do a "display" of some sort within the node so I can see what it is doing at various steps in the JavaScript?
Thanks!
Shane Jones
Veteran Member
Posts: 460
4/12/2012 2:19 AM
Split
Is it something you could split apart and do in steps within a number of assign nodes instead of just one node so you could see each part of your script separately?
Woozy
Veteran Member
Posts: 709
4/12/2012 12:46 PM
Split
Hi Shane - that is what I generally do, but I thought maybe there was another approach I didn't know about.
David Williams
Veteran Member
Posts: 1127
4/12/2012 1:00 PM
Split
Are you using the Add Javascript feature to key your script or going into the variable to build your JavaScript Expression? It might be more user friendly if you could see your script as multiple lines instead of one long line.
Woozy
Veteran Member
Posts: 709
4/12/2012 1:16 PM
Split
I'm using the "Add Javascript" feature. In this case, I'm doing a significant amount of IF-THEN logic, along with some work with regular expressions to clean and format phone numbers. My code populates a number of different variables within the single Assign based on the logic.
jamesraceson
Veteran Member
Posts: 52
4/12/2012 1:41 PM
Split
Woozy,
What I have found in the past is that when you are doing a large amount of Javascript in the "Add Javascript" feature that PF sometimes has problems evaluating the code. The error you are recieving is unfortunately the all too common error that pops up anytime that PF has problem with any of the values/variables within the script. Sometimes it's Null values, sometimes it's wrong types used in calcutations or comparisons and sometimes it's punctuation. What I have found that helps me to troubleshoot is to create a function in the pflow.js file (on the client side for testing) that is a copy of your IF-THEN logic. From here you can pass the required variables (from PF) to the function (to pflow.js) and evaluate each step to see where in your large IF-THEN logic something could be going wrong. Make sure to follow the exact format as the other functions already in the pflow.js file (very important). Once you are done, you then can restore the pflow.js file back to what it was and continue on.
Woozy
Veteran Member
Posts: 709
4/12/2012 1:59 PM
Split
Thanks James - very interesting idea. I don't understand how this helps you evaluate each step of the logic. Does this allow you to debug the pflow.js file by setting breakpoints or something? I don't have much experience with js, but that would seem logical.
jamesraceson
Veteran Member
Posts: 52
4/12/2012 2:37 PM
Split
Woozy,
Understood. Well, unfortunately this process does involve Javascript quite a bit. It would take me a while to write out each step in detail that you would need to do in order to accomplish this, but let me spread out a basic plan.
1) Create a function in the pflow.js file on your client machine
2) Copy your IF-THEN logics to the function
3) Pass your PF variables to the function (you will have to make sure the function has enough arguements for each variable)
4) Comment out each IF-THEN "step" just leaving the first one
5) Put a return statement that passes back either the evaluated variable that you originally passed (to verify that the statements works correctly and that the function recieved the correct value) or pass back the result of your THEN portion of the statement
6) In your PF have the assign node assign a variable that is the result of the function (e.g. your_variable = function_name(var1, var2, var3, etc.))
7) Look at the value of your_variable (in the PF log or in the bottom output screen in PF) to see what is being returned
8) Repeat this for each part of the IF-THEN statement in the function uncommenting each part after you verify that you are getting back what you expect from the statement
Woozy
Veteran Member
Posts: 709
4/12/2012 2:44 PM
Split
Ahhh - I understand what you're doing. That's very helpful! Thanks...
Please
login
to post a reply.