Jobs for formula tasks

A Formula task in the Batch Manager runs a specified formula at a set interval. To use different conditions in your formula on different dates, you can set up jobs for a Formula task in the Billing Calendar.

The conditions that you can enter for a Formula job in the Billing Calendar are different from the conditions for the other types of jobs. For all other jobs, the conditions are the same as the task parameters. For a Formula task, the only parameter is the formula itself. Instead of setting the values of the task parameters, the conditions you enter for a Formula job can be used in the formula itself.

You can specify values for up to five string conditions, three integer conditions, two date conditions, and two double conditions. When you add Formula jobs, the conditions are entered in the Scheduled Dates grid, in columns labeled First String, Second String, and so on. When you edit an existing Formula job, the conditions are displayed in fields in the Billing Calendar Job InfoViewer.

You can also use the Content Manager to change the display names of the condition fields, or to hide any fields that you don't want to use. The page can be found in the Content Manager under Billing > Setup > Billing Calendar > Add Jobs > Add Formula Task Job.

To use these conditions in your formula, first use this code snippet to load them into a structure called FormulaTaskCondition:

Dim condition as Hansen.Core.FormulaTaskCondition
Condition = task.GetCondition(as Hansen.Core.FormulaTaskCondition)()

You can then access your conditions by calling the properties of the FormulaTaskCondition structure. The string properties are called FirstString through FifthString; the integers are FirstInt through ThirdInt; the dates are FirstDate and SecondDate; and the doubles are FirstDouble and SecondDouble. For example, to access your first string condition you would use condition.FirstString.