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:
Emily
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5308
People Online:
Visitors:
399
Members:
0
Total:
399
Online Now:
New Topics
S3 Systems Administration
Quick Access report
8/25/2025 7:17 PM
Looking for a good way to see who has access Lawso
S3 Customization/Development
LP01 hiding a PTO plan from the list
8/13/2025 4:44 PM
Hi all. is there a way to hide a specific PTO&n
Lawson Business Intelligence/Reporting/Crystal
GLTrans - PO Line/MAInvdtl
8/6/2025 6:13 PM
Hello, we have an existing tabular model for fina
IPA/ProcessFlow
Retrieving GUID from InforOS
7/25/2025 2:22 AM
Hello everyone, I was wondering if there is a way
IPA/ProcessFlow
IPA for forwarding cost messages (MA64/MA66.3)
7/23/2025 6:07 PM
When a buyer has an invoice cost message where the
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
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3290
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
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: 3359
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: 3359
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: 3359
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.