You need to sign in to do that
Don't have an account?
tock
</script>
Java Novice - stuck on 'if stament'
Hello,
I have this bit of java i wrote, for an s-control, however the if (stage == 'Needs Analysis') isn't going through when i know it should as the value of stage is definitely 'Needs Analysis'. The {!Opportunity.StageName} value is coming from a selection box, ifthis makes a difference. any ideas or blatent mistakes here?
I also know the {location = "http://webaddress.com}";} works fine.
<html>
<script>
var stage = {!Opportunity.StageName}
var stage = {!Opportunity.StageName}
if (stage == 'Needs Analysis')
{location = "http://webaddress.com}";}
</script>
</html>
Common oversight, you need quotes for variable assignment and semicolon at the end of every line in JavaScript. Code corrected is included.Code: