Editable Property of Field and Lookup

Hi,

I have a field in a Table, where I put some code in the OnLookup Trigger. Now I put this field in a Form, and set the Editable Property (of the Field) to False (with Code). When I start the Form, go to the lookup and do a LookupOK with a different Value, that new Value is written to the Database, which is not really the behaviour I want…

If I do the same thing, but make the whole Form EDITABLE(FALSE), then I can’t change the Field Value (which is the behaviour I want).

I can mark the Form-Field as ENABLED(FALSE), or I could put the OnLookup Code in the Form instead of in the Record, to get around this issue… Is there another way?

This just means you can’t manually type in the field, not that the field can’t change by some other method (like the code in OnLookup).

What is the business requirement? These are two very different solutions. Do the users need to see the possible values even if they can’t change them?

Hi Matt,

well we could argue about that, since in the C/Side Reference Guide says: For fields, use this property to make a field for display only. Which I understand, as “can’t be changed” (and that’s the way it works, if you make the whole Form EDITABLE(FALSE)). But that’s besides the point, since it clearly doesn’t work that way.

What I want is the effect of the EDITABLE(FALSE) (users being able to look at the table behind), but without the ability to change the records with a lookup, and I dont’ really want to put the code on the form (because then I have to put it on every form, that uses that field in that way).

The users can probably life with the ENABLED(FALSE) Version. It’s just, that I would rather do it “nicer”, if somebody has a way.

No it is saying that the control ollows this rule. But the underlying table field is not affected. You can write code or drill down or other functions that can change the value, otherwise it would not be possible to change the value of that field.

Take an example where I have three fields on a table Qty, Price and Amount. In the Qty field I have a trigger Amount := qty * price; now if I put the three fields on a form, and set the control for amount as non editable, but I cahnge Qty I would expect amount to change, even though it is not editable.

Remember that drill down is a function of the TABLE, not the form.

I think Navision is acting correctly and the help is correct.