what wrong in the code

mohmdmohmd 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

1iqbvg1f0hgu.png

Best Answer

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    edited 2016-10-25
    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";
  • ftorneroftornero Member Posts: 524
    The problema is with this sentence:

    IF grouping::Item

    Must be:

    IF grouping = gruoping::Item
  • ftorneroftornero Member Posts: 524
    There is also other problem, THEN is missing in the IF, so the right sentence would be:

    IF grouping = grouping::Item THEN
  • KishormKishorm Member Posts: 921
    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
  • mohmdmohmd Member Posts: 51
    thx all
  • krikikriki Member, Moderator Posts: 9,112
    [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!


Sign In or Register to comment.