You cannot enter 'some text here' in Integer

TheDoubleH
Member Posts: 67
I am relatively new to the RTC, and have run into a weird error.
I have some code, that finds the value of different fields in a table. When I run the report in CLassic, it works just like it is supposed to - but when running in it RTC (using a layout) I am getting an error: "You cannot enter 'Profit=Price-Cost' in Integer."
it seems like the RTC thinks it's smart enough to tell us what tyoe of data based on the first record?
I have some code, that finds the value of different fields in a table. When I run the report in CLassic, it works just like it is supposed to - but when running in it RTC (using a layout) I am getting an error: "You cannot enter 'Profit=Price-Cost' in Integer."
it seems like the RTC thinks it's smart enough to tell us what tyoe of data based on the first record?
FieldValueText := FORMAT(ItemFieldRef.VALUE); CASE Field.Type OF Field.Type::Decimal : BEGIN IF FieldValueText = '0' THEN FieldValueText := ''; END; Field.Type::Integer : BEGIN IF FieldValueText = '0' THEN FieldValueText := ''; END; Field.Type::Option : BEGIN EVALUATE(OptionNo,FORMAT(ItemFieldRef.VALUE)); FieldValueText := SELECTSTR(OptionNo + 1,ItemFieldRef.OPTIONCAPTION); END; END;
0
Answers
-
Turns out that the geniuses at Microsoft thought that the excecution of a command does not need to have the same behaviour if executed in classic versus RTC. #-o
FieldRef.VALUE for a option field in Classic returns an integer
FieldRef.VALUE for a option field in RTC returns the verbose optionIF ISSERVICETIER THEN BEGIN FieldValueText := FORMAT(ItemFieldRef.VALUE); END ELSE BEGIN EVALUATE(OptionNo,FORMAT(ItemFieldRef.VALUE)); FieldValueText := SELECTSTR(OptionNo + 1,ItemFieldRef.OPTIONCAPTION); 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