Package com.saperion.ngc.scripthelper
Class ScriptHelper
java.lang.Object
com.saperion.ngc.scripthelper.ScriptHelper
Provides static helper methods to be used in server-side scripts in masks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.saperion.connector.SaClassicConnector
Provides an instance of theSaClassicConnector
.static User
Provides the current logged in user object.static IntelligentField
getFieldByName
(IntelligentFormView form, String name) Returns the field with the specified name or null, if no field was found.static void
Logs a debug-message in the logfile.static void
Logs an error-message in the logfile.static void
Logs an info-message in the logfile.static void
logWarning
(String message) Logs a warning-message in the logfile.static List<com.saperion.intf.SaDocumentInfo>
performQuery
(String query) Performs a query against the classic Connector.static void
Posts a query event (onButton-event of type ON_QUERY) to the given form.static void
showErrorMessage
(String error) Shows an error message box with the given message to the user.static void
showInfoMessage
(String message) Shows an info message box with the given message to the user.
-
Method Details
-
getFieldByName
Returns the field with the specified name or null, if no field was found.- Parameters:
form
- parent formname
- field name- Returns:
- field or null if not found
-
postQueryEvent
Posts a query event (onButton-event of type ON_QUERY) to the given form.- Parameters:
form
- The IntelligentFormView the event should be post to.
-
getCurrentUser
Provides the current logged in user object.- Returns:
-
getClassicConnector
public static com.saperion.connector.SaClassicConnector getClassicConnector()Provides an instance of theSaClassicConnector
.- Returns:
- an instance of the
SaClassicConnector
.
-
performQuery
Performs a query against the classic Connector.- Parameters:
query
-- Returns:
-
showInfoMessage
Shows an info message box with the given message to the user.- Parameters:
message
- The message to show.
-
showErrorMessage
Shows an error message box with the given message to the user.- Parameters:
error
- The message to show.
-
logError
Logs an error-message in the logfile.- Parameters:
message
- the message
-
logWarning
Logs a warning-message in the logfile.- Parameters:
message
- the message
-
logInfo
Logs an info-message in the logfile.- Parameters:
message
- the message
-
logDebug
Logs a debug-message in the logfile.- Parameters:
message
- the message
-