Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
User Experience
Lawson Design Studio
validating field for each row in the details section of a form
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Rich Cowie
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5255
People Online:
Visitors:
507
Members:
0
Total:
507
Online Now:
New Topics
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
S3 Systems Administration
ADFS certificate - new cert
12/3/2024 9:38 PM
The certificates on the windows boxes expired and
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 S3 HR/Payroll/Benefits
Error
11/6/2024 9:54 PM
When I try to enroll a retiree in 72.1 health plan
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
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
User Experience
Lawson Design Studio
validating field for each row in the details section of a form
Please
login
to post a reply.
8 Replies
0
Subscribed to this topic
12 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
mjcindc
Basic Member
Posts: 8
8/19/2009 8:25 PM
Hi All, I'm working on and customizaton to PO39.1. I need to iterate through all rows in the details section and check to see if the 'FC' value is 'A' or 'C'. If it is, I want to make sure there is something in the 'sublot' field. With what I've written, it only checks the 'sublot' field on the first row even if the add or change is on another row. As long as the 'sublot' field is populated in row one it accepts the change. This is what I've got so far. It's clear to me I'm missing the iterate through each row part, but I don't have a clue how. Any help is appreciated. function FORM_OnBeforeTransaction(fc1) { if (fc1== "A" || fc1== "C") { var sUserFld = lawForm.getFormValue("text3",formState.currentRow); if (sUserFld == "") { lawForm.positionInFieldById("text3"); lawForm.setMessage("Field is required"); return false } } return true; }
Deleted User
New Member
Posts: 0
8/19/2009 9:05 PM
Split
The function code passed to OnBeforeTransaction is the Form function code, not the line function code. you need to check the form value the same way you checked the user field If you only care about the currently selected row then use currentRow, otherwise you will need to loop through the lines with a do (var i=0;i<10;i++) function FORM_OnBeforeTransaction(FC) { if (FC == "A" || FC == "C") { var sUserFld = lawForm.getFormValue("text3",formState.currentRow); var sLineFC = lawForm.getFormValue("fc1",formState.currentRow); if (sUserFld == "" && (sLineFC == "A" || sLineFC == "C")) { lawForm.positionInFieldById("text3"); lawForm.setMessage("Field is required"); return false } } return true; } If you only care about the currently selected row then use currentRow, otherwise you will need to loop through the lines with a do function FORM_OnBeforeTransaction(FC) { if (FC == "A" || FC == "C") { for (var i=0;i<4;i++) { var sUserFld = lawForm.getFormValue("text3",i); var sLineFC = lawForm.getFormValue("fc1",i); if (sUserFld == "" && (sLineFC == "A" || sLineFC == "C")) { lawForm.positionInFieldById("text3",i); lawForm.setMessage("Field is required"); return false } } } return true; }
mjcindc
Basic Member
Posts: 8
8/20/2009 2:08 PM
Split
Thanks, Gary. That second piece of code was exactly what I needed. Of course, success leads to more work and I've got another related question. I'm doing the same change to IC29.1 and it seems I can continue to add lines in the detail section by using page down. I've added 36 lines and have given up the experiment to see if I run out of available lines to populate. Is there a function to get the number of populated lines in the detail area? Something like getRowCount? That's a made up name. It would look like this: function FORM_OnBeforeTransaction(FC) { if (FC == "A" || FC == "C") { for (var i=0;i
Deleted User
New Member
Posts: 0
8/20/2009 3:15 PM
Split
There is no stored value of the max lines of a detail area, but you can get it: var mDetail = lawForm.magic.formWnd.detailColl.getItem("DT0"); if (mDetail) var detailMax = mDetail.rows; DT0 is the id of the detail area of this example.
mjcindc
Basic Member
Posts: 8
8/20/2009 3:32 PM
Split
Thanks again. This works just as I hoped. I'm new to JavaScript and Design Studio. I'm a strong SQL programmer with a bit of Java and a lot of Perl in my toolbox, so I figured I could work out the Javascript. I've attempted to find these answers on my own, but I'm a bit discouraged about my chances. When I google javascript and magic.formWnd there are no results. Therefore, I assume these are lawson created objects. Is there some documentation I should be reading to learn this stuff? It's certainly not in the training materials they gave me in my Design Studio class. I'd like to become proficient with Design Studio but the documentation just doesn't seem to be available.
Deleted User
New Member
Posts: 0
8/20/2009 3:47 PM
Split
That is correct, "magic" is a Lawson specific object. There are good examples at the end of the Design Studio user manual to get a feel of what things you can do. The rest was learned on the job and with a lot of digging on my part.
John Henley
Posts: 3351
8/20/2009 4:13 PM
Split
There is certainly no "definitive reference" but we consultants do try to share our examples in addition to the ones Lawson provides. One suggestion is that you "invest" in a browser plugin that will let you explore the DOM, etc. --that's how I figure out a lot of stuff.
Terry P
Veteran Member
Posts: 234
9/1/2009 3:04 PM
Split
John - can you be more specific when you talke about a browser plugin. Suggestions, examples of what you can do, etc. Thanks!
John Henley
Posts: 3351
10/3/2009 10:08 PM
Split
Here's a link to a blog showing the two tools I use: - Firebug for firefox - Developer toolbar for IE (built-in to IE8, addon for IE6/IE7)
http://elegantcode.com/20...8-developer-toolbar/
Please
login
to post a reply.