RenameFormula

You can use the RenameFormula function to assign a new name or version to a formula.

When to use

You can use this function to:

  • Rename formulas with new identifiers.
  • Increment formula versions during development.

When not to use

You cannot use this function when creating a copy with a new name. Use ObjectSaveAs instead.

Syntax

object RenameFormula(string newCode, string newVersion)

Parameters

Parameter Type Required Description
newCode string Yes The new name or code for the formula.
Note: You can use empty string "" to keep the current formula name unchanged.
newVersion string Yes The new version for the formula.
Note: 
  • Use "+" to automatically increase the version by 1.
  • You can use empty string "" to keep current version unchanged.

Return Value

The application returns a value greater than zero (0) if the operation is successful.

Impact

  • The formula key is updated with the new code or version.
  • The related objects might require reference updates.

Prerequisites

The new formula code must be unique when changing the formula name.

Examples

Example 1
Rename formula with new code and version.
RenameFormula("PIZZA_SAUCE","004");
Description
The new name PIZZA_SAUCE and version 004 is assigned to current workflow formula.
Example 2
Increment Version Only
RenameFormula("", "+");
Description

The formula name remains same but the version is increased by 1.

This example will be applicable only for version supported symbols like Formula, Specification, Project etc.