View Full Version: Ags To Change User Field

LawsonTalk > BCI, Processflow and Addins > Ags To Change User Field



Title: Ags To Change User Field
Description: AGS to change value in FLDNBR=69


shanesmj - February 25, 2007 03:38 AM (GMT)
Hello:

Anyone know what ags call I would create to change the value of a USER FIELD... I am looking to set the value of a user field in a processflow but I can not seem to create the correct AGS call.... I have updated user fields with ADDS-INS many times but I can not seem to do it with a simple AGS call.

Anyone have the AGS string?

Thanks in advance...
Shane

vc727 - February 26, 2007 03:31 PM (GMT)
User fields have always been tricky with the lawson tools. I have never been able to update them with process flow if some one has a way I would also be glad to know how. I have been trying with this call today and it says change complete continue but the change isn't being made.


_PDL=PROD&_TKN=HR11.1&_EVT=CHG&_RTN=DATA&_LFN=ALL&_TDS=IGNORE&FC=C&EMP-COMPANY=****&EMP-EMPLOYEE=******&EFFECT-DATE=20070227&LINE-FC3=C&HRU-FIELD-KEY=***&HRU-FIELD-TYPE=N&VALUE=****&_DELIM=%09&_OUT=TEXT&_EOT=TRUE

any ideas would be helpful.

shanesmj - February 26, 2007 04:19 PM (GMT)
_PDL=TEST&_TKN=HR11.1&_EVT=CHG&_RTN=DATA&_LFN=ALL&_TDS=IGNORE&FC=Change&EMP-COMPANY=****&EMP-EMPLOYEE=****&EFFECT-DATE=20070226&HRU-FLD-NBR1=****&WS-FLD-NBR=****&VALUE1=****&WS-LINE-FC1=****&WS-VALUE1=****&_DELIM=%09&_OUT=TEXT&_EOT=TRUE

I tried this and it says "Change Complete - Continue" as well...

I do know that the following fields are needed:
HRU-FLD-NBR1
WS-FLD-NBR

(And they need to have the field number starting with 20) - Field key 25 would actually be 2025....

Any other suggestions? - from anyone?

mnye - February 26, 2007 04:25 PM (GMT)
have either of you tried using the debug functionality in Portal to check that your syntax is correct? Use that in conjunction with Ctrl-Atl-A to be sure youre populating all the necessary keys.

shanesmj - February 27, 2007 09:09 AM (GMT)
I can't remember....

Do I just run the ags call and then click CTRL-ALT-A to see what the ags call is doing? How will that help and what should I be looking for?

mnye - February 27, 2007 08:59 PM (GMT)
ok, heres what you want to do, keeping in mind that Im not a Lawson Administrator, so you may want to check with yours to be sure of any impact this may have on your system. Also you may not have permissions to do this and Ive never tried this with Lawson Portal 9. But heres what you can do:

1. Login to Portal with the URL set to debug. The syntax for this is:

http://lawsonportal:port/lawson/portal/index.htm?DEBUG=true

2. A Trace window will pop up, leave this window open. Youll be getting information from this window.

3. Go to the Form you want to post information to. Go to your trace window and hit F5. This will clear all previous information. Enter the desired values into your form.

4. Click Submit/Add/Delete/Change, which ever you are performing.

5. Bring your Trace window back up. There are 2 Panes:
Enter - Information Sent to the Server
Exit - Information sent to the browser

Click the "+" symbol to view the information.

6. The Enter information is what you want for your AGS call. Copy that.

Side note: you can also get similar information by pressing Ctrl-Atl-A and choosing one of the options that appears in the bookmarks.

7. Youll need to edit the information youve just gleaned from the Trace window. Wordpad is a good tool or any text editor.
a. Create the base AGS call
http://lawsonportal:port/enginetype/agsengine?_PDL=MYPDL&_TKN=Form&_LFN=ALL&_RTN=Return&_TDS=TDS&_OUT=OutputType&_EVT=Event&FC=FunctionCode

Bolded text are arguments that have multiple options, the values displayed in bold arent actual valid values. I dont have a list of all the available so youll need to do some research on that.

enginetype
  • cgi-lawson
  • servlet

enginetype
  • ags.exe
  • ags

8. Now you need to find the required fields. To do this youll use Ctrl-Atl-A on the form again. Click the “Required Collection” link. Copy them down, then find and note next to each one the key, the Name using the "Names Collection".

9. Do a find/replace on the Enter string, Replacing all occurrences of tabs (^t) with paragraphs (^p).

10. Now convert the field numbers to the Names from step 8.

11. Now add & between each field and convert this into one long string and append to the end of the string from step 7.

This will get you an appropriate functioning ags call. if you want to add error handling, evaluate the Exit string and write some scripting to receive that string to make a determination of success or failure.

This is a lot to take in, but it should at least get you on the right track or help ask more informed questions from GSC at the least.

hth
matt

shanesmj - February 27, 2007 09:01 PM (GMT)
I HAVE A WORKING AGS CALL.... (I will add more in a bit)

http://tl-2k3-lawweb/servlet/ags?
_PDL=TEST&_TKN=HR11.1&_EVT=CHG&_RTN=DATA&_TDS=IGNORE&FC=Change&_ADDINS=TRUE&_f1=C&_f257=1000&_f684=1&_f263=1&_f265=10004&_f267=20070227&_f478:0=2069&_f4=2069&_f482:0=Y&_f477:0=C&_DELIM=%09&_OUT=TEXT&_EOT=TRUE

shanesmj - February 27, 2007 09:23 PM (GMT)
_PDL=TEST&_TKN=HR11.1&_EVT=CHG&_RTN=DATA&_TDS=IGNORE&FC=Change&_ADDINS=TRUE&_f1=C&_f257=1000&_f684=1&_f263=1&_f265=10004&_f267=20070227&_f478:0=2069&_f4=2069&_f482:0=Y&_f477:0=C&_DELIM=%09&_OUT=TEXT&_EOT=TRUE

f1 = LINE action ?????????cann't find data on this
f257 = I HAVE NO CLUE???????? XMIT-HREMP-BLOCK
f684 = maybe company number?????? PT-FROM-PR134
f263 = company number
f265 = employee number
f267 = effective date
f478 = 2000 + field key
f4 = 2000 + filed key
f482 = value
f477 = line fc

anyone know what f1, f257, f684?

I still need to test what changes for an ADD or a CHANGE.... Also, does anyone have processflow running in a test environment? I know this script runs in portal but can't test in processflow because I only have processflow available in a live version.

mnye - February 27, 2007 09:27 PM (GMT)
is that what you got by using the above suggestions?

shanesmj - February 27, 2007 09:34 PM (GMT)
No,

I had an epiphany - Adds-ins upload wizard and then copy the ags call....

But I still need help processing and testing the call - don't know some of the fields and can not test to see if it works in processflow

Shane

vc727 - February 28, 2007 03:14 PM (GMT)

f257 = I HAVE NO CLUE????????

XMIT-HREMP-BLOCK ___This gets you past the soft warnings in lawson things like rate outside of range ok to continue stuff like that. it is a 10 character field made up of a string of 1s and zeros depending on which soft warning you are trying to override.

so the field looks like
0000000000
you just change out the zero for a one to override the warning.

1st - override all warnings
2nd- employee has same social ok to continue
3rd- social number invalid
4th- rate outside range
5th- alt rate exists with prior history
6th- currency change some amounts have not
7th- tax errors partial update
8th- internally used for changes to employees work company
9th- not used 10th not used.

so to override all edits you would enter 1000000000

this is from a lawson webex on using addins to upload mass personnel actions.

I am not sure about the others.

When I went to the upload wizard for hr11 I didn't see f1 as a coice to map to.

shanesmj - March 3, 2007 12:18 AM (GMT)
My AGS call works but I just need to understand it a little better... I am going to show this to Lawson at CUE...

I can not believe that no one else wants to write to a userfield through ProcessFlow.....................

GaryD - March 5, 2007 09:31 PM (GMT)
HR11 is a pain in the butt. All the User Fields are stored in a hidden array called WS-USER-FLDS-GRP so it is not just a matter of updating the HRU-FLD-NBR and VALUE fields. Every HR field is assigned a numeric number, user fields are 4 digits and start with 20. You can't really hard code the numbers either, because they are assigned as you create them, so if you create the user fields in a different order on TEST versus PROD they will not match.

To get the fld nbr related to a user field you should query HRUSERFLDS index HRUSET2 with the field name as key (what displays in HR11) which returns a two digit FIELD-KEY. Tack on the 20 in front of it and you have the field number.

An easier option may be to create a personnel action that updates the user field instead, then just add it calling PA52 with Immediate set to Y instead. This will also give you history that updating HR11 does not.

shanesmj - March 22, 2007 03:35 PM (GMT)
GaryD,

Your suggestion on updating a personnel action would be fine - - -

Do you know the AGS call for updating a PA52 action? I am sure that it is possible but I am trying to determine which one is easier updating the userfield directly or updating a personnel action?

Shane




Hosted for free by InvisionFree