infor.com
concierge
infor u
developer portal
Home
Groups
Lawson - Technology Customer Community [READ ONLY]
Using UNIX Script from Portal
robert-canham
We are currently using Lawson System Foundation 9.0.1.10. One of our processes is user initiated to execute a UNIX script on our Lawson server. They do it today by logging into LID and are presented with a unix menu to pick an option. We would like to move them off of this process. I saw a post elsewhere talking about tokendef and was able to create a token to run a unix script and have it working successfully. However, I can't seem to bring it up in Portal.
Does anyone know of a way to do this?
Find more posts tagged with
Infor Lawson Technology Group - Discussion
Comments
moellerg
Yeah, you actually have to create a custom program... but it's pretty simple.
pgmdef, Copy a simple report.... call it whatever you want, but be careful not to use something that may get overwritten by a future Lawson code.
Make it as in the screen print of pgmdef.
Next, put your script name in the PD section like I've uploaded. (That is the entire PD section, so it should be your program code PD file in your src directory.
You need to compile the report and get the xml file... that's the key to having it accessible from portal.
scott-cohen
tokendef is a lid program. create an userform, in the form definition you can specify the script you want to run.
unknown
We have the same issue, we've got dozens of custom tokens that run UNIX scripts which all must be run from LID. Our problem is that many of them prompt the user for a value before running the UNIX script.
robert-canham
Wow, thanks for all the replies. I will give Greg's idea a try.
productmodeling
If you go to the trouble of defining 4GL forms to launch your scripts (tokens), you can always also define a parameter form for any of the variable input provided by the users.
unknown
Thanks. This is a big problem for us. Would love to see an example of using a 4GL form to prompt for a value and launch a UNIX script from Portal if anyone has one.
lbecker
We do this freqently.
The first way, an Admin with LID access sets up a job in 'jobdef' for the business user, calling the batch user token (no parameter forms). The Business User can then inquire on the job, and submit at will.
The difference is that Portal requires a productline, but jobdef does not.
A second way is to create a Portal Bookmark pointing to a korn shell script in $GENDIR/cgi-bin.
$ ls -l $GENDIR/cgi-bin/lgl94117
-rwxr-xr-x 1 lawson lawson 943 Jul 24 10:31 lgl94117
The trick is to point the URL of the bookmark to the shell script:
/cgi-bin/lgl94117
Open a new window when it runs, echo a reply to the user:
if command args
then
print "Content-type: text/plain; charset=iso-8859-1
"
print "script xxxx was run " \n
print "This window may be closed" \n
else
print "Content-type: text/plain; charset=iso-8859-1
"
print Failed to execute command, please contact support
exit 1
fi
scott-cohen
Call the "System" Routine to execute a script on the server. Here is an example. This is from a windows machine, but modify the path called, and it should work in unix
scott-cohen
See xx120pd xx120ws xx120.rpt and xx120.scr
scott-cohen
The rest of the files
lbecker
A caveat when using this technique, there is no error checking by the calling program. If it is something critical, the 'batch.bat' script must write any messages to a log file, and some other process or person must review the log.
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help
Popular Tags
Infor Lawson Human Resources Group - Discussion
Infor Lawson Technology Group - Discussion
General Discussions
VISUAL - Enterprise General Discussions
Infor Lawson Supply Chain Management - Discussion
Process Automation (IPA) - General Discussions
Pegasus - Partner General Discussions
Infor Lawson Supply Chain Group - Discussion
Infor Lawson Financials Group - Discussion
Infor EPM Discussions