Title: Ags And/or Dme Calls In A Shell Script
Description: Automate deleting webuser records
mivankovich - May 30, 2007 01:09 PM (GMT)
Hi - Has anyone attempted and succeeded in using an ags or dme call within a shell script?
I'm trying to automate the process of deleting webuser records when users have completed the new hire monthly benefits enrollment process.
My script will first check to see if the user has records in the BENEFIT table and if this true go check to see if the user has a record in the BENEFICRY table and if this is true make an ags call to delete the users record in logan.WEBUSER
Let me know your thoughts...
P.S - I'm new to this site. I've been working with lawson for several years wearing many hats (Programmer/Administrator/Analyst/etc..etc...etc...)
Thanks,
Mark Ivankovich
schroncd - May 30, 2007 04:19 PM (GMT)
Here's a doc on ags parms:
http://support.lawson.com/gid/docs/ows/atg...engine/ags.htmlYou just need to have REMOTE_USER and QUERY_STRING declared to run ags from command line or a script. Plus the current directory HAS to be $CGIDIR
cd $CGIDIR
export REMOTE_USER=xxx
export QUERY_STRING="xxx"
./ags.exe
g'luck!!
mivankovich - May 30, 2007 04:38 PM (GMT)
Hi Dave,
This is just what I'm looking for...Many thanks!
Mark
schroncd - May 30, 2007 05:01 PM (GMT)
Any time Mark - and "Welcome to the Family" here on LawsonTalk. The boards are relatively quiet, but the information shared is extremely good. With your background you'll no doubt be dropping pearls of wisdom on us in no time.
schroncd - May 30, 2007 05:02 PM (GMT)
OOPS! Used the <BACK> button and posted the same reply twice!
mivankovich - June 6, 2007 04:20 PM (GMT)
Hi Dave,
Finally had a chance to play around and this works. Now we'll be able to automate deleting RD30 records when users finish up their benefit elections via web enrollment process.
Here's the query string to delete in RD30:
cd CGIDIR
export REMOTE_USER=???
export QUERY_STRING="cgi-lawson/ags?&_EVT=CHG&_RTN=MSG&_TDS=Ignore&_LFN=TRUE&_PDL=LOGAN&_TKN=RD30.1&FC=Delete&_f4=8427569&_OUT=TEXT"
then do ./ags.exe | lashow (to see the output and the action message or error at the end)
-Notes-
Each parameter above needs the '&' in front of it. (lawson documentation missed this on the example).
The string didn't like the field names in it (ie. IDH-ID=?????), I used field numbers (ie. &_f4=???) instead and it worked.
Thanks again!
Mark
schroncd - June 7, 2007 01:07 PM (GMT)
Note to budding Lawson Admins:
This is EXACTLY why you NEVER let your end users have commandline access to your system. They can define REMOTE_USER as ANYBODY and with a properly crafted query, get any information of your system, no matter how your security is defined.