Script - how to set a constant value for a var script? also some equation questions too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 04:15 AM
Hi,
I'm not entirely sure where to look on why this script is not working. I have very limited knowledge on scripting, but will get some education very soon, yet I have a deadline coming up for this. Hope someone can help.
RED BOX: I'm trying to set a constant value for each VAR I created. Is this done correctly? or it needs some other scripting?
GREEN BOX: The value which will be input manually in a single text field, will always be divided by 1024, so I'm trying to come up with a VAR for it. Can I script it like this?
BLUE BOX: here, I placed the "equation" in the script, so the output will be in the 'price' variable.
Maybe I'm doing the entire script too simple, and apparently wrong.
Please help.
Thanks!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 05:20 AM
Hi Albert,
You might be facing this issue because of the following line of your code.
if(env==dev&&crit==l .....)
I believe it should be as follows.
if(env=='dev'&&crit=='l' .....)
Hope this helps!
Thanks,
Archana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 05:30 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 05:35 AM
May I know what you meant by sustitutes?
Also, what all are the outputs of env?
Are they dev, prod, ---?
If yes, use the following as suggested earlier.
if(env=='dev'&&crit=='l' .....)
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 05:43 AM
Hi Archana.
Sorry for the non-developer description. Substitutes - I was referring to var dev = 'Development' ,etc.
To take one more step further on your suggestion, I completely deleted those var dev, var test, var pp and var prod from the script, and used the original values (Development, Test, Pre-production and Production) directly in the if statement like I posted in my prior reply.
Yet the script still didn't work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 05:53 AM
Please let me know the field types of the following fields.
whatenvironmentforpricing
criticalitytypeforpricing