Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

ExpenseAllocation- Global

The ExpenseAllocation script include is used by various cost management processes and can also be used for generating custom expense allocation records (fm_expense_allocation) from scripted expense allocation rules.

This script include requires the Cost Management (com.snc.cost_management) plugin.

Parent Topic:Server API reference

ExpenseAllocation - ExpenseAllocation(GlideRecord expense, GlideRecord rule)

Called when you create a new ExpenseAllocation object.

This is not needed if scripting advanced allocation rules. This object is already available as the allocation variable.

NameTypeDescription
expenseGlideRecordGlideRecord identifying the source of the expense.
ruleGlideRecordGlideRecord identifying the rule to use in allocating the expense line.
TypeDescription
ExpenseAllocation objectThe ExpenseAllocation object just created.
var allocation=new ExpenseAllocation(expenseGlideRecord, ruleGlideRecord);

ExpenseAllocation - createAllocation(GlideRecord target, Number amount)

Creates an expense allocation (fm_expense_allocation) record referencing the parameters provided during instantiation and this method.

NameTypeDescription
targetGlideRecordGlideRecord target of the allocation, for example a cost center record to allocate an expense to Decimal amount - the amount of the allocation.
amountNumberThe amount of the allocation.
TypeDescription
BooleanTrue if the expense allocation was successfully created.
var allocation=new ExpenseAllocation(expenseGlideRecord, ruleGlideRecord);
allocation.createAllocation(costCenterGlideRecord, 2345.67);