lookup..any one ..urgent

In the Base functionality, when a field has lookup, if we enter a single character in the field if any value is present starting with the value enterd then automatically the whole value is poped up onto the screen and if the value is not present it raises an error. But i have written code on the field ‘OnLookup’ trigger and the default base functionality is not shown. In the Base general journal, against the ‘Account no.’ if i enter only a single number then it raises error, but if enter the whole number the system accepts it. I have tried doing the same way as that,still then it gives error eventhough i enter the value that is present in the table. and one more point is that the field which i am lookingup is not a primary key field. how do i circumvent the problem? need it urgently… thanks in advance kumar

I hope I did understand you right. The error is produced by the property ValidateTableRelation on the table field. On the form you have to write code in the OnAfterInput trigger. (The best is a function call to the tabel, so you can reuse this functionality on other forms based on this table) The function has to search in the table, like this: - Is the value entered found (SETCURRENTKEY to speed up, SETRANGE/SETFILTER) - Search for ‘value entered + *’ (use SETFILTER) to find everything that starts with the value entered. If there’s only one (FIND(’-’), COUNT), thake that one. - Otherwise display error

If you want to truely mimic the Navision functionality, you would use the FIND(’-’) not COUNT = 1. Standard Navision will return the first match in alphabetical order even if the typed value could be on of several records or values. Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117

Thanks Ivor van Son it is working fine but the code has to be written on the Onvalidate trigger only.any way thanks kumar