You can create rules in a text editor such as Notepad ++. Rules files can be in an ASCII format that supports multibyte character sets (MBCS), or a file encoded with Unicode format, using Little Endian byte ordering. You use Visual Basic Script functions and Financial Management functions in rules files. By default, rules files use the RLE file extension.
You can include all types of Financial Management rules in any order in the rules file. Table 33 lists the basic syntax to define each routine.
Table 33. Rules Routines
Rule Routine | Syntax |
---|---|
Sub Calculate | |
Sub Translate | |
Sub Allocate | |
Sub Input | |
Sub NoInput | |
Sub Consolidate | |
Sub Dynamic | |
Sub Transactions | |
Sub EquityPickup | Sub EquityPickUp() ’Type your Equity Pickup rule here. End Sub |
Sub OnDemand | Sub OnDemand_<ruleName> ’Type your OnDemand rule here. End Sub |
The following section shows a sample Equity Pickup Rules section. To calculate Equity Pickup, the application administrator must create a new section in the Rules file named Sub EquityPickUp, where EPU calculations are defined. The default Point of View when the section is run is as follows:
Current Scenario, Year, and Period
Entity: Owner of the pair processed
Value: Entity currency
Sub EquityPickUp() Owner = Hs.Entity.Member Owned = Hs.Entity.Owned OwnerDefaultCurrency = HS.Entity.DefCurrency("") lPown = Hs.GetCell("E#" & Owned & ".I#" & Owner & ".V#[None].A#[Shares%Owned].C1#[None].C2#[None].C3#[None].C4#[None]") Hs.Clear "A#IncomeFromSubsidiary.I#" & Owned Hs.Exp "A#IncomeFromSubsidiary.I#" & Owned & " = E#" & Owned & ".V#" & OwnerDefaultCurrency & ".A#NetIncome.I#[ICP Top] *" & lPown End Sub
To run on-demand rules from data forms, the administrator must create a new section in the Rules file named Sub OnDemand, where OnDemand rules are defined.
Sub OnDemand_Calculation HS.Exp "A#CogsTP=15424" HS.Exp "A#Admex=32452" End Sub
Note that all HS functions that can be used in Sub Calculate (but no others) can also be used in On Demand rules. Also note that unlike Sub Calculate, data previously written to an IsCalculated data-point is not cleared when an On-demand rule is run.