melmckee72
New Member
working in 9.1a chui environment
working with updateable browse and having trouble with 2 things.
first - if on leave trigger finds available record can not leave the browse (F1 does not send me to the next block of code)
second - if on leave trigger does not find available record I get the error message, but can not get back to the browse.
This is the last piece of this puzzle that I'm working on, if anyone has any ideas, i would appreciate the input.
Thanks in advance.
code looks like this:
def query jobfunc for bempfunc SCROLLING.
define browse func
query jobfunc NO-WAIT
display bempfunc.bfcde bempfunc.bfjob enable all
with 10 down no-box.
define fram job
func
with title "Job Functions" row 9.
mfcode = bempfunc.bfcde:handle in browse func.
mfjob = bempfunc.bfjob:handle in browse func.
ON ENTRY OF BROWSE FUNC DO:
ON TAB EDITOR-TAB.
END.
define fram mm
fcode label "Function Type"
fjob label "Job"
with row 9.
ON leave of bempfunc.bfcde in browse func DO:
FIND FIRST BFUNC WHERE BFUNC.BFCDE =MFCODE:SCREEN-VALUE NO-LOCK NO-ERROR.
IF NOT AVAILABLE BFUNC THEN DO:
DISPLAY "Invalid Function Type".
RETURN NO-APPLY.
END.
do transaction:
get current jobfunc exclusive-lock no-wait.
assign input browse func bempfunc.bfcde bempfunc.bfjob.
end.
get current jobfunc no-lock.
end.
FORM
BEMP.BFSTNME SKIP
BEMP.BLSTNME SKIP
BEMP.BDEPT SKIP
BEMP.BPHONE SKIP
BEMP.BEXT SKIP
BEMP.BACTIVE SKIP(2)
WITH FRAM H NO-BOX.
Prompt-for "Add New Employee(A) or Modify Existing Employee(M)?" mchoice
with fram z no-labels.
assign mchoice = input fram z mchoice.
If mchoice = "M" then RUN MODIFY.
Else if mchoice = "A" then do:
.....(code to create new employee record)
END.
PROCEDURE MODIFY:
...(code to update existing employee department, ext, etc)
END PROCEDURE.
open query jobfunc
for each bempfunc where BEMPFUNC.blstnme = MLAST AND BEMPFUNC.BFSTNME = MFIRST.
enable func WITH fram job.
wait-for close of current-window.
working with updateable browse and having trouble with 2 things.
first - if on leave trigger finds available record can not leave the browse (F1 does not send me to the next block of code)
second - if on leave trigger does not find available record I get the error message, but can not get back to the browse.
This is the last piece of this puzzle that I'm working on, if anyone has any ideas, i would appreciate the input.
Thanks in advance.
code looks like this:
def query jobfunc for bempfunc SCROLLING.
define browse func
query jobfunc NO-WAIT
display bempfunc.bfcde bempfunc.bfjob enable all
with 10 down no-box.
define fram job
func
with title "Job Functions" row 9.
mfcode = bempfunc.bfcde:handle in browse func.
mfjob = bempfunc.bfjob:handle in browse func.
ON ENTRY OF BROWSE FUNC DO:
ON TAB EDITOR-TAB.
END.
define fram mm
fcode label "Function Type"
fjob label "Job"
with row 9.
ON leave of bempfunc.bfcde in browse func DO:
FIND FIRST BFUNC WHERE BFUNC.BFCDE =MFCODE:SCREEN-VALUE NO-LOCK NO-ERROR.
IF NOT AVAILABLE BFUNC THEN DO:
DISPLAY "Invalid Function Type".
RETURN NO-APPLY.
END.
do transaction:
get current jobfunc exclusive-lock no-wait.
assign input browse func bempfunc.bfcde bempfunc.bfjob.
end.
get current jobfunc no-lock.
end.
FORM
BEMP.BFSTNME SKIP
BEMP.BLSTNME SKIP
BEMP.BDEPT SKIP
BEMP.BPHONE SKIP
BEMP.BEXT SKIP
BEMP.BACTIVE SKIP(2)
WITH FRAM H NO-BOX.
Prompt-for "Add New Employee(A) or Modify Existing Employee(M)?" mchoice
with fram z no-labels.
assign mchoice = input fram z mchoice.
If mchoice = "M" then RUN MODIFY.
Else if mchoice = "A" then do:
.....(code to create new employee record)
END.
PROCEDURE MODIFY:
...(code to update existing employee department, ext, etc)
END PROCEDURE.
open query jobfunc
for each bempfunc where BEMPFUNC.blstnme = MLAST AND BEMPFUNC.BFSTNME = MFIRST.
enable func WITH fram job.
wait-for close of current-window.