Hi.
I had occasion to add the Item."Item Category Code" field to a form, and gotthe expected lookup behaviour for free. But, when the form Item Categories pops up, you can edit the contents, which is (in this case) undesirable. I looked for missing 'magic' in the table and form, but all looked normal. So I checked a few others, like the lookups from the item card fo posting groups, unit of measure. All allowed editing. (I gues I never really noticed before ...)
Anyway, the user wants the category lookup to behave like the item no. on a sale order line, the sell-to customer in the header, etc., etc., - they are all "pure lookups", with no editing.
This was all in 4.0SP3, and I've checked up to 6.0SP1 and it's still the same.
So this boils down to two questions:
1 - Is there a reason they made some lookups "pure" lookups and others are editable? (I mean from an user-inteface design point of view, not a technical one.)
2 - Regardless, am I going to have to hand-code the lookup and set the form to Editable(False) to get the desired behaviour?
I guess there's a 3rd question - where is the "magic" that makes the forms behave differently?
Thanks a bunch!
0
Comments
2 - There's a property called 'LOOKUPMODE', which you can set if you use a form as a variable. I think you might be able to catch it in OnOpen (you know... IF LOOKUPMODE THEN CurrForm.EDITABLE := FALSE, or CurrForm.EDITABLE(NOT LOOKUPMODE) or something like that). I don't have NAV open so I can't check at the moment, but if I remember I'll see if I can find it for you.
RIS Plus, LLC
I think it's
in the OnOpenForm trigger.
My Blog - nav.education
I can 'hack' it from here.
It's funny that base NAV doesn't have the IF LOOKUPMODE stuff in there already.
Cheers!
RIS Plus, LLC
My Blog - nav.education
RIS Plus, LLC
I could be mistaken, but I believe that that is not correct according to NAV coding standards. If you want to assign a value you are supposed to use := or VALIDATE. I'll be the first to admit, though, that I still sometimes do it that way. Old habits die hard.
My Blog - nav.education
Form - OnOpenForm()
// don't allow editing of this form in, lookup mode
IF CurrForm.LOOKUPMODE THEN
CurrForm.EDITABLE(FALSE);
These are actually very different pieces of code that do different things; they are not the same.
The only solution I've been able to come up with is to have two identical forms except the subform is editable and the drill-down is not.
Any other ideas?
Thanks in advance!
- Zac
What is the differences?
Andwian
t