add Option string at run time

redrose
Member Posts: 36
Dear all,
I want to add Option string at runtime. I tried to assign a new optionstring value to one of my option field.But system is showing error that 'its not an option'. How can i add option string values like 0,1,2,3 at runtime.
I want to add Option string at runtime. I tried to assign a new optionstring value to one of my option field.But system is showing error that 'its not an option'. How can i add option string values like 0,1,2,3 at runtime.
0
Comments
-
You cannot.
What are you trying to accomplish? Maybe we can suggest a different approach.There are no bugs - only undocumented features.0 -
you can't. The options you must define before in the design mode.
What are you trying to do?
If you're options are "dynamically", why do you not use a codefield with an tablerealtion to a new table where you define the "options" like:
Table A with Code (Code 10) and Description (Text 30) and your new field in Table B has a relation to the Code field of table A.
RegardsDo you make it right, it works too!0 -
You cannot add new options during runtime but you can simulate removing existing on the form .
You need to define two textboxes with SourceExpr pointing to the same variable or table field, name the two TextBoxes using two different names (TextBox1 and TextBox2 for example), and in each of text box change OptionCaption by removing unnecessary options but leaving commas.
Like this:
OptionString in Option Field in the table or option variable: 0,1,2,3,4,5
OptionCaption in TextBox1: 0,1,,3,,5 - the user will see in dropdown only option 0,1,3,5
OptionCaption in TextBox2: ",,2,,4,5" - the user will see in dropdown only option 2,4,5
Then you can use VISIBLE property of the TextBoxes to hide/show correct texbox on the form using
CURRFORM.TextBox1.VISIBLE(b);
CURRFORM.TextBox2.VISIBLE(NOT b);
where b is Boolean variable or expression
Regards,
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030
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