I am having an issue with auto populating a text field based on the selection from a drop down box. Whilst the script works in the first instance, if I go back and change my selection the result/calculations don't update based on the new selection.
I have used the following script to auto populate a text field (titled 'stndwatt') based off the drop down menu selection. The drop down field is titled 'ProductLineOne':
var v = this.getField("ProductLineOne").value;
if (v=="3000K T10 (Tube)") event.value = "21";
else if (v=="4000K T10 (Tube)") event.value = "21";
else if (v=="5000K T10 (Tube)") event.value = "21";
else if (v=="6000K T10 (Tube)") event.value = "21";
else if (v=="HBZ (100W Bay)") event.value = "100";
else if (v=="HBZ (150W Bay)") event.value = "150";
else if (v=="HBZ (200W Bay)") event.value = "200";
The text field ('stndwatt') is actually hidden and is purely required to form part of other subsequent calculations - I don't know if this is a factor?
If you could please advise what I can do to make the field update when a new selection is made from the drop down box it would be very much appreciated!
I'm just a beginner so please keep this in mind
You need to make sure that the field calculation order is correct. Seeing
as this is a calculated field that is used in other calculations you should
make sure it's higher on the list compared to the fields that use its value
for their own calculation, ie that its calculated before them.
You can set this order in Form Edit mode, via Tasks - Other Tasks - Set
Field Calculation Order.
Of course! Thank you so much for your help - really saved me