success()
Last updated 17/09/2024
Example
The following code calculates the total cost and sets it to the Total field, then returns a successful result.
CalculateTotal
function CalculateTotal(five: Five, context: any, result: FiveError) : FiveErrorSuccess {
if (five.actionID() === 'Buys') {
five.field.Total = five.field.Quantity * five.field.Price + five.field.Fees;
} else {
five.field.Total = five.field.Quantity * five.field.Price - five.field.Fees;
}
return five.success();
}
CalculateTotal
function CalculateTotal(five, context, result) {
if (five.actionID() === 'Buys') {
five.field.Total = five.field.Quantity * five.field.Price + five.field.Fees;
} else {
five.field.Total = five.field.Quantity * five.field.Price - five.field.Fees;
}
return five.success();
}