OnValidate from List Box vs. Typing

Hello, I have kind of an odd question - Is it possible to have Navision determine whether a value was typed into a textbox or if the value was selected from a look-up window. I have a customer that will be using Item Cross-Reference numbers. There may be instances where the same cross-reference number may point to several different item records. I want the system to display the look up window if the user types in a cross-reference number for which there are several records in the item cross-reference table that have the same cross-reference number pointing to mulitple items. BUT, if the user selects a specific record from the cross-reference list, I don’t want the system to do anything except it’s normal processing. I’d like to do this at the table level instead of adding code to a form if at all possible. Thanks for any help anyone can give me. Best regards, Mark.

Hi, You can write the code in OnValidate trigger of fileds in table to open the lookup form, But problem is OnValidate trigger will fire only when cursor leaves that fields.

Thanks for the reply Rajeesh! I am aware that I can put code in the OnValidate trigger that will open the list box. BUT, won’t that same code execute when I make a selection from the list box? What I am trying to figure out is how I can tell Navision that the user made a choice from the list rather than directly typing into the textbox. Thank you again for your reply. Best regards, Mark.

I would be tempted to create a custom lookup using OnLookup. This will get fired instead of the standard lookup with the user does a lookup. If you get a ‘LOOKUPOK’ you know that the field has been sucessfully populated by the lookup. I guess you could then set a Global and use this to determine wether you need to process your logic acordingly.

AAAAHHHHH!! Good Idea, Gary! I should have thought of this! Let’s see if I got this right… I could put code in the OnValidate to see if there is more than one value available. If there is, then fire up the look-up list. Then, when the look up list is closed, set a variable that says that the look up window was opened and therefore not re-fire the code that said to open the window. Thanks again, Mark.