Calculate the product (multiply) of two 2 fields to create a total in a third field
This is useful in situations such as calculating the value (or checking the validity) of an invoice line.
Here is the code to add to a field to multiply two fields. Create a script rule referencing all three fields. In the following example the ‘LineTotal’ field must be read/write.
Context.Field(“LineTotal").Value = (double)Context.Field(“Qty").Value * (double)Context.Field(“UnitCost").Value;
Context.ErrorMessage = “Could not calculate total";
Context.CheckSucceeded = true;