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.SaClassicConnectorProvides an instance of theSaClassicConnector.static UserProvides the current logged in user object.static IntelligentFieldgetFieldByName(IntelligentFormView form, String name) Returns the field with the specified name or null, if no field was found.static voidLogs a debug-message in the logfile.static voidLogs an error-message in the logfile.static voidLogs an info-message in the logfile.static voidlogWarning(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 voidPosts a query event (onButton-event of type ON_QUERY) to the given form.static voidshowErrorMessage(String error) Shows an error message box with the given message to the user.static voidshowInfoMessage(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
-