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
Data query + User Interface Designer
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Chris Radcliffe
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5187
People Online:
Visitors:
195
Members:
0
Total:
195
Online Now:
New Topics
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
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
Lawson Business Intelligence/Reporting/Crystal
Domain Name Change
3/5/2024 7:45 PM
Our domain name needs to change and was hoping I c
S3 Customization/Development
Cobol calling Shell Script
2/29/2024 1:27 PM
Has anyone created or modified a Lawson Cobol prog
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
1351
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
Data query + User Interface Designer
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
khart
Advanced Member
Posts: 25
3/2/2011 7:32 PM
Is there a way to use the portal page designer and the formlet function in that toolbox to map data? I have a Lawson form built then brought it onto the portal page designer using the formlet function but I can not get those two pieces to "talk" together...has anyone done this before? My data query returns rows of data so when I click on a row or click on the check box I would like it to be mapped to the Lawson form. I can gather all the data into variables from the row click but I can not pass it to the formlet.
David Williams
Veteran Member
Posts: 1127
3/2/2011 7:42 PM
Yes, you can map data from a DME to your formlet. Shoot me an email and I'll put together some screen shots for you.
khart
Advanced Member
Posts: 25
3/2/2011 8:20 PM
Thanks, email sent.
SusanB
New Member
Posts: 4
3/28/2011 1:56 PM
I'm trying to do this same thing with no luck. I was wondering if you'd be willing to share the same screen shots with me. I have modified a portal page to include a formlet displaying company # and deposit date. The portal page has a header and detail section plus the formlet. Company comes from the detail query and deposit date from the header query. The formlet deposit date field will allow the user to modify the deposit date. I'm not able to populate the formlet. I don't know how to capture that data. I would really appreciate any guidance you have to offer.
Thank you!
Scooter
Veteran Member
Posts: 83
4/10/2012 3:16 PM
David, could you share the screenprints to me? It could be useful to resolve another issue that I submitted to this forum today?
David Williams
Veteran Member
Posts: 1127
4/10/2012 3:33 PM
Shoot me an email to David@ConsultDavidW.com or david.williams@bailsllc.com and I'll send you the documentation sometime today.
Demi
Veteran Member
Posts: 67
9/21/2012 7:56 PM
I too, would be interested in acquiring some doc. on this; if you would be willing to share it further. I am at
demichener@co.bucks.pa.us
.
Clement
New Member
Posts: 2
10/29/2012 5:28 PM
Hi David.
I am also interested in the solution! I just sent you an email.. Thanks for your help!
heidi
Basic Member
Posts: 12
11/30/2012 2:50 PM
Hello, David,
Might I request a copy of the documentation you have provided for DME/query in Lawson Design Studio User Interface?
I am new to the product, so any help would be cheerfully appreciated.
One of my first efforts in LDS involves a need to retrieve related dataset and display on form or in a message box.
My email address is: hsimon@meridianhealth.com
Regards,
Heidi
David Williams
Veteran Member
Posts: 1127
11/30/2012 3:18 PM
Heidi - I just emailed you a document with examples of how to use JavaScript to perform a DME call.
heidi
Basic Member
Posts: 12
12/10/2012 1:17 PM
Thank you very much for the information, David. It is very much appreciated.
New to Design Studio, I am trying to get my first DME call function to work.
So far, unsuccessful . . .
Below is a modification of a function that appeared in the Lawson DS document, "Add data query results to a form". I can not save it, as the system indicates that there is an issue in the line where the results are parsed ("length -1") The line appears to be the same as what was in the documentation.
Any help/direction would be cheerfully accepted.
Heidi
function BUTTON_OnClick(id, row)
{
if (id == "push3")
{
alert("New Button Pressed");
var sVendor = lawForm.getDataValue("MRH-VENDOR");
alert(sVendor);
//Do DME Call
var s = DMEPath+"?PROD=";
s += top.lawsonPortal.getUserVariable("PRODLINE");
s += "&FILE=APVENMAST";
s += "&FIELD=VENDOR_STATUS"
s += "&SELECT=VENDOR=" + sVendor;
s += "&OUT=CSV&DELIM=~&NOHEADER"
alert(s);
var sReturn = top.httpRequest(s);
lawForm.setFormValue("text52","");
if (!sReturn || sReturn.status > 400 )
return;
sReturn = sReturn.replace(/\r/g."");
aRecs = sReturn.split("\n");
aRecs.pop();
aRecFields = aRecs[aRecs.length -1].split("~");
if (ARecFields[0] != "")
lawForm.setFormValue("text52",aRecFields[0];
}
return true;
}
heidi
Basic Member
Posts: 12
12/10/2012 1:25 PM
Oh, the error received is "Expected Identifier".
David Williams
Veteran Member
Posts: 1127
12/10/2012 1:26 PM
The script sample you are looking at is for version 8.03 of Design Studio. The docs I sent you should have the v9 syntax.
heidi
Basic Member
Posts: 12
12/10/2012 1:58 PM
Thank you for clarifying! I was getting quite confused with the approaches taken in the different documents. A variation of the v9 syntax example is shown below. This time, the script was able to be saved. However, this time, when testing the form, a message "Servlet Xpress reported: Missing required parameter: _TKN" appears. Any ideas what caused this message to be produced?
function BUTTON_OnClick(id, row)
{
if (id == "push3")
{
alert("New Button Pressed");
var sVendorGroup = "VND1";
var sVendor = lawForm.getDataValue("MRH-VENDOR");
alert(sVendor);
//Do DME Call
var vProd = portalWnd.oUserProfile.getAttribute("productline");
var DmeString = "?PROD=" + vProd + "&FILE=APVENMAST"+ "&FIELD=VENDOR_STATUS;&SELECT=VENDOR^%3D" + sVendor + "&XCOLS=TRUE&XKEYS=TRUE&XRELS=TRUE&XCOUNT=TRUE&XIDA=TRUE&OUT=XML"
var vDMEInfo = portalWnd.httpRequest(portalWnd.DMEPath + vDmeString)
var vObjDMEXML = new top.DataStorage(vDMEInfo)
var vRecords = vObjDMEXML.document.getElementsByTagName("RECORD");
var numRec= vRecords.Length;
if(numRec!=0)
{
varAlert = ""
for (i=0;i
{
var vCols = vRecords
.getElementsByTagName("COL");
var vVenStatus = vCols[0].firstChild.data;
vAlert += "Vendor Status: " +vVenStatus + "\n"
}
alert(vAlert)
}
}
return true;
}
David Williams
Veteran Member
Posts: 1127
12/10/2012 2:17 PM
I usually see that based upon where the return true command is placed in the script. To avoid it I usually just return true when the text field or button is NOT the one I want - so in your example, I would use - if (id!="push3") return true - and then add the code I want in the rest of the function.
heidi
Basic Member
Posts: 12
12/10/2012 2:50 PM
I made the change, however I am still seeing the same error message. Not sure what to try now . . .
New script:
function BUTTON_OnClick(id, row)
{
if (id != "push3") return true;
{
alert("New Button Pressed");
var sVendorGroup = "VND1";
var sVendor = lawForm.getDataValue("MRH-VENDOR");
alert(sVendor);
//Do DME Call
var vProd = portalWnd.oUserProfile.getAttribute("productline");
var DmeString = "?PROD=" + vProd + "&FILE=APVENMAST"+ "&FIELD=VENDOR_STATUS;&SELECT=VENDOR^%3D" + sVendor + "&XCOLS=TRUE&XKEYS=TRUE&XRELS=TRUE&XCOUNT=TRUE&XIDA=TRUE&OUT=XML"
var vDMEInfo = portalWnd.httpRequest(portalWnd.DMEPath + vDmeString)
var vObjDMEXML = new top.DataStorage(vDMEInfo)
var vRecords = vObjDMEXML.document.getElementsByTagName("RECORD");
var numRec= vRecords.Length;
if(numRec!=0)
{
varAlert = ""
for (i=0;i
{
var vCols = vRecords
.getElementsByTagName("COL");
var vVenStatus = vCols[0].firstChild.data;
vAlert += "Vendor Status: " +vVenStatus + "\n"
}
alert(vAlert)
}
}
}
Robert Spurr
Veteran Member
Posts: 130
12/10/2012 5:57 PM
I jumped in late to this conversation but the error message you are getting is the same message you get if you don't link the button to a function.
In the designer:
1) Click on the button
2) Select the actions from the properties
3) Select Function on left
4) paste in "BUTTON_OnClick" without the quotes
Of course if this is not the problem please ignore. Hope This Helps.
Robert
heidi
Basic Member
Posts: 12
12/10/2012 6:14 PM
Thank you, robert. The function is linked to the button. When I click the button, it begins to step through the function. However, it bails out with the "Token" required message.
Are you aware of any sample code that I could try in order to obtain a "proof of concept" for accessing a piece of related data not currently on the form, and then displaying the output on the custom form?
Robert Spurr
Veteran Member
Posts: 130
12/10/2012 6:22 PM
If your willing to try, I've included a script I use in IC12.1 to populate some of the cost/qty information on the main form so they don't have to drill. For your test you could probably just convert what I have as text fields to alerts.
Let me know if this helped.
function FORM_OnAfterTransaction(data)
{
var vCompany = lawForm.getDataValue("ITL-COMPANY");
var vLocation = lawForm.getDataValue("ITL-LOCATION");
var vItem = lawForm.getDataValue("ITL-ITEM");
var strPDL = portalWnd.oUserProfile.getAttribute("productline");
//DME call
var s = "?PROD="+strPDL;
s += "&FILE=ITEMLOC";
s += "&INDEX=ITLSET1&KEY=" + vCompany + "=" + vLocation + "=" + vItem;
s += "&FIELD=LAST-REC-COST;LAST-ISS-COST;SOH-QTY;ALLOCATABLE";
s += "&MAX=1&OUT=XML";
//alert(s);
var sReturn = portalWnd.httpRequest(portalWnd.DMEPath + s);
if (!sReturn || sReturn.status)
{
var msg="Error calling DME ";
msg += (sReturn
? "(status code): " + sReturn.status
: "bad server response.");
alert(msg);
return true;
}
var vObjDMEXML = new portalWnd.DataStorage(sReturn);
var vRecord = vObjDMEXML.document.getElementsByTagName("RECORD");
if (vRecord.length == 0)
{
return true;
}
lawForm.setDataValueById("text47","");
lawForm.setDataValueById("text48","");
lawForm.setDataValueById("text49","");
lawForm.setDataValueById("text50","");
vCols = vRecord[0].getElementsByTagName("COL");
lawForm.setFormValue("text47",vCols[2].firstChild.data);
lawForm.setFormValue("text48",vCols[3].firstChild.data);
lawForm.setFormValue("text49",vCols[0].firstChild.data);
lawForm.setFormValue("text50",vCols[1].firstChild.data);
return true;
}
heidi
Basic Member
Posts: 12
12/10/2012 6:32 PM
Robert, Thank you very much! I will give this a shot and let you know how I make out. Your help is really appreciated.
heidi
Basic Member
Posts: 12
12/10/2012 7:05 PM
Robert, Data values were returned!!! This is a break through! Thank you so, so much for your time and attention.
Unbelievably, though, the same error message box still pops up before displaying the information. I don't know how to address this error message. Is there a way to suppress the message, given that the system actually does return results now?
I am thrilled to have finally "made contact" with other Lawson tables accessed from a custom form. It opens up a whole new world.
Again, your help, and that of David Williams, has been invaluable to me. Thank you both! And, thank you Lawson Guru.
Heidi
Robert Spurr
Veteran Member
Posts: 130
12/10/2012 7:23 PM
I beginning to believe this has nothing to do with the DME and more to do with the form. I would start over by deleting your current design studio form and regenerating a fresh copy. Validate it works before entering any scripting or buttons.
Did you try the script I provided on IC12 and that is were you got the error?
heidi
Basic Member
Posts: 12
12/10/2012 7:29 PM
Robert, Yes, I used your script "right out of the box", with exception of calling it from a Button Click, as opposed to the "OnAfterTransaction".
I started with a fresh, new form, as I had not yet done any work on any of the IC12 forms. I added four text boxes that matched where you output the DME values.
Then, a new button was added, to retrieve the data.
Your script worked like a charm!
I am working in our testing environment, where there are multiple productlines. Could the errant message have something to do with that?
Robert Spurr
Veteran Member
Posts: 130
12/10/2012 9:13 PM
I guess it could be. Alert the product line and verify or for testing purposes hard code the product line to test.
heidi
Basic Member
Posts: 12
12/11/2012 2:26 PM
While I don't have a full solution yet to share, it appears that the errant, unnecessary message may be caused by a LID run type "pgmdef" setting. Once the issue is fully resolved, I will post what it took to resolve.
Again, your help and time is appreciated!
You are not authorized to post a reply.