OnLookup Filter
Kc_Nirvana
Member Posts: 146
Hi. This is my first post. I am a very noob in Navision and i need your help.
The Problem:
I have created a new table like which have type(Item,Fixed asset) and No. .
On the table relation of No. I put "IF (Type=CONST(Item)) Item ELSE IF (Type=CONST(Fixed Asset)) "Fixed Asset" WHERE (Requirement=CONST(Yes))" where requirement is a new boolean field.
When i do the lookupmode on the No., with type = Fixed Asset it goes to Fixed Asset List and only show the fixed assets which requirement = TRUE.
So far so good...
But if i click on the button Show All ( in Menu Navision where are the buttons list, right, left) it shows me all fixed assets.
How can i solve this?
Sorry about my english........
The Problem:
I have created a new table like which have type(Item,Fixed asset) and No. .
On the table relation of No. I put "IF (Type=CONST(Item)) Item ELSE IF (Type=CONST(Fixed Asset)) "Fixed Asset" WHERE (Requirement=CONST(Yes))" where requirement is a new boolean field.
When i do the lookupmode on the No., with type = Fixed Asset it goes to Fixed Asset List and only show the fixed assets which requirement = TRUE.
So far so good...
But if i click on the button Show All ( in Menu Navision where are the buttons list, right, left) it shows me all fixed assets.
How can i solve this?
Sorry about my english........
Junior Consultant & Developer in Dynamics NAV
"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"
Nirvana - Nevermind - Smells Like Teen Spirit
"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"
Nirvana - Nevermind - Smells Like Teen Spirit
0
Comments
-
That's just part of NAV. Filters can be removed...usually.
If you don't want them to be able to remove the filters, look into FILTERGROUP functionality. You'll have to code your own lookups, though. I would just leave it as is unless you have a requirement that the user is not allowed to unfilter.0 -
Alright thanks......
I've already had thought in that solution...
In this code what am i doing wrong? because the value "No." does not change......... Im doing this on a tableNo. On lookup IF Type = Type::"Fixed Asset" THEN BEGIN FORM.ActivateLockFilter (My function which set and locks the record) FORM.LOOKUPMODE := TRUE; IF FORM.RUNMODAL =ACTION::LookupOK THEN BEGIN FORM.GETRECORD(MyRec) "No." := MyRec."No."; END; END;Junior Consultant & Developer in Dynamics NAV
"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"
Nirvana - Nevermind - Smells Like Teen Spirit0 -
I'm not 100% sure from your code. In any case, I usually do it like this:
No. - onLookup local variable fixedAsset { IF FORM.RUNMODAL(0,fixedAsset) = Action::lookupOk THEN VALIDATE("No.",fixedAsset."No."); }
If you only want them to see certain Fixed Assets in the list, and you don't want to let them "Show All" then do something like this:No. - onLookup local variable fixedAsset { fixedAsset.FILTERGROUP(10); fixedAsset.SETRANGE(Requirement,TRUE); fixedAsset.FILTERGROUP(0); IF FORM.RUNMODAL(0,fixedAsset) = Action::lookupOk THEN VALIDATE("No.",fixedAsset."No."); }
It's possible that you don't need to write any code at all though. Look at how table relations are set up on the "No." field on the Sales Line table.0 -
I've tried that but the problem is that I'm doing that code on the table and the "No." doesn't change. I can't put a value in the "No.".
I tried on the form i create on the "No." onlookup trigger and it do fine, but on the table i can't pass the value from the fixed asset to "no."Junior Consultant & Developer in Dynamics NAV
"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"
Nirvana - Nevermind - Smells Like Teen Spirit0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
