Class ScriptHelper

java.lang.Object
com.saperion.ngc.scripthelper.ScriptHelper

public final class ScriptHelper extends Object
Provides static helper methods to be used in server-side scripts in masks.
  • Method Details

    • getFieldByName

      public static IntelligentField getFieldByName(IntelligentFormView form, String name)
      Returns the field with the specified name or null, if no field was found.
      Parameters:
      form - parent form
      name - field name
      Returns:
      field or null if not found
    • postQueryEvent

      public static void postQueryEvent(IntelligentFormView form)
      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

      public static User getCurrentUser()
      Provides the current logged in user object.
      Returns:
    • getClassicConnector

      public static com.saperion.connector.SaClassicConnector getClassicConnector()
      Provides an instance of the SaClassicConnector.
      Returns:
      an instance of the SaClassicConnector.
    • performQuery

      public static List<com.saperion.intf.SaDocumentInfo> performQuery(String query)
      Performs a query against the classic Connector.
      Parameters:
      query -
      Returns:
    • showInfoMessage

      public static void showInfoMessage(String message)
      Shows an info message box with the given message to the user.
      Parameters:
      message - The message to show.
    • showErrorMessage

      public static void showErrorMessage(String error)
      Shows an error message box with the given message to the user.
      Parameters:
      error - The message to show.
    • logError

      public static void logError(String message)
      Logs an error-message in the logfile.
      Parameters:
      message - the message
    • logWarning

      public static void logWarning(String message)
      Logs a warning-message in the logfile.
      Parameters:
      message - the message
    • logInfo

      public static void logInfo(String message)
      Logs an info-message in the logfile.
      Parameters:
      message - the message
    • logDebug

      public static void logDebug(String message)
      Logs a debug-message in the logfile.
      Parameters:
      message - the message