Script components can be used in business rules and templates. You create a script component from the System View. You can also create a script component from within the Rule or Template Designer while you are designing a business rule or template.
To design a script component:
Select File, New, Script Component.
Expand the Financial Management, Planning, or Essbase application type, the application, and the calculation type, plan type, or database.
Right-click Scripts, and select New.
Note: | You can also create a script component from within a business rule or template. |
Enter a name, application type, and application for the script. Then do one of the following tasks:
Financial Management users only: If you are creating a Financial Management script, enter the calculation type.
Planning users only: If you are creating a Planning script, enter the plan type.
Essbase users only: If you are creating an Essbase script, enter the database.
In the Component Designer, use the icons to design the script component. Financial Management scripts must be in Visual Basic; Planning and Essbase scripts must be in Essbase.
Note: | Unlike rules, templates, and other components, when you open a script, you cannot view it in a graphical format (as a flow chart). You can only view it in script format. |
Click the Insert a function and its parameters icon to insert a function. See Working with Functions.
Click the Insert members selected from a dimension icon to insert a member. See Working with Members.
Click the Insert a variable icon to insert a variable. See Working with Variables.
Note: | Visual Basic scripts must be self-contained. You cannot reference replacement or execution variables defined for a ruleset in the script. If you need to use a variable in a script, you must declare it within the script component. |
Planning users only: Click Insert smartlists to insert a Smart List. See Working with Smart Lists (Planning Users Only).
Click the Find icon to find a text string in the script. See Searching for and Replacing a Text String in a Business Rule Script (Financial Management, Planning, and Essbase Block Storage Application Users Only).
Click the Find and Replace icon to find and replace a text string in the script. See Searching for and Replacing a Text String in a Business Rule Script (Financial Management, Planning, and Essbase Block Storage Application Users Only).
On Properties, complete these steps:
When you create a script component, Shared is not selectable. When you drag the script component and drop it into the flow chart of a rule or template, Shared is selected by default. To create a copy of the script component within the rule or template instead, clear Shared.
Optional: Edit the script's name by entering a new one of up to 50 characters. (The name defaults from the New Script dialog.)
Enter a caption for the script. The caption is displayed below the script in the Rule Designer and Template Designer flow charts.
Enter comments for the script. For example, you may want to tell users what the script should be used for.
Financial Management users creating a script component for a business rule only: Select Enable Logging so, if the script has log text, it is included in the log file when the rule is launched. You can enable logging for rules, rulesets, and components. However, you specify what log text to include, if any, with the business rule's formula statements.
Note: | If logging is not enabled for a ruleset, but is enabled for a rule and component that belong to the ruleset, no log file is created because the log setting for the ruleset overrides the settings for the rule and component. |
Financial Management users only: Select Enable Timer so the time taken to process the script is recorded in the log file when the rule is launched. You can enable the timer for rules, rulesets, and components. The process time is included in the log file for every object whose timer is enabled. For example, if you have a rule whose timer is enabled and the rule contains three scripts whose timers are enabled, the time taken to process the rule, and each script in the rule, is recorded.
Financial Management users only: Select Embedded to embed the contents of the script component inside any rules using it when generating the Visual Basic script.
Financial Management users only: In Parameters, enter script parameters.
Financial Management, Planning, and Essbase block storage users only: On Script, enter a caption for the script component.
Users creating a script component for a template only: Select Use Design Prompt if you want to use a design time prompt in the script component. Then in the condition grid, define a condition for the design time prompt by performing these tasks:
Users creating a script component for a business rule only: On Usages, you can view the rules that use the script component.
Note: | You cannot edit any of the information on this tab. |