SBX - Search With Button

SBX - Forum Post Title

Error - Variable was expected

Microsoft Dynamics NAV Forum

jsshivalik asked a question on 12 Feb 2019 3:37 AM
My Badges

Question Status

Verified

Hi

  In case of Charge Item i am getting error in If Condition . SCMLine Datatype is Record of Sales Cr memo Line

IF (SCMLine.Type = SCMLine.Type :: Item) OR (SCMLine.Type = SCMLine.Type :: 'Charge (Item)') THEN BEGIN

Thanks

Reply
AlexDen responded on 12 Feb 2019 7:30 AM
My Badges
Verified Answer

Hi,

You have to use quotes instead of an apostrophe:

IF (SCMLine.Type = SCMLine.Type::Item) OR (SCMLine.Type = SCMLine.Type::"Charge (Item)") THEN BEGIN

Reply
Teddy Herryanto responded on 12 Feb 2019 2:11 PM
My Badges
Verified Answer

Use double quote (") on charge (item).

IF (SCMLine.Type = SCMLine.Type::Item) OR (SCMLine.Type = SCMLine.Type ::"Charge (Item)") THEN BEGIN

Reply
Suresh Kulla responded on 12 Feb 2019 2:19 PM
Verified Answer

You need use double quotes

Type::"Charge (Item)" or use the IN operation like this

IF SCMLine.Type IN [SCMLine.Type::Item, SCMLine.Type::"Charge (Item)"] THEN BEGIN

Reply
AlexDen responded on 12 Feb 2019 7:30 AM
My Badges
Verified Answer

Hi,

You have to use quotes instead of an apostrophe:

IF (SCMLine.Type = SCMLine.Type::Item) OR (SCMLine.Type = SCMLine.Type::"Charge (Item)") THEN BEGIN

Reply
Teddy Herryanto responded on 12 Feb 2019 2:11 PM
My Badges
Verified Answer

Use double quote (") on charge (item).

IF (SCMLine.Type = SCMLine.Type::Item) OR (SCMLine.Type = SCMLine.Type ::"Charge (Item)") THEN BEGIN

Reply
Suresh Kulla responded on 12 Feb 2019 2:19 PM
Verified Answer

You need use double quotes

Type::"Charge (Item)" or use the IN operation like this

IF SCMLine.Type IN [SCMLine.Type::Item, SCMLine.Type::"Charge (Item)"] THEN BEGIN

Reply

SBX - Two Col Forum

SBX - Migrated JS