Filtering to only see a reange of G/L Accounts

If I were in a Sales or Purchase Line and the Type selected was “Account (G/L)”, is there a way i can restrict the “No.” field to only see a specific range of G/L Accounts? I have tried a few things, with not much luck. Any ideas how I can approach this one?

One way is to add a new field in table 91 “User Setup” where You enter a filter. In form 18 “G/L Account List” You can use that filter in the On Open Form Trigger. You can also put You own code in the OnLookup Trigger in Sales Line and other tables, but that’s more work. //Lars

Hi, Please do the following. 1. Open the Design for Table(id-36)- Sales Line. 2. Select field “No.” 3. Open the property sheet for “No.” field. 4. Select “TableRelation” property. 5. Click on Assist button, button with … 6. Select the line with Type=CONST(“Account (G/L)”) under condition cloumn. 7. Click on Assist button of TableFilter coloumn i.e. last column on the open screen 8. there you can specify the field as “No.” in field column and value range in “Value” column good luck.

Hi Rajesh, whilst your solution will “work”, it is definitely NOT recommended. IN Navision we always avoid hard coding. If the client changes their G/L Structure, or simply if they start a new Company, then this may not work. Then the client will call you to ask what happened. And either they will waste money having you fix something, or you will waste your time doing it for free. If you MUST hard code it into the properties, then try something like this: Add a new field to the G/L Account table

"Exclude from Sales"::Boolean"

" Then modify the lookup properties of the Account no. field with the filter

"Exclude from Sales" = FALSE"

.This way, when you create a new account, the DEFAULT will be for it to be in thelookup, and the client will have to deliberately remove it from the list. You can of course do the same for Purchase. Of course this is a real hack, and the correct solution is the make a new table that lists the accounts that can be used, and create a new field on the sales line to select this. In conclussion, one of my favourite sayings “A short cut is the longest path between two points.” Do it properly the first time, you will have a much happier client, and a more successfull business. _________________________ David Singleton Navision Consultant since 1991 dmks22@comcast.net___________

Thanks to all for your posts. This forum is a great tool for learning and practical application. I appreciate the feedback from all of you. Developer Wannabe, Tyler Folsom