Passing a key via code and command (AREV Specific)
At 27 JUL 2007 12:32:56PM Daniel Rebich wrote:
I'm trying to pass a key into a new window that is being displayed via a softkey selection from a main window. However, I am unable to figure out a way to pass the key into the new window, so that, the existing record can be available immediately when the window is displayed. Any ideas out there would be greatly appreciated.
I'm using 'W' as the code and the window name in the command field. Just one other piece of information, if I hard code a key after the window name it works, but I am unable to make the key variable by using a symbolic, @ID, etc
Thanks for your help
Daniel Rebich
At 30 JUL 2007 03:50AM Simon G Wilmot wrote:
Try setting @Data to your required key and adding a Carriage return if you want the record populated ..
Eg @Data=KeyValue : Char(13)
This should be done prior to the window call …
Simon
At 30 JUL 2007 10:45AM Michael Slack wrote:
Hello Daniel:
The simplest way to do what you're looking for is with a CATALYST.CATALYST("W", "window_name_goes_here ":@ID)
Please note the space between the window name and the key you're sending to the window.Here is a few examples of my code where I've done something simular. Hopefully it'll give you some ideas. My additional comments are in lower case.I hope these might be of some help.Michael Slack
* PERFORMS CALL TO THE EQUIPMENT WINDOW
* - USES VALUE FROM EQP_NO FIELD IF USER IS ON THE FIELD
* CALLED FROM: SOFT-KEY (SF6)
compare the column number of the current prompt with that of an
equate value of the column within the table. if the same then the
user is on the correct prompt that has a key to another table. if
the cursor isn't on the prompt or there isn't a row displayed on the
screen then go to the else section of the statement.
IF WC_SI%=INV_EQP_NO$ THEN
CATALYST('W','EQP_DS1 ':WC_IS%)END ELSE
CATALYST('W','EQP_DS1')END
CALL_HR_DS1:
* CALLS THE HR_DS1 WINDOW USING THE EMPL_ID, IF PRESENT, * AS THE RECORD KEY TO DISPLAY IN HR_DS1. * * CALLED FROM: SOFTKEY (SF2)
same as above but with a bit extra. if the cursor isn't on the prompt
with the key to the other table, then check the value of the column.
if it doesn't have a usable value then only call the screen otherwise
call the screen with the value in that column as the key.
IF WC_SI%=SEC_EMPL_ID$ THEN
CATALYST('W','HR_DS1 ':WC_IS%)END ELSE
IF @RECORD=' OR @RECORD=NON_ASA$ THENCATALYST('W','HR_DS1')END ELSECATALYST('W','HR_DS1 ':@RECORD)ENDEND
RETURN
CALL_INV_STATUS_DS1:
* CALLED FROM WINDOW SOFTKEY.
* CALLS THE INV_STATUS_DS1 (INVENTORY) WINDOW.
variation of the first example. this one is dealing with a group of
multivalues on a screen. if the cursor is not within the group (in this case there is only one group on the screen) then call the window without a key. the cursor is within the group of prompts, then check that the prompt that holds the keys to the other table has a real key or not. this one goes further that if the value is possibly a real key then try to get the row. if the row still exists then call the screen with the key of the current multivalue line item. otherwise tell the user that the key is no longer valid.
IF WC_CURR_AMV_GROUP% ]
THEN IF @RECORD=NONSTOCK' THEN CATALYST('W','INV_STATUS_DS1') END ELSE INV_REC=XLATE("INV_MSTR",@RECORD,"","X") IF INV_REC=' THEN MESSAGE=STOCK NO=:@RECORD:'"' MESSAGE := "|CAN'T BE FOUND IN THE INV_MSTR TABLE." MSG(MESSAGE,MSG_MAP_A,
,'')END ELSECATALYST('W','INV_STATUS_DS1 ':@RECORD)ENDENDEND ELSE
CATALYST('W','INV_STATUS_DS1')END
RETURN
At 06 AUG 2007 11:44AM Daniel Rebich wrote:
Yea, from a program I have done that many times. I was not specific enough with my original question, let me try again. We have a main window that allows the users to to F6 and get a list of the softkeys that are available to them. One of the options is to open another window and populate more information that is not availableon theprimaryu screen. I'd like to be able to open the window from the softkey menu and populate the window with any information that may have already been entered.
Thanks for any help
Daniel
At 06 AUG 2007 12:23PM Karen Oland wrote:
From the soft key, run a program (using "S" as code - you can pass in any one parameter, such as which internal subroutine to run). In that program, look at @ID and any arev common info needed, then call the window from there.
At 07 AUG 2007 10:44AM Michael Slack wrote:
We have few situations like what you are describing. Our approach was to create a collector window that is called by the softkey. The softkey calls a program or routine that fills in the @PSEUDO system varaible, then the collecor window is called. On the collector window side, the @PSEUDO fills in the prompts (either automatically or with a little programming help, depending on the situation). The collector window can be display only or can allow the data to be modified. Once the user saves the window and returns to the calling window, there may be a need for a little updating of the data on the calling window side. But when the data on the calling window is saved, all the changes will be written to the row.
Michael Slack