ExpenseLine - createExpense()

Creates a new expense line record.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Boolean True if the expense line was successfully created.

//get some random CI to be used as an expense sourcevar ci =new GlideRecord("cmdb_ci_server");
ci.query();
ci.next();
 
//create expense line
var exp =new ExpenseLine(ci,234.56,"Test expense line");
exp.setSummaryType("run_business");
var success = exp.createExpense();