Options

Editable date field

Hello.
I need to make something that doesn't work properly with my code.

I need one of my date field to have different states of permission.

For example:
If date field is empty -> Everyone can type there.

If date field is NOT empty, there must have a statement to check for user setup Allow Edit Date.


Мy code working that way:
If I open the form and the first document is without fill date every single document date in the form is editable.
If I open the form and the first document is NOT empty every single document I can't edit the date field.
What do I need to do to work properly like my example?

Form:
Form - OnOpenForm

IF ("Order Date" <> 0D) THEN
CurrForm."Order Date".EDITABLE := FALSE
ELSE IF ("Order Date" = 0D) THEN
IF UserSetup.GetAllowDateEdit THEN
CurrForm."Order Date".EDITABLE := TRUE;



Best Answer

Answers

Sign In or Register to comment.