Classes | Functions
The xTuple ERP Scripting API

The xTuple ERP Scripting API defines the interface between extension scripts and the xTuple ERP C++ core. More...

Classes

class  QIODeviceProto
 This class exposes the QIODevice class to Qt Scripting. More...
 
class  QProcessProto
 This class exposes the QIODevice class to Qt Scripting. More...
 
class  ScriptToolbox
 The ScriptToolbox provides a collection of miscellaneous utility methods used when writing xTuple ERP extension scripts. More...
 

Functions

 include (String first, String second,...)
 Include the named script(s) in the current script. More...
 
QScriptValue QSqlDatabasetoScriptValue (QScriptEngine *engine, QSqlDatabase const &item)
 Script Exposure of QSqlDatabase class. More...
 

Detailed Description

The xTuple ERP Scripting API defines the interface between extension scripts and the xTuple ERP C++ core.

Function Documentation

◆ include()

include ( String  first,
String  second,
  ... 
)

Include the named script(s) in the current script.

This lets the script developer put commonly used QtScript (JavaScript) code in a single place and use it in multiple other scripts. All named scripts are included in the order listed. If more than one script exists with the given name, all of them are included in increasing order by script_order. The inclusion is done as the script is executed, so if an include() call appears in the middle of a function, the include will not be done until that function gets called. If any of the included scripts throws an exception while being included, no subsequent scripts in the list will be processed.

For example:

include("soap2js");

This tells the current QScriptEngine to use the contents of the script named "soap2js" and appears near the top of the weatherForAddress.js script.

include("storedProcErrLookup", "xtmfgErrors");

This tells the current QScriptEngine to use the contents of two scripts, one named "storedProcErrLookup" and the other named "xtmfgErrors".

Parameters
firstThe name of a script to include
secondOptional: The name of a second script to include
Returns
The number of arguments that were processed
See also
weatherForAddress.js
include.cpp

◆ QSqlDatabasetoScriptValue()

QScriptValue QSqlDatabasetoScriptValue ( QScriptEngine *  engine,
QSqlDatabase const &  item 
)

Script Exposure of QSqlDatabase class.

include
include(String first, String second,...)
Include the named script(s) in the current script.
Definition: include.cpp:131

Generated on Fri Apr 9 2021 xTuple ERP Programmer Reference, Version 6.0.0 doxygen 1.8.17