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
Java Script for AP20.1
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:
160
Members:
0
Total:
160
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
User Experience
Lawson Design Studio
Java Script for AP20.1
Please
login
to post a reply.
7 Replies
0
Subscribed to this topic
12 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
theotherkidd
New Member
Posts: 0
6/22/2007 3:52 PM
I have a user who would like to have all fields cleared after she does a Match in Ap20.1. Currently all fields clear successfully on a custom AP20.1 except for the Vendor field. I tried various JAVA scripts all to no avail. Anyone know of a Java script (or any other method) that can clear this field? Thanks.
John Henley
Posts: 3351
6/22/2007 6:22 PM
Split
You should be able to do this in FORM_OnAfterTransaction() by using lawForm.setFormValue
theotherkidd
New Member
Posts: 0
6/22/2007 7:38 PM
Split
I'm new to Lawson and Java. Can you give an example? I tried the function listed below but it doesn't work. Thanks.
function FORM_OnAfterTransaction(fc)
{
if (fc == "M")
lawForm.setFormValue("text7","");
}
John Henley
Posts: 3351
6/22/2007 8:09 PM
Split
Well, your first issue is that 'fc' isn't passed to FORM_OnAfterTransaction, only to FORM_OnBeforeTransaction.
Here's a sample from the Lawson documentation:
function FORM_OnAfterTransaction(data)
{
// was the transaction successful?
if (formState.agsError) return;
// following an add transaction, clear the "_f2" field
var fc=data.getElementsByTagName("_f1");
if (fc && fc.length > 0)
fc=fc[0];
if (fc == "A")
lawForm.setDataValue("GL-COMPANY","");
}
theotherkidd
New Member
Posts: 0
6/23/2007 1:19 AM
Split
Thanks John,
I'll give it a try.
theotherkidd
New Member
Posts: 0
6/25/2007 6:31 PM
Split
I get an error when using the data.getElementsByTagName function, so I tried the following:
function setFocus()
{
lawForm.positionInFieldById("text8");
}
function FORM_OnAfterTransaction(val)
{
if(val.selectSingleNode("//_f1").text == "M")// && lawForm.getMessageNbr() == "000")
{
lawForm.setDataValue("API-VENDOR","");
setTimeout("setFocus()", 300)
return true;
}
else
{
setTimeout("setFocus()", 300)
return true;
}
}
It works for me, but not for the user. Any ideas?
Terry P
Veteran Member
Posts: 234
7/30/2007 10:23 PM
Split
I have a "button" that clears part of the form, like the ctrl-shift-k shortcut. I position the cursor first because I want only the "detail lines" cleared.
The button just runs the function below. You could put it in another event though, most likely FORM_OnAfterTransaction(). If so additional code to check what action was taken or it would do it every time (which is maybe what you want anyway).
function ClearForm()
{
lawForm.positionInField("_f66r0");
tranMagic.clearFormData("_f66r0");
}
John Henley
Posts: 3351
7/31/2007 12:29 AM
Split
Gary, I remember this happening in another instance with a client. I think it turned out that the form itself had changed (i.e. the underlying AP20.scr was different) and/or the key numbers which are used to pass the fields from form to form as well as hold the values had changed. In that case, what I had to do was re-implement the form, so that Lawson would regenerate the XML, and then re-apply my customizations.
Please
login
to post a reply.