Labels

Tuesday, July 12, 2011

Item lookup with built-in search

Let's take a look at the operations, that manager executes every time he adds new item to an order:
1. Pushes lookup in the No. field
2. Goes to a Description field and starts to write an item name.
3. Chooses a necessary item.
If a user knows an Item name, then he can write it directly in No. field. NAV will search for an Item, that begins with an entered phrase and insert it's code to a No. field. It is because of AltSearchField property, setted for the Item table.
But what if several items, which Description field contains entered phrase exists? NAV will find only first of them... It's not convinient and that's why users prefer searching items in the item list, spending more time for every line.

My suggestion is to let the user choose an item from a list, if there are several items, that complies his request. It's a kind like incadea does...


For completing this task we must set ValidateTableRelation for Sales Line."No." to No:
Nothing bad really happens if NAV platform will not test relation by itself. It's already done by GET commands in source code in No. validation routines. The main reason why I set this property to No is to switch off platform search functionality.

Then I realized special function, that search for an item and let the user choose an item from a list:

And include little line in No. - OnValidate() trigger on Sales Line table:

Here is the result, I wrote word "Water" in No. field:

A list of items, containing word "Water" appears:
I select item "Water bucket", it's code moved to the sales line:

2 comments:

Anonymous said...

Hello.
Nice idea!
I would do some trick to search not only in Search Description, but also in No.
it can be done through filling temporary table filtered items by Search Description, then by No. and without doubling.

Sorry for my bad English.

GRIZZLY said...

You are welcome!