Filter Option values in Form

Y_1716
Member Posts: 11
Hi 
I have a form with a text box of type Option, and it has values in the OptionString property ; <Senior Manager, Manager, Senior Partner, Partner>
Is it possible to filter these depending on a criteria?
Thanks,
Y_1716

I have a form with a text box of type Option, and it has values in the OptionString property ; <Senior Manager, Manager, Senior Partner, Partner>
Is it possible to filter these depending on a criteria?
Thanks,
Y_1716
0
Best Answer
-
Hey,
The solution will be something like this,
1. Make a new table say A.
2. Add two fields as Entry No and Description.(Entry No will be Auto Increment primary key and Description will be the Option types.)
3. Make a page of it Say Page B.
4. Add the Page ID in the LookuppageID of the Table
5. You can map some fields based on which you want to show the DropDowns, eg say on some Flag.
Code you need to write is on the OnLookup Trigger.
A.SETRANGE(FLAG,TRUE);
IF PAGE.RUNMODAL(0,A) = ACTION::LookupOK THEN
FieldVaribale := A.Description.
Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/5
Answers
-
Hey Y_1716,
Can you elaborate your question a bit more please.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
VarOption := Senior Manager,Manager,Senior Partner,Partner
TextBox50000.SourceExpr := VarOption<TextBox50000> - OnAfterValidate() SETRANGE("My Field",VarOption);
0 -
Hi,
Press Filter field button or F7 while cursor on this field and filter.
This is standard Nav functionality.Nav Upgrades and DEV outsourcing
Reports transformation to RDLC
List -1h , Complex List -3h, Document -4h (dev hours)
navisionupgrade.com0 -
RockWithNAV wrote: »Hey Y_1716,
Can you elaborate your question a bit more please.
Hi RockWithNAV,
I would like to set a criteria that if that is satisfied, not all 4 options of the option string are displayed (for example display only <Senior Manager, Senior Partner> )
thanks0 -
Filtering the options in a field itself is not possible.0
-
Duikmeester wrote: »Filtering the options in a field itself is not possible.
But you can create a copy of the field with Senior Manager,,, Senior Partner,, and then do some extra coding
0 -
Hey Y_1716,
As I understood you have a 3 4 different option in a Option Data Type field or Variable. What you want is on to some certain condition you want only selected option type to be visible when user clicks the Option Type Field. If this is the requirement then I will say you cant handle this with a Option data type but instead if you will handle this with lookups then I believe you can achieve what you want.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
RockWithNAV wrote: »Hey Y_1716,
but instead if you will handle this with lookups then I believe you can achieve what you want.
Hi rockWithNAV,
then is it possible to lookup a list and set default filters on that list? Cause I'm not sure how this can be done.
Thanks, Y_1716.
0 -
Hello
I would advice you to create couple textboxes with different sets of data and turn visibility of one of them depending on your requirements.
I can afford following example using table 37 and ruling available Type options depending on Document Type value
for Quote - empty, G/L Acoount and Item
for Order - empty, Resource and Fixed Asset
for Invoice/Credit Memo - empty, Charge (Item), Title and Begin-total
for Blanket/Return Order - empty, End-total and New page
as a result you can move all Type controls (Type1, Type2, Type3, Type4) into the same place and user will no notice difference. I did not overlap them because of clarity of experiment result.OBJECT Form 59996 Test Options Availavility { OBJECT-PROPERTIES { Date=04/18/16; Time=[ 6:37:24 PM]; Modified=Yes; Version List=Test; } PROPERTIES { Width=9790; Height=6490; SourceTable=Table37; OnAfterGetRecord=BEGIN CheckDocType; END; } CONTROLS { { 6000000;TabControl;220 ;220 ;9350 ;5280 ;HorzGlue=Both; VertGlue=Both; PageNamesML=ENU=General } { 6000001;TextBox ;3850 ;990 ;2750 ;440 ;ParentControl=6000000; InPage=0; SourceExpr="Document Type" } { 6000002;Label ;440 ;990 ;3300 ;440 ;ParentControl=6000001 } { 6000003;TextBox ;3850 ;1540 ;2750 ;440 ;ParentControl=6000000; InPage=0; SourceExpr="Document No." } { 6000004;Label ;440 ;1540 ;3300 ;440 ;ParentControl=6000003 } { 6000005;TextBox ;3850 ;2090 ;1700 ;440 ;ParentControl=6000000; InPage=0; SourceExpr="Line No." } { 6000006;Label ;440 ;2090 ;3300 ;440 ;ParentControl=6000005 } { 6000007;TextBox ;3850 ;2640 ;2750 ;440 ;Name=Type1; ParentControl=6000000; InPage=0; CaptionML=ENU=Type; SourceExpr=Type1; OnAfterValidate=BEGIN Type := Type1; END; } { 6000008;Label ;440 ;2640 ;3300 ;440 ;ParentControl=6000007 } { 6000009;TextBox ;3850 ;4840 ;2750 ;440 ;ParentControl=6000000; InPage=0; SourceExpr="No." } { 6000010;Label ;440 ;4840 ;3300 ;440 ;ParentControl=6000009 } { 6000012;TextBox ;3850 ;3190 ;2750 ;440 ;Name=Type2; ParentControl=6000000; InPage=0; CaptionML=ENU=Type; SourceExpr=Type2; OnAfterValidate=BEGIN Type := Type2 + 2; END; } { 6000013;Label ;440 ;3190 ;3300 ;440 ;ParentControl=6000012 } { 6000014;TextBox ;3850 ;3740 ;2750 ;440 ;Name=Type3; ParentControl=6000000; InPage=0; CaptionML=ENU=Type; SourceExpr=Type3; OnAfterValidate=BEGIN Type := Type3 + 4; END; } { 6000015;Label ;440 ;3740 ;3300 ;440 ;ParentControl=6000014 } { 6000016;TextBox ;3850 ;4290 ;2750 ;440 ;Name=Type4; ParentControl=6000000; InPage=0; CaptionML=ENU=Type; SourceExpr=Type4; OnAfterValidate=BEGIN Type := Type2 + 7; END; } { 6000017;Label ;440 ;4290 ;3300 ;440 ;ParentControl=6000016 } { 6000011;CommandButton;7370;5720;2200;550 ;HorzGlue=Right; VertGlue=Bottom; PushAction=FormHelp } } CODE { VAR Type1@6000000 : ' ,G/L Account,Item'; Type2@6000001 : ' ,Resource,Fixed Asset'; Type3@6000002 : ' ,Charge (Item),Title,Begin-Total'; Type4@6000003 : ' ,End-Total,New Page'; PROCEDURE CheckDocType@6000001(); BEGIN CASE TRUE OF "Document Type" IN ["Document Type"::Quote]: BEGIN CurrForm.Type1.VISIBLE := TRUE; CurrForm.Type2.VISIBLE := FALSE; CurrForm.Type3.VISIBLE := FALSE; CurrForm.Type4.VISIBLE := FALSE; IF Type IN [Type::" "..Type::Item] THEN Type1 := Type ELSE Type1 := 0; END; "Document Type" IN ["Document Type"::Order]: BEGIN CurrForm.Type1.VISIBLE := FALSE; CurrForm.Type2.VISIBLE := TRUE; CurrForm.Type3.VISIBLE := FALSE; CurrForm.Type4.VISIBLE := FALSE; IF Type IN [Type::Resource..Type::"Fixed Asset"] THEN Type2 := Type - 2 ELSE Type2 := 0; END; "Document Type" IN ["Document Type"::Invoice,"Document Type"::"Credit Memo"]: BEGIN CurrForm.Type1.VISIBLE := FALSE; CurrForm.Type2.VISIBLE := FALSE; CurrForm.Type3.VISIBLE := TRUE; CurrForm.Type4.VISIBLE := FALSE; IF Type IN [Type::"Charge (Item)"..Type::"Begin-Total"] THEN Type3 := Type - 4 ELSE Type3 := 0; END; "Document Type" IN ["Document Type"::"Blanket Order","Document Type"::"Return Order"]: BEGIN CurrForm.Type1.VISIBLE := FALSE; CurrForm.Type2.VISIBLE := FALSE; CurrForm.Type3.VISIBLE := FALSE; CurrForm.Type4.VISIBLE := TRUE; IF Type IN [Type::"End-Total"..Type::"New Page"] THEN Type4 := Type - 7 ELSE Type4 := 0; END; END; END; BEGIN { each Type has empty value in case of incorrect available. Type1: 0 1 G/L Account 2 Item Type2 (+2): 3 Resource 4 Fixed Asset Type3 (+4): 5 Charge (Item) 6 Title 7 Begin-Total Type4 (+7): 8 End-Total 9 New Page } END. } }
It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.0 -
Hey,
The solution will be something like this,
1. Make a new table say A.
2. Add two fields as Entry No and Description.(Entry No will be Auto Increment primary key and Description will be the Option types.)
3. Make a page of it Say Page B.
4. Add the Page ID in the LookuppageID of the Table
5. You can map some fields based on which you want to show the DropDowns, eg say on some Flag.
Code you need to write is on the OnLookup Trigger.
A.SETRANGE(FLAG,TRUE);
IF PAGE.RUNMODAL(0,A) = ACTION::LookupOK THEN
FieldVaribale := A.Description.
Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/5
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