Problem with @return

Hi,In a computed field called fbadstk i have put below formula.This needs to get the result of Total qty - Good stk qty

if it gets a negative value it needs to throw a prompt and place 0 other wise the result of subtraction.It’s not working.I beleive code is incomplete.pls help

a:=@If(fqty1=“” | fgud1=“”;0;fqty1-fgud1);

@If(a<0;@Do(@Return(@Prompt([ok];“Validate”;“Gud stk shd be <than totqty”)));a);

a

Subject: Problem with @return

Hi Gowri,

I checked the same, I have made U3 field as computed.

This code is working fine for me… Let me know ur feedback.

a:=U1-U2;

@If(a<0;@Do(@Return(@Prompt([ok];“vali”;“Validated”));0);“”)

Piyush