how to Go next or move to next frame field

Namasiva

Member
Hi All,

for a requirement I had developed the code as below

define var frmnbr like so_nbr .
{mfdeclre.i}
update frmnbr.

for each so_mstr where so_nbr = frame-value no-lock:
find first usr_mstr where so_site = usr_access_loc no-lock no-error.
If not avail usr_mstr then
Do:
message "ERROR: User Doesn't have access to:" so_site "site."
view-as alert-box.

return no-apply.
End.


ON GO,return ANYWHERE
DO:
If frame-field = "nbr" then assign frame-value = frmnbr.
If frame-field = "nbr1" then assign frame-value = frmnbr.

end.
End.

{gprun.i ""xssorp10.p""}

the above code if i press F1 to go from frame field "nbr" it is assigning the frmnbr only to "nbr" filed it not assigning the frmnbr to nbr1 field

if i press f1 from the frame field nbr it has to gor to frame field nbr1 and assign frmnbr value to that field then only it has to go to the next level,


Pls help me.

Thanks in advance
 

daranroo7

New Member
Hi Namasiva,

you have used "go" and "return". "go" does not necessarily mean that if you press "f1" then that code gets invoked. on pressing "f1" if the control goes out of the frame then the code gets invoked.
here when you press "f1" from nbr field it goes out of the frame as i suppose both "nbr" and "nbr1" are in the same frame. so the focus will not go into the "nbr1" field. if you press enter "return" from "nbr" then press enter again to go to "nbr1" and then press enter again to leave the frame then the value gets assigned prperly.

but still if you need the "nbr1" value when you press "F1" from nbr value, i can suggest you to use field navigation using siblings.

on....
if frame-field = ......
assign...
/****here the code starts ****/
define var hdle as handle no-undo.
assign hdle = self:handle.
do while hdle:screen-value = "nbr1":
hdle = hdle:next-sibling.
end.
hdle = hdle:next-sibling.
assign hdle:screen-value = nbrm.
/***** here code ends *****/
 
Top