Subtraction of field values

Hi,

I want to create a new field in a Document Definition and set its value equal to a subtraction of 2 other fields in the Document Definition. I know you can create Calculate Sum rules, but is there a script rule which could be used to subtract 2 values and assign it to a field?

 

Was this article helpful?

0 out of 0 found this helpful

Comments

3 comments

  • Avatar
    Scott Chau

    There is not a built in rule to subtract.  You will need to create a custom script.  Something like me.field("field1").value - me.field("field2).value = me.field("field3").value

    1
  • Avatar
    Louise Elliot

    Hi Scott,

    Thanks for your response. I've tried a similar script but I get the following error: 'object doesn't support this property or method'. I've also tried without the Value and it just concatenates the strings together rather than adding the values together. Any thoughts?

    Thanks,

    0
  • Avatar
    Scott Chau

    Where are you putting the rule and what programing language are you using?

    0

Please sign in to leave a comment.