Hi!
I'm using NAV 5.0 SP1. I added a new item under Type option field in Purchase Line table, let's name it SSS. User selects this type and in No. field chooses an account from a subrange of accounts from G\L Accounts table. In order to achieve this I added this table relation under corresponding property of No. field in Purchase Line table: if (Type = Type::
SSS) them G\L Accounts where No. = ((CONST)100000), or something similar (I don't have access to NAV right now). But when a user selects type SSS and then open the list of accounts in No. field, there is a complete unfiltered list of accounts and not only one set by the filter. It seemed easy enough to set and now I don't know what might be a problem. Would you please tell me what I'm missing? Thanks!
0
Answers
you have to write code for lookup(running a form using filter on PK filed) in onlookup trigger of related field. look at runmodal function.
I have just another question: I implemented lookup through code, but only for one type field (SSS one) and now default lookup for other types won't work anymore. Does coding in OnLookup trigger overrides default table relation options of all types? Any suggestions on solving this without actually writing lookup code for all other types?
You could add a field to your G/L Accounts, which you can use to filter on in the tablerelation.
Anyway, this is solved, thank you all for helping me out.