what wrong in the code

mohmd
Member Posts: 51
iam doing a report named sales
this report read from the item ledger entry table
i want to right a code trlatrd to grouping
because my aim in this report is " if i want the item category code or product group code the report gibe me the total Qty & amount"
step 1 : new report and fill the related fields
step2: open the request page and select grouping
step 3: cal global : grouping as option
groupingvalue as option
valueentryrec as record
the code : If grouping := category then
groupingvalue:= valueentryrec."item category code"
else
groupingvalue:=valueentryrec."product group code"
when i save, an eror ocured

this report read from the item ledger entry table
i want to right a code trlatrd to grouping
because my aim in this report is " if i want the item category code or product group code the report gibe me the total Qty & amount"
step 1 : new report and fill the related fields
step2: open the request page and select grouping
step 3: cal global : grouping as option
groupingvalue as option
valueentryrec as record
the code : If grouping := category then
groupingvalue:= valueentryrec."item category code"
else
groupingvalue:=valueentryrec."product group code"
when i save, an eror ocured

0
Best Answer
-
Yes as ftornero suggested it should be
IF grouping = gruoping::Item
OR
IF grouping = 1(An INteger Value based n the option sequence)Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/5
Answers
-
are item category code and product group code fields in value entry table or options of any field?
if options of any field then your code should look like
If grouping = category then
groupingvalue:= valueentryrec.<FIELD>::"item category code"
else
groupingvalue:=valueentryrec.<FIELD>::"product group code";0 -
The problema is with this sentence:
IF grouping::Item
Must be:
IF grouping = gruoping::Item
0 -
There is also other problem, THEN is missing in the IF, so the right sentence would be:
IF grouping = grouping::Item THEN
0 -
Yes as ftornero suggested it should be
IF grouping = gruoping::Item
OR
IF grouping = 1(An INteger Value based n the option sequence)Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/5 -
The error you are getting is because the "grouping" variable is not an "Option" type variable - you have probably set it as CODE or something else. There are other issues too though (as mentioned by others)...
- You do not have a boolean statement for the IF - it's just a value. You need to compare it to something. P.S. Please compare to the actual Option value and not an Integer constant
- There is a missing THEN
0 -
thx all
0 -
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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