Skip to main content
Skip table of contents

createNotification

Versionshinweise

22.1, 21.2.7

Code

GROOVY
String WorkSpaceScriptUtils.createNotification(IContainer notificationAC, List<String> employeePks)
String WorkSpaceScriptUtils.createNotification(IContainer notificationAC, String... employeePks)

Beschreibung

Erstellt eine neue Benachrichtigung mit dem übergebenen IContainer.
Ist das Feld "Zeitpunkt" (NotifcationDate>) nicht gefüllt, wird es mit der aktuellen Zeit vorbelegt. Die Mitarbeiter werden mit der Benachrichtigung verknüpft.

Parameter

  • notificationAC - Der Benachrichtigungs-Datensatz.
  • employeePks - Die Liste der Mitarbeiter, die benachrichtigt werden sollen.

Rückgabe

Der Primärschlüssel der erstellten Benachrichtigung.

Beispiele

GROOVY
// IContainer Variable aus dem Prozess-Start Ereignis
IContainer opportunity = ProcessUtils.getVariable("container");
String user = LookupUtils.getPk(WorkSpaceScriptUtils.getValue(opportunity, "ProjectmanagerKey.Opportunity"));

// Erstellt den IContainer für die Benachrichtigung. 'NotificationDate' wird durch die Logik befüllt. 'IsDone' wird nicht mehr benötigt.
IContainer notification = WorkSpaceScriptUtils.createDefaultEntry("Notification");
WorkSpaceScriptUtils.setValue(notification, "NotificationType.Notification", LookupUtils.toLookup("NOTIFICATION_ENTITY"));
WorkSpaceScriptUtils.setValue(notification, "EntityName.Notification", WorkSpaceScriptUtils.getEntityName(opportunity));
WorkSpaceScriptUtils.setValue(notification, "EntityPk.Notification", WorkSpaceScriptUtils.getPk(opportunity));
WorkSpaceScriptUtils.setValue(notification, "Title.Notification", "Delegation der Anfrage");
WorkSpaceScriptUtils.setValue(notification, "Description.Notification", "Bitte bearbeiten Sie die Anfrage nach.");
WorkSpaceScriptUtils.setValue(notification, "Priority.Notification", "S_NEWSPRIOR-A");
WorkSpaceScriptUtils.setValue(notification, "IsSticky.Notification", true);

// Die Logik erstellt die Benachrichtigung der Anfrage und verknüpft sie mit dem eigenen Mitarbeiter und dem Projekt-Manager.
String notificationPk = WorkSpaceScriptUtils.createNotification(notification, user, SessionConstants.USERPK);
ProcessUtils.setVariable("notificationPk", notificationPk);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.