rithmikansur
New Member
Im a bit confused about buffers.
I'm currently running 9.1D
I had defined a shared buffer.
then sent the handle to that buffer as input to an internal procedure
the procedure was then supposed to update one of the fields in the buffer.
However, it didn't work ask expected. It didn't generate an error, but it also didn't update the record.
So, i ended using the below code do do my updating, where i check the buffer name then update the appropriate buffer.
The ReqNum field is the primary key BTW.
Should i be using the recid or rowid ? or am i going about this the wrong way?
Any help is appreciated.
Thanks!
John
I'm currently running 9.1D
I had defined a shared buffer.
then sent the handle to that buffer as input to an internal procedure
the procedure was then supposed to update one of the fields in the buffer.
However, it didn't work ask expected. It didn't generate an error, but it also didn't update the record.
So, i ended using the below code do do my updating, where i check the buffer name then update the appropriate buffer.
The ReqNum field is the primary key BTW.
Code:
PROCEDURE myUpdateHold:
DEF INPUT PARAMETER thisBuffer AS HANDLE.
DEF INPUT PARAMETER ReqNum AS INTEGER NO-UNDO.
CASE STRING(thisBuffer:Name):
WHEN "DesSched" THEN DO:
FIND DesSched WHERE DesSched.ReqNum = ReqNum EXCLUSIVE-LOCK.
IF DesSched.Hold = TRUE
THEN ASSIGN DesSched.Hold = FALSE.
ELSE ASSIGN DesSched.Hold = TRUE.
END.
WHEN "DesComp" THEN DO:
FIND DesComp WHERE DesComp.ReqNum = ReqNum EXCLUSIVE-LOCK.
IF DesComp.Hold = TRUE
THEN ASSIGN DesComp.Hold = FALSE.
ELSE ASSIGN DesComp.Hold = TRUE.
END.
WHEN "EstSched" THEN DO:
FIND EstSched WHERE EstSched.ReqNum = ReqNum EXCLUSIVE-LOCK.
IF EstSched.Hold = TRUE
THEN ASSIGN EstSched.Hold = FALSE.
ELSE ASSIGN EstSched.Hold = TRUE.
END.
WHEN "EstComp" THEN DO:
FIND EstComp WHERE EstComp.ReqNum = ReqNum EXCLUSIVE-LOCK.
IF EstComp.Hold = TRUE
THEN ASSIGN EstComp.Hold = FALSE.
ELSE ASSIGN EstComp.Hold = TRUE.
END.
END CASE.
APPLY 'CHOOSE' TO but-refresh.
END PROCEDURE.
Should i be using the recid or rowid ? or am i going about this the wrong way?
Any help is appreciated.
Thanks!
John