Using the SET action command to insert data

You can use the SET action command in a rule set to 'insert' data, or force certain fields to take specific values whilst data is entered.

For example, during Ledger Entry (LEN) you could SET a particular ledger analysis code to a specific value, or in Chart of Accounts (COA) you could SET the short heading to take the same value as that entered for the account code. These separate examples are as shown in the following table:

Command Value 1 Operator Value 2 Result
SET Ledger Analysis 1 = N1C0 Regardless of what the operator enters in Ledger Analysis 1, the code N1C0 will be inserted.
SET Short Heading = Account Code Regardless of what the operator enters in the Short Heading field, it will be given the same value as the Account Code.
Note:  When using the SET action command in a rule set to insert line data for Ledger Entry and/or Ledger Import, you must specify one of a set of special call points in the event profile, otherwise the SET action is ineffective during data entry/import.

Which fields can be inserted with the SET action command?

When defining a rule set to insert data with the SET action command, most of the fields that can be checked by a business rule can also be inserted or changed by the business rule. However, certain data items in each function cannot be changed or inserted with the SET command.

Fields that are unique keys to a record must be created during data entry. Such fields cannot be set by a business rule, even though they can be checked for validity by the business rule. A few examples of such unique key fields in static data maintenance are: Account Code, Asset Code, Asset Subcode, Bank Code, and Bank Subcode; all of which must be created by the operator during data entry. In another example, Ledger Entry, the Journal Number cannot be set by a business rule, because it is a unique numeric key to the journal created by SunSystems during posting.

Note:  If you need to set a value for a data item, you must ensure that the value is allowed to be entered on the transaction for the data item, for the appropriate function. For example, for the Ledger Entry function, if you want to set a ledger analysis dimension code you must ensure that the code exists, and that the analysis dimension is allowed to be entered on the relevant journal type.