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:
LynneB
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5123
People Online:
Visitors:
140
Members:
0
Total:
140
Online Now:
New Topics
Lawson S3 Financials
PO Matched Dollars and Matched Quantity
5/10/2024 6:51 PM
Can anyone share the Lawson calculation to determi
S3 Customization/Development
COBOL CSV file
5/10/2024 2:36 PM
We have a custom Cobol program ZU200 that creates
S3 Systems Administration
Using MFA for Lawson S3 Access
5/8/2024 1:23 PM
Does anyone use Multi Factor Authentication when u
Lawson Landmark
Executing IPA from PR160
5/3/2024 2:46 PM
We're facing a situation where we need to upda
IPA/ProcessFlow
Executing IPA from PR160
5/3/2024 2:46 PM
We're facing a situation where we need to upda
S3 Customization/Development
Cobol - Extract Current Time
4/24/2024 7:21 PM
How do you extract just the Current System Time in
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1357
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Lawson Design Studio
Java Script for AP20.1
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
theotherkidd
Basic Member
Posts: 4
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: 3352
6/22/2007 6:22 PM
You should be able to do this in FORM_OnAfterTransaction() by using lawForm.setFormValue
theotherkidd
Basic Member
Posts: 4
6/22/2007 7:38 PM
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: 3352
6/22/2007 8:09 PM
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
Basic Member
Posts: 4
6/23/2007 1:19 AM
Thanks John,
I'll give it a try.
theotherkidd
Basic Member
Posts: 4
6/25/2007 6:31 PM
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
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: 3352
7/31/2007 12:29 AM
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.
You are not authorized to post a reply.