Define and use variable in custom calculation
The form I'm working on has 30-some row with multiple similar calculations per row, so I'm hoping to make life easier for myself. Each row has its own prefix for the field names and the rows contain (mostly) the same fields.
I have the following simple calculation:
if (getField("rowSomething-FieldName").value=="Yes") event.value = getField("rowSomething-Number").value * getField("rowSomething-Price").value;
if (getField("rowSomething-FieldName").value!="Yes") event.value = "0";
rowSomething-FieldName is a checkbox, rowSomething-Number contains a quantity and rowSomething-Price contains ... a price.
What I'd like to do is declare a variable that equals rowSomething and then call that in the calculation. That way, when I copy & paste the code, I only need to edit the row's name once instead of 4 times. I'm no coder, however, so I can't get it done and most examples I've found are much more complex than this.
