Problems with OnLookup trigger

OrangePie
Member Posts: 11
Hi,
I'm quite new to NAV and while trying to filter the OnLookup list I stumbled across some difficulties. I want to limit the number of possible choices, let's say workers, when unrolling the OnLookup list on page. I tried following the guide that seemed to help to achieve a similar result though it didn't quite work for me.
Could anyone point me in the right direction? I played with some built-in functions but a simple SETRANGE doesn't seem to do the trick.
I'm quite new to NAV and while trying to filter the OnLookup list I stumbled across some difficulties. I want to limit the number of possible choices, let's say workers, when unrolling the OnLookup list on page. I tried following the guide that seemed to help to achieve a similar result though it didn't quite work for me.
Could anyone point me in the right direction? I played with some built-in functions but a simple SETRANGE doesn't seem to do the trick.
0
Comments
-
If you post you code it will be a help to understanding your questen.
What version of NAV/BC are you using?For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0 -
I'm on 2013. There isn't much code to show since it's been only some functions that I tested.
Say I have a table and one of its fields is related to data in another table. On page I want to filter the OnLookup list to show only those options in that field that have a certain parameter set to TRUE.
I tried applying some filters but to no avail.
After writing the post I found this though: https://forum.mibuso.com/discussion/2588/filtering-a-lookup
Can you at least explain to me where tblItem came from? is it built-in? I didn't find any information in my materials.0 -
tblItem is a "Record" type variable with subtype "Item" (points to "Item" table);
Some field - OnLookup() //written in table object MyTable.SETRANGE("Filter Field", TRUE); //set your filter on the target table IF PAGE.RUNMODAL(0, MyTable) = ACTION::LookupOK THEN //RUNMODAL means it will be run "on top", i.e. you won't be able to progress until you are finished with the new window //parameter 0 means that it must open page specified in the table's (MyTable) "Lookup Page ID" property //parameter MyTable points to the record we want to open the page with (specific filtered table) //ACTION::LookupOK means that we will only execute the below code if the page is closed by pressing "OK" button at the bottom-right VALIDATE("Some Field", MyTable."Target Field"); //this is because you most likely want to save the value you looked up, in this case to the "Some Field"
2 -
Thanks for the succint answer, I've got it now.0
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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