I write a program for online ordering articles at some suppliers. Therfore i have a browse with the artikels in the order. In the browse there is a checkbox for confirming the orderline in the order.
Now i wrote a testprocedure for the articles. If the article is not recognized by the suppliers I want the row disabled (The row must be visible but disabled). Those line shall be annulated in the ERP system.
Thanks
Kurt
you could add a value-changed trigger to test the condition and set field(s) read-only attribute accordingly.
Hi, using Adrian's post, here is a small sample developed with appbuilder.
Look the file attached if you want.
On value changed trigger, step #3:
ON VALUE-CHANGED OF BROWSE-2 IN FRAME DEFAULT-FRAME /* Browse 1 */
DO:
IF AVAIL customer THEN DO:
IF customer.custnum = 5 THEN DO:
IF disableRow( browse-2:HANDLE, FALSE ) THEN
.
END.
ELSE
IF disableRow( browse-2:HANDLE, TRUE ) THEN
.
END.
END.
New function Code, step #4:
FUNCTION disableRow RETURNS LOGICAL
( INPUT browserHandle AS HANDLE,
INPUT disableCol AS LOG ) :
/*------------------------------------------------------------------------------
Purpose: disable/enable rows in a browse
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE icol AS INTEGER NO-UNDO.
DEFINE VARIABLE hcol AS HANDLE NO-UNDO.
IF NOT VALID-HANDLE(browserHandle) THEN
RETURN FALSE.
ASSIGN
hcol = browserHandle:FIRST-COLUMN
hcol = hcol:NEXT-COLUMN. /*first column is disable, so get the next column*/
DO WHILE VALID-HANDLE(hcol):
hcol:READ-ONLY = NOT disableCol.
hcol = hcol:NEXT-COLUMN.
END.
END FUNCTION.