|
|
|
|
|
|
|
August 2006
|
|
|
|
|
|
|
In this issue:
1. Calling Lawson AGS from Visual Basic code
2. Worthwhile Reading
3. Lawson Tips & Tricks
The LawsonGuru Letter is a free periodic newsletter
providing provocative commentary on issues important
to the Lawson Software community.
The LawsonGuru Letter is published by—and is solely the
opinion of—John Henley of Decision Analytics.
Visit Decision Analytics at
https://www.danalytics.com. For subscription information, see the
bottom of this message. The LawsonGuru Letter is not affiliated with
Lawson Software. |
|
|
|
|
|
|
|
Before we get started... |
|
|
|
|
|
|
|
I (still...) Need your Input on RMI
Stability |
|
|
|
|
|
|
|
As I mentioned last month,
I'm planning
an article or two on RMI/Tomcat/Portal stability, and
while I got some good feedback last month, I'm still
looking for YOUR input.
Specifically, here's what I'm looking for:
-
How are global and/or 24x7 organizations dealing with
having to periodically restart RMI?
-
What versions, ESPs, patches, settings, etc. seem to
make it more stable?
-
What software combinations and/or platforms
(Tomcat/Apache, Tomcat/IIS, Websphere, etc. etc.) seem
to perform the most reliably?
-
If you've suffered from RMI instability, have you
contacted Lawson? If so, were you satisfied with their
response?
Send your submissions to
mailto:letter-editor@lawsonguru.com. |
|
|
|
|
|
|
|
1. Calling Lawson AGS from Visual Basic code |
|
|
|
|
|
|
|
A frequent question I hear is “How do I
integrate Lawson into my VB apps?”
It seems that
perhaps Lawson has forgotten all about VB, now that all
you seem to hear about is LSF 9.0’s IBM stack and
Landmark, which generates Java code. Was it not that
long ago that Lawson was touting their VB/ActiveX
integration toolkit?!?
Many organizations use VB for their "in-house"
applications; there are often requirements to access
and/or update the Lawson applications from your VB
applications. Well, it’s not that hard to
integrate your VB applications with Lawson, as long as
you are willing to learn a bit about the DME and AGS
programs that are included with IOS. The
advantages of using DME and AGS for this type of
integration are 1) you're using Lawson's security model,
and 2) it's a fully supported way to access and update
data in Lawson, since you're operating at the
"application layer" instead of interacting directly with
the database. In this article, I'm going to show
you the basics for interacting with AGS from your VB
code.
Three Parts to the Puzzle
-
First thing you need is a way to make HTTP calls from
your VB code. If you’re using VB.NET, the HTTP object is
built into the .NET Framework. For VB6, I use an ActiveX
HTTP Control from /n software IP*Works! v6.0 ActiveX/VB
Edition (see
http://www.nsoftware.com/ipworks/technologies.aspx?sku=ipa6-a).
-
Next, you need VB code to drive the HTTP Control. For
VB6, I wrote a VB class that calls AGS and DME using the
IP Works HTTP Control. For VB.NET, the code is similar,
but uses a lot more of the .NET Framework to do the
grunt work. I won’t bore you with the code sample, but
this is the technique I use to pull security class data
out of GEN to populate my security class viewer utility:
-
The last (and hardest) thing you need to do is figure out what you
need to include in the AGS URL string. Here’s a sample
for blanking out cycle 1 on an employee’s deduction via
PR14:
http://lawwebserver/servlet/ags?_PDL=TRAIN803&_TKN=PR14.1&_EVT=CHG&FC=C&_LFN=TRUE&_OUT=XML&EDM-COMPANY=4321&EDM-EMPLOYEE=1000&EDM-DED-CODE=BCD1&EDM-DED-CYCLE1=%20
When the call completes, you'll receive an XML
document. You need to check the <MsgNbr> tag; if
it's not
000, display <Message> tag contents.
Making Sense of AGS
The easiest way figure out the contents of the AGS call
is to access the form in Lawson Portal:
Then press Alt-Ctrl-A to see the debug screens, click on
“Transaction XML”, then click on ‘Perform Query’ Button:
The AGS call is then displayed in another browser
window. Insert the parameter &_LFN=TRUE into the URL
string, and click ‘Go’.
The “long field names” will now
be displayed, so that you can use those--rather than the
cryptic field numbers--in your AGS call:
From that point, all you need to do is write the code
that builds the AGS call URL string! |
|
|
|
|
|
|
|
2. Worthwhile Reading |
|
|
|
|
|
|
|
Workflow: Davis Controls Gets Its Business to Flow
- QUOTE OF THE ISSUE –
“Celebrate any progress.
Don't wait to get perfect.”
-- Ann McGee Cooper
How do you get workers to use a new software application? Try cutting off their e-mail.
The CEO of this Canadian manufacturer says it worked for him.
Baseline Magazine, June 2006
http://www.baselinemag.com/article2/0,1540,1973607,00.asp
IT Plays Linchpin Role In High-Stake M&As
A handful of companies understand what far too many don't--that IT's
ability to integrate,
and in some cases adopt, an acquired company's IT
systems and operations can determine
whether a merger flourishes or flounders.
Information Week, June 26, 2006
http://www.informationweek.com/news/showArticle.jhtml?articleID=189601047
Unstuck in the Middle
Life as a small- or mid-market CIO may be one of the toughest challenges in IT.
Here's how a few IT leaders in this space have persevered and even flourished.
CIO Magazine, June 15, 2006
http://www.cio.com/archive/061506/midmarket.html
|
|
|
|
|
|
|
|
3. Lawson Tips & Tricks
|
|
|
|
|
|
|
|
Share your Tips & Tricks. Send them to
mailto:letter-tips@lawsonguru.com.
You can view other Tips & Tricks on the Tips & Tricks page on
LawsonGuru.com.
String to Date in JavaScript, Round Two
Last month (see
https://www.danalytics.com/guru/letter/archive/2006-07.htm), I included a
JavaScript tip from David Williams to convert a date value in a string
variable returned from a DME call (in MM/DD/CCYY format) for use in an AGS
call (in CCYYMMD format).
I told you it would only work with locales that enter dates in MM/DD/CCYY
formats, since the code was looking in specific locations for the various
parts of the date:
RQDELDT = RQDATE.charAt(6) + RQDATE.charAt(7) +
RQDATE.charAt(8) + RQDATE.charAt(9) + RQDATE.charAt(0) + RQDATE.charAt(1) +
RQDATE.charAt(3) + RQDATE.charAt(4)
What I should have written was that you’ll probably not need
to worry about it in ProcessFlow, since DME calls always returns dates in
MM/DD/CCYY strings. But if you do, you’ll need to modify the pflow.js
JavaScript file that is shipped with Lawson ProcessFlow, and add additional
variations for the pfDate() function. Here's how to do it.
Technically, this is NOT a customization, since the ProcessFlow
documentation states:
“To make other date variables available in Expression Builder, you may
add them to the pflow.js file in CCSDIR/lawson/processflow or, on the
Designer side, in the Designer install directory.”
When you make these changes on the server in $CCSDIR/lawson/processflow/pflow.js
(%CCSDIR%/lawson/processflow/pflow.js on
Windows), you need to copy the updated pflow.js to the ProcessFlow Designer
directory (e.g. C:\Program Files\Lawson Software\ProcessFlow)
on each machine on which the ProcessFlow Designer is installed..
There are two changes required to the pflow.js file:
First, the function definition needs to be added to the top section, which
is source of the function drop down list in the Designer:
//*****Function Definition
-->Date=pfDate(var1,'dd/mm/yyyy') //
Then, in the pfDate function itself in pflow.js you’ll need to insert an
additional case:
case 'dd/mm/yyyy':
{
tmp = dateStr.substring(0,2);
retval.setDate(tmp);
tmp = dateStr.substring(6,10);
retval.setFullYear(tmp);
tmp = dateStr.substring(3,5);
tmp = tmp-1;
retval.setMonth(tmp);
return retval;
}
Once you copy the updated pflow.js to the ProcessFlow directory on your
workstation, you’ll then see a new function, pfDate(var1,'dd/mm/yyyy') when
you drop down the function list:
Assuming you want to send an email with appropriately formatted dates,
you can perform an AGS call to lookup the recipient user’s Locale (blank =
default):
PROD=GEN&FILE=USER&FIELD=Locale&KEY=<!user>
Next month we’ll look at similar code, written for Lawson Design Studio.
|
|
|
|
|
|
|
|
© Copyright 2006, Decision Analytics. All rights reserved.
|
|
|
|