Case Syntax Error

NavNewbie92NavNewbie92 Posts: 2Member
Hi Everyone I'm new to the Navision world ;
Can you help me please I'm getting an error syntax in Navision object designer :smile:
Item - OnAfterGetRecord()

CASE (GroupItem) OF (Item."Item Disc. Group")
IF (Item.Item Disc. Group = 'ACCESS') THEN GroupItem := STRSUBSTNO(Text50004)
IF (Item.Item Disc. Group = 'COFFEEM') THEN GroupItem := STRSUBSTNO(Text50005)
IF (Item.Item Disc. Group = 'DI-WA') THEN GroupItem := STRSUBSTNO(Text50006);
END
//N.S
I like to add some constant to display a text other than the Item Disc. Group one but I'm getting an error syntax.

Thanks for your help
Kind Regards

Answers

  • vaprogvaprog Posts: 924Member
  • lyngelynge Posts: 65Member
    CASE Item."Item Disc. Group" OF
    'ACCESS': GroupItem := Text50004;
    'COFFEEM': GroupItem := Text50005;
    'DI-WA': GroupItem := Text50006;
    END;
  • NavNewbie92NavNewbie92 Posts: 2Member
    Hi Lynge thanks for your answer.
    I tried your code but I got the same syntax error.
    I don't know what's the problem.
  • lubostlubost Posts: 555Member
    What your code looks like now?
Sign In or Register to comment.