Text to Option

sarmig
Member Posts: 89
Hello.
I was wandering if there's a way to convert text into option
I already tried the EVALUATE function but it didn't work...
Thanks in advance
I was wandering if there's a way to convert text into option
I already tried the EVALUATE function but it didn't work...
Thanks in advance
0
Comments
-
sarmig wrote:I already tried the EVALUATE function but it didn't work...
IF NOT EVALUATE("Document Type",DocumentTypeText) THEN MESSAGE('Type is invalid!');
The text you feed to EVALUATE may be anything you can enter in an option control on a form.0 -
Like this:
RecItem.RESET; RecItem.SETRANGE("No.", "No. Equipamento"); IF RecItem.FINDFIRST THEN BEGIN IF CONFIRM('Será introduzido este dado na ficha do Equipamento. Pretende continuar?') THEN BEGIN IF EVALUATE(Placa, vPlaca) THEN RecItem."Tipo Placa" := Rec.Placa::vPlaca; RecItem.MODIFY; END END;
The text I want to input in the option field (Tipo Placa) in the Item table is in the variable vPlaca...0 -
try this example
Test := 'Purchase';
EVALUATE(OptionText,Test);
Message('Text : %1',Test);
Message('Option : %1',OptionText);
Where optiontext is a option type variable with option " ,Sales,Purchase,Transfer"0 -
and please don't use:
IF CONFIRM('Será introduzido este dado na ficha do Equipamento. Pretende continuar?') THEN BEGIN
but instead useTextconstants txtQ := PTG="Será introduzido este dado na ficha do Equipamento.";enu="This data will be introduced in the form of equipment" txtConfirm := PTG='%1 Pretende continuar?'; ENU='%1 Continue?' code IF CONFIRM(strsubstno(txtconfirm,txtq)) THEN BEGIN OR IF CONFIRM(txtconfirm,true,txtq) then begin
0 -
Thanks!
I got it!
Here's the final version:RecItem.RESET; RecItem.SETRANGE("No.", "No. Equipamento"); IF RecItem.FINDFIRST THEN BEGIN IF CONFIRM('Será introduzido este dado na ficha do Equipamento. Pretende continuar?') THEN BEGIN IF EVALUATE(RecItem."Tipo Placa", vPlaca) THEN BEGIN RecItem.MODIFY; END; END; END;
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