Expressions
An expression is an important component of IGFC that is used by rules to provide value during generation of an output business document. For accounting framework integration, an expression is also used by journal entry templates.
Expressions are created per type of input business document that are processed.
There are five types of expressions: a formula, a search template, a text, a date, and REST API.
Formula-type expression
A formula expression is an arithmetic computation that uses the addition, subtraction, multiplication, or division operations.
The types of operands available are:
- Fixed numeric value
- Attribute of a master data or transactional document with a numeric data type
- An expression that returns a numeric value, excluding expressions of type REST API.
A formula expression for a sales order business document to get the total amount in a sales order line:
SOLineTotalAmount = SOLine.unitPrice * SOLine.quantity
Name of the expression | SOLineTotalAmount |
Operand 1 UnitPrice attribute of the SalesOrderLine BOD registration |
SOLine.unitPrice |
Arithmetic operator | * |
Operand 2 Quantity attribute of the SalesOrderLine BOD registration |
SOLine.quantity |
Search template-type expression
This type of expression is created to return master data or custom master data information.
See Search template.
These details are required in defining an expression that uses a search template:
- Source master data - This is the search name of the registered master data document or custom master data.
- Source search template - This is the name of the particular search template of the selected master data document or custom master data that will return the desired information.
- Source entity - This is the entity to which the source master data is associated. This detail is required only for search template-type expressions with master data business document as the source master data
- Arguments - A value should be assigned to each parameter defined in the search template. The data types of the value and the parameter should match.
The types of values that can be assigned as an argument are:
- Fixed value - A numeric or text value.
- Attribute of a master data or transactional document - The value is determined from the input business document.
- Rule setup value - Value of a parameter from the running rule.
- Another expression, excluding expressions of type REST API - See section on Nested Expression.
- For expression of system-defined search-template, these arguments are available:
Argument | System-defined search template | Variable | Value |
---|---|---|---|
Transactional Document | getDimensionCodeList getDimensionCodeListByTransType getJournalHeaderUserField getJournalLineUserField |
xsdName | All registered transactional documents |
Transaction Type | getDimensionCodeListByTransType | transType | Transaction Types used in Dimension Code Assignments |
Journal User Field | getJournalHeaderUserField getJournalLineUserField |
userFieldSetName | Name of Journal User Fields sets |
Accounting Book | getDimensionCodeList getDimensionCodeListByTransType getAcquirerAccountNumber getAcquirerAccountNumberList getAcquirerAcctChart getCurrencyRateType getTargetAccountNumberBySourceAcctChart getTargetAccountNumbeListBySourceAcctChart getTargetAccChartBySourceAcctChart getTargetCurrencyRateTypeBySourceAcctChart |
accBook, acquireeAccBook or acquirerAccBook | ID of AccountingBook documents |
Accounting Chart | getDimensionCodeListByTransType getDimensionCodeList getTargetAccountNumberBySourceAcctChart getTargetAccountNumberListBySourceAcctChart getTargetAccChartBySourceAcctChart getTargetCurrencyRateTypeBySourceAcctChart |
accChart or acquireeAcctChart | ID of AccountingChart documents |
Account | getDimensionCodeList getDimensionCodeListByTransType getAcquirerAccountNumber getTargetAccountNumberBySourceAcctChart getTargetAccountNumbeListBySourceAcctChart |
accNumber or acquireeAcctNum | ID of ChartOfAccounts documents |
Accounting Journal | getCurrencyRateType getTargetCurrencyRateTypeBySourceAcctChart |
acquireeAcJourn | ID of Accounting Journal documents |
An expression for a sales order business document that uses a FinancialCalendar search template in retrieving the appropriate PeriodID attribute value:
Name of the expression | SOAcctgPeriodId |
Source master data FinancialCalendar BOD registration name |
FinCal |
Source search template getAcctgPeriod is the search template that returns a PeriodID.Parameters are transaction date and accounting entity. |
getAcctgPeriod(p_transDate ,p_acctgEntity |
Arguments SalesOrder.dateTime is used as the transaction date and SalesOrder.soAcctgEntity is used as the accounting entity. |
SalesOrder.dateTime SalesOrder.soAcctgEntity |
Text-type expression
A text type expression performs string operations to split or concatenate operand values. This type of expression is used to derive the values of an output document attribute.
The types of operands available are:
- Fixed alphanumeric value
- Attribute of master data or transactional document
- An expression of type text
- An expression of type search template with single return value.
The example illustrates text expressions to derive the Year and Organization Code values. The input transaction is SourceSystemJournalEntry business document.
In the first example, Year is the value to be returned. This is derived from the vehicle registration code which is a dimension attribute of the input transaction. The vehicle registration code consists of 10 characters, where the first four digits is the transaction Year, and the next six digits is the registration ID.
Name of the expression | TransYr |
Text Function | Split |
Operand Input transaction’s dimension attribute for vehicle registration |
JeLine.veReg |
Starting character | 1 |
Ending character | 4 |
The second example is another text expression to join the cost center and department code to return the Organization Code value:
Name of the expression | OrgCd |
Operand 1 Input transaction’s dimension attribute for cost center |
JeLine.costCtr |
Text Function | & |
Operand 2 Input transaction’s dimension attribute for department code |
JeLine.deptCd |
Date-type expression
This type of expression derives new date values from date attributes of input documents.
The types of operands that can be used in a date expression are:
- Attributes of master data or transactional document with a datatype of Date.
- A fixed value signifying the number of days, months, quarters, or years. For example, 1, 30, etc.
- A fixed value of a specific past, present or future date.
- Today’s date, with a format of
yyyy-mm-dd
.Note: Today’s date follows the system date of the GFC instance. This value changes based on the date when input documents are processed.
The Date expression can be used in Journal Entry Templates, Journal User Fields and Rule Mapping/Rule Script. Currently it cannot be selected as a value in Dimension Code Assignments nor can it be used as operand in other types of expression.
This example derives the Expected Delivery Date of an item by adding 2 working days from the Order Date on the Purchase Order.
Name of the expression | ExpDeliveryDate |
Operand 1 Attribute of Purchase Order document containing the Order Date |
PoHead.orderDate |
Arithmetic Operator Addition |
+ |
Operand 2 Fixed Value signifying the number of days |
2 |
REST API-type expression
This type of expression is created to directly retrieve information from an enterprise application by sending out REST API requests.
These details are required in defining an expression that uses REST API:
- API Definition – This is the name of the imported API definition that is used for retrieving information.
- Parameters – A value should be assigned to each parameter key defined for the API to obtain the corresponding result key or keys.
The type of values that can be assigned to a parameter are:
- Fixed value – A numeric or text value
- Attribute of a master data or transactional document – The value is determined from the input business document.
An expression for a SourceSystemJournalEntry document that uses a Forex API named “convert” in translating the transaction amount currency to the functional amount currency of the receiving general ledger entity.
Name of the expression | ApiConvertAmt |
API Definition | convert |
Parameters | |
Key | from, to |
Value JeLine.lnAmount is used as the input amount for conversion, with USD as the target currency. |
JeLine, InAmt, "USD" |
Nested expression
A formula expression can have another expression as one of its operands.
A formula expression for an invoice business document that returns the total amount of an invoice line. The total amount is the sum of the invoice line amount and tax amount. This expression uses another formula expression that computes the tax amount of the invoice line:
InvLineTotAmt = InvLine.amt + InvLineTaxAmt
Name of the expression | InvLineTotAmt |
Operand 1 Amount attribute of the InvoiceLine BOD registration |
InvLine.amt |
Arithmetic operator | + |
Operand 2 Formula expression of the invoice business document that multiplies the invoice line amount with the tax rate |
InvLineTaxAmt |
InvLineTaxAmt = InvLine.amt * InvLine.taxRate
Name of the expression | InvLineTotAmt |
Operand 1 Amount attribute of the InvoiceLine BOD registration |
InvLine.amt |
Arithmetic operator | * |
Operand 2 Tax rate attribute of the InvoiceLine BOD registration |
InvLineTaxAmt |
InvTotAmtToEuro = Invoice.totAmt * InvToEuroCurrXRate
Name of the expression | InvTotAmtToEuro |
Operand 1 Total amount attribute of the Invoice BOD registration |
Invoice.totAmt |
Arithmetic operator | * |
Operand 2 A search template expression of the invoice business document that returns the exchange rate between the invoice amount’s currency and Euro currency. |
InvToEuroCurrXRate |
The InvToEuroCurrXRate search template expression should be defined with these:
Name of the expression | InvTotAmtToEuro |
Source master data CurrencyExchangeRateMaster BOD registration name |
CurrXchgeRateMaster |
Source search template getCurrencyRate is the search template that returns an exchange rate between two currencies during a specific period of time. Parameters are source currency, target currency and transaction date |
getCurrencyRate(p_sourceCurr,p_targetCurr, p_startDate) |
Arguments A search template expression of the invoice business document that returns the exchange rate between the invoice amount’s currency and Euro currency. |
Invoice.totAmtCurr ‘EUR’ Invoice.dateTime |