Bluestep JS Documentation
    Preparing search index...

    Class FormulaScheduler

    This assists in configuring an On-Demand Formula to be ran.

    Index

    Constructors

    Methods

    • This will not allow the formula to be ran after the provided time. If omitted, the formula will run as soon as it can after the time it was scheduled. This should be utilized when running frequent routine calculations. Note, the expried by should be after (greater than) the start or the formula will not run.

      Parameters

      Returns FormulaScheduler

    • This parameter optionally provides a message to the on-demand formula for the execution currently being scheduled. It will be available in the on-demand formula as a String variable named message.

      Parameters

      • message: string

      Returns FormulaScheduler

    • Determines when the formula will run. If omitted, the formula will be scheduled immediately after the current transaction completes (or immediately if there is no transaction).

      Parameters

      Returns FormulaScheduler

    • TODO (Copied from relate, needs to be updated for bsjs) Tells the On-Demand to run. The result of the start() function is a String value. If the result is null then the formula has been scheduled successfully. If the Result is not null, then it will contain an error message explaining why the operation was not successful. For example, if the when parameter is a DateTime that is in the past then the message will indicate that on-demand formulas cannot be scheduled for times that are past. Other messages are related to complying with the configuration of the on-demand formula. For instance, if the on-demand formula is configured to run in only one particular unit and the record is not in that unit, or if the formula requires certain categories that are not present the result message will explain this. Especially important to remember is that, if the formula has a primary form then the runFormula(...) function must be called from a System field belonging to an entry of that form. The record and form entry that the System field belongs to become the context of the on-demand formula, its "current record" and "current entry", when executing.

      Final note: If the formula calling the start() function is part of a transaction (data is being modified) and the transaction is rolled back due to an error, then the on-demand formula will not be scheduled even though no error message was given as the a result of calling this function. This is because all changes, including the scheduling of the on-demand formula, are rolled back.

      Returns String