How to make a line in a list screen non editable?

Hai All,

Can anyone tell me how I can make a line in a list screen non editable ?

Following is the scenario :

Consider a variable X :

If X = ’ ’ then I should be able to edit only that particular line in the list screen.

If X <> ’ ’ then I should not be able to edit that particular line in the list screen.

Any help would be appreciated…

Thanx in advance…[:)]

Hi,

You could add the following code in the OnAfterGetCurrRecord

CurrForm.EDITABLE := X = ‘’;

Hope this helps.

Albert

Th

This code will make the whole form non-editable.

You need to put the “CurrForm.Fieldx.EDITABLE := x = ‘’;” to the onFormat control of all the fields instead.

Hai,

Thanks a lot. This is working fine with text fields. How can I handle the same in a lookup field?

This is not working with lookup field.

Please give me your valuable suggestion.

You can disable lookup fields, this way they cannot focus (click) on the field.

Same way but CurrForm.Fieldx.ENABLED := etc.

Sorry when iam putting the following code in onformat of the field, it is making the whole field disable, ie even for X<> ’ ’

currform.field.enabled := (X = ’ ’ );

Awaiting your reply.

You will not be able to make a particular line non editable.

The only way is to make an error “after” they inputted the value into the field. It means the field is editable but once user put value, Nav will check the condition and give error message depends on the condition.

Well I just read your answer before again. Why doesn’t it work with Lookup fields? If you have put the EDITABLE correctly on the onFormat for the field, then you will not be able to change the field. Yes, you can still make a lookup. But you will not be allowed to edit the content of the field you are coming from.

UNLESS you have created some custom code on the onLookup of the table, which will update the table. Then you need to alter this code also.

Of course you can do that!

I have done it many many times over the years. And you just have to do it for the fields, not for the form in itself. Just as I have described above.

I think he’s talking about particular line and not column.

Oh, my mistake. I understand what you’re trying to do by putting the code on AfterGetCurrRecord. Never think about this solution.

We need to do it for every field then. Does this solution make the list form run slower ?

Yes I have got some codes in the onLookup of that field. But where else can i write this code so that my lookup field bcomes non editable once the condition becomes false.

Please do help me out…

Thanks in advance

No I’m not putting it on the onAfterGetCurrRecord. You have to put the code on the onFormat of the fields. And it has to be in the form of: CurrForm.theField.EDITABLE(IsEditable);

not

CurrForm.EDITABLE(IsEditable);

As the latter will make the whole form non editable.

You have to check for the same condition before you’re executing the Lookup code, as you use when checking if the fields are editable on the forms.