Drop Down Box

yuppicide
Member Posts: 410
I am trying to figure out how to turn one of my TextBoxes into a drop down box with choices.
On my Item Card I have "Fabric Types" and you can drop down and select your fabric.. Rayon, Cotton, Sheer, Silk..
On another tab you guys helped me setup something earlier so I can have Catalog, Year, and Page number. I'd like Catalog to have a drop down box which contains selections PB, PC, PL, SP.
I looked at the code for Fabric Type and changed my Catalog to have OptionString ,PB,PC,PL,SP but that idd not work.
On my Item Card I have "Fabric Types" and you can drop down and select your fabric.. Rayon, Cotton, Sheer, Silk..
On another tab you guys helped me setup something earlier so I can have Catalog, Year, and Page number. I'd like Catalog to have a drop down box which contains selections PB, PC, PL, SP.
I looked at the code for Fabric Type and changed my Catalog to have OptionString ,PB,PC,PL,SP but that idd not work.
0
Comments
-
yuppicide wrote:I looked at the code for Fabric Type and changed my Catalog to have OptionString ,PB,PC,PL,SP but that idd not work.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thanks for the help. That would work, except it won't let me change it because I have to blank out everything. There's too many items already labeled for me to go and blank every one out then re enter them.0
-
Create a new field called Catalog2 with your options.
Do a processing only report - that transfers the values from the incorrectly setup catalog field.
catalog2 := catalog;
modify;
then you'll feel better that you don't have to do all the work again.
Then delete the old catalog field - change the name of catalog2 to catalog.
it's like a switcharoo - you know what I mean?0 -
so you would take a multi-step approach:
1 - add a new field, make it option type
2 - create a routine that sets the new field to corresponding values to the existing field
3 - validate the values
4 - create a routine that blanks out the existing field
5 - change the type of existing field to option, and run a routine to transfer the values from the new field
or variations of this, there's more than one way to do it.
<edit> like Harry says a "switcheroo"</edit>
0 -
I have never tried to do a report like that, so I think I'll just leave it as is. Not that important anyway. I was only going to make the drop down box so people cannot type the wrong thing.
Currently it only allows two characters, but if someone types it wrong then it won't show up on reports, or if someone types in lowercase when we're using only uppercase.
Now that I think about it, they might not like only being able to choose certain things. If I'm not working here in the future they won't know how to change things.0 -
Currently it only allows two characters, but if someone types it wrong then it won't show up on reports, or if someone types in lowercase when we're using only uppercase.
Well next time - or perhaps when you have free time.
It's not that hard to do. if you think about.
So Use Option type in the future if you want to assign set choices
or CODE type if you have entry field you want uppercase always.
Not as good as actual "option" - but on the form if you edit the property ValuesAllowed for that field
to PB;PC;PL;SP then that's all you can type into that field.
or to force Uppercase:
Property->CharAllowed
Use this property to set the range of characters you will allow the user to enter into this field or text box.
For example, if you want users to type only uppercase letters in this field, enter AZ
Your report would be something like this.
Create A new field in the item table called Catalog2 - type option with options ( ,PB,PC,PL,SP)
Dataitem - ITEM
OnAfterGetRecord()
IF Catalog = 'PB' THEN Catalog2 := Catalog2::PB;
IF Catalog = 'PC' THEN Catalog2 := Catalog2::PC;
IF Catalog = 'PL' THEN Catalog2 := Catalog2::PL;
IF Catalog = 'SP' THEN Catalog2 := Catalog2::SP;
MODIFY;
run the report - physically view that the new field has values so you don't need a Xanax.
Now you have the values in both places.
then you can use the same report just comment out the "if" code above using //
Add Clear(Catalog);
run again. now all your calalog values are clear. remove field from form so you don't get an error later on when you try to open the item card (not a hard fix if you don't do this).
Now edit the Catalog Field - change it to type option Just like the Catalog2 field.
Edit the report to copy the values from Catalog2 back to Catalog.
a) or just delete catalog and rename catalog2 to catalog. Fix desired reports.
b) now if copies to orig field then clear cat2 & delete field.
basically, in,a,round,about,way.0 -
Wow! That is easy. Actually, that knowledge might come in handy for other stuff I might need to do in the future, so good to know.0
-
Use the power of reports & modify wisely!
YOu can always filter with a report. so you can make some test items and filter on those to make sure what you doing is working correctly. A seperated test envion is always good.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