Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

help with if statement

Avatar

Level 7

Hi, how I can make this script to work?

Quantity, Discount and Amount are numeric fields.

if (Quantity.rawValue>=5 && Quantity.rawValue<=14);

{

Discount.rawValue=Amount.rawValue*0.05;

}

else if (Quantity.rawValue>=15 && Quantity.rawValue<=29);

{

Discount.rawValue=Amount.rawValue*0.10;

}

else if (Quantity.rawValue>=30 && Quantity.rawValue<=59)

{

Discount.rawValue=Amount.rawValue*0.15;

}

else if (Quantity.rawValue>=60 && Quantity.rawValue<=19)

{

Discount.rawValue=Amount.rawValue*0.20;

}

1 Reply

Avatar

Former Community Member

Hi,

Remove the ; at the end of first two conditions. Then things should be fine. If not, mail me the form at kvdvijaykumar@gmail.com

Thanks,

VJ