CurrForm.Editable

Guys,
How can I make this happen, the condition I have:

  1. If Status::Released then the entire fields are non editable except “Shipped” field (Boolean).

  2. If Shipped = true and Status::Released then the entire fields are non editable.

Please check my codes below and advise on what’s went wrong.

On Sales Order Form (F42)
OnAfterGetRecord()
IF COUNT <> 0 THEN BEGIN
IF Shipped AND (Status = Status::Released) THEN
CurrForm.EDITABLE := FALSE
ELSE
CurrForm.EDITABLE := TRUE;

IF (Status = Status::Released) AND NOT Shipped THEN BEGIN
CurrForm.EDITABLE := FALSE;
CurrForm.Shipped.EDITABLE := TRUE;
END ELSE
CurrForm.EDITABLE := TRUE;
END;

Thanks a lot!
ZB

Hi, what error message are you getting?

Hi, there is no error message but the following code is not working as I wanted:

IF (Status = Status::Released) AND NOT Shipped THEN BEGIN

CurrForm.EDITABLE := FALSE;

CurrForm.Shipped.EDITABLE := TRUE;

END ELSE

CurrForm.EDITABLE := TRUE;

I couldn’t figure it out what went wrong.

Thanks

ZB