fieldref with type option.

sandy_bsil
Member Posts: 40
Hi All,
I am using fieldref to print those fields which are not blank on the report. But the problem is when the field type is option, I am not able to get the current option value selected.
For Ex.
FieldValue := FORMAT(FieldRef1.VALUE);
CaptionText := FORMAT(FieldRef1.CAPTION);
FieldType := FORMAT(FieldRef1.TYPE);
IF ((FieldType = FORMAT('Option')) THEN
IF (FORMAT(FieldRef1.VALUE) > FORMAT('0')) THEN BEGIN
DisplayText1 := CaptionText + ': ' FieldValue;
......
end;
Now this FieldValue will always have the integer value (0,1,2,...).But how to get the option value in string that is currently selected.
](*,)
regards
Sandy.
I am using fieldref to print those fields which are not blank on the report. But the problem is when the field type is option, I am not able to get the current option value selected.
For Ex.
FieldValue := FORMAT(FieldRef1.VALUE);
CaptionText := FORMAT(FieldRef1.CAPTION);
FieldType := FORMAT(FieldRef1.TYPE);
IF ((FieldType = FORMAT('Option')) THEN
IF (FORMAT(FieldRef1.VALUE) > FORMAT('0')) THEN BEGIN
DisplayText1 := CaptionText + ': ' FieldValue;
......
end;
Now this FieldValue will always have the integer value (0,1,2,...).But how to get the option value in string that is currently selected.
](*,)
regards
Sandy.
Sandeep B
0
Comments
-
Try to use FieldRef.OPTIONCAPTION and SELECTSTR together to get the caption for option with no. X.
OptionCaption := SELECTSTR(MyOptionValue,FieldRef.OPTIONCAPTION);
0 -
kine wrote:Try to use FieldRef.OPTIONCAPTION and SELECTSTR together to get the caption for option with no. X.
OptionCaption := SELECTSTR(MyOptionValue,FieldRef.OPTIONCAPTION);
Thanx.. it works.. but there is some problem..
Case 1.
Optionvalue = 3
OptionCaption = ,EN ISO 17292/ASME B16.34 (BS 5351),EN ISO 17292(BS-5351) & BS 6364,API-608,API 6D/ASME B16.34
OptionStr = EN ISO 17292(BS-5351) & BS 6364
Case 2.
Optionvalue = 2
OptionCaption = ,BS EN 12266 (BS 6755),API 598,ANSI 16.34,API6D,ANSI FCI 70.2
OptionStr = API 598
As you can see in case 1 its coming wrong but in case 2 its correct. So any idea why this is happening..
regards
Sandy.Sandeep B0 -
Check the caption string on the table directly and look for empty values in it. May be they are the problems. Try to use the OptionName instead Captions...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