Notification Classes Constructors
You must use the constructor for each class to instantiate an instance of that class. The following are the constructors for the Notification classes.
Syntax
Notification(NotifyFrom, dttmCreated, language_cd)
Description
Use Notification to instantiate a notification object.
Parameters
Field or Control |
Definition |
---|---|
NotifyFrom |
Specify the entity the notification is being sent from, as a string. Avoid overusing generic entities with this parameter, as this value, along with the value for dttmCreated are the key to understanding where notifications originated from. |
dttmCreated |
Specify the date and time the notification is being sent, as a DateTime value. Important! To ensure a unique timestamp for each notification that is sent, you must pass a DateTime value that includes milliseconds. Because the %Datetime system variable always returns 0 for the milliseconds value, use the combination of %Date+%PerfTime instead. |
language_cd |
Specify the 3-character language code of the current user, as a string. |
Returns
A Notification object.
Example
To ensure a unique timestamp for each notification that is sent, you must pass a DateTime value that includes milliseconds to the dttmCreated parameter. Because the %Datetime system variable always returns 0 for the milliseconds value, use the combination of %Date+%PerfTime instead.
import PT_WF_NOTIFICATION:*;
import PT_WF_WORKLIST:*;
Local PT_WF_NOTIFICATION:Notification &MyNotify;
&MyNotify = create PT_WF_NOTIFICATION:Notification("Workflow_Admin", %Date + %PerfTime, %Language);
Syntax
NotificationAddress(Oprid, Description, Language, EmailId, Channel)
Description
Use NotificationAddress to instantiate a notification address.
This address is used to build a notification using the Notification class. This class is required if you want to use the Notification data type.
Parameters
Field or Control |
Definition |
---|---|
Oprid |
Specify the user ID of the person receiving the notification, as a string. |
Description |
Specify the description of the entity receiving the notification (distribution group names, people's names, and so on) as a string. |
Language |
Specify the language code of the entity to be notified as a string. |
EmailId |
Specify the email address as a string. |
Channel |
Specify the 'channel' used for the notification, as a string. The values are: |
Value |
Description |
---|---|
|
Notification is sent as email |
Worklist |
Notification is sent as a worklist |
Returns
None.
Example
import PT_WF_NOTIFICATION:*;
import PT_WF_WORKLIST:*;
Local NotificationAddress &MyNotify_Addy;
&MyNotify_Addy = Create NotificationAddress(%UserID, &Description, %Language, &EmailID, &Channel);
Syntax
NotificationTemplate(ComponentId, Market, TemplateId, TemplateType)
Description
Use NotificationTemplate to instantiate a notification template.
If you're specifying a generic template, the first two parameters do not have to have values, that is, you must specify a Null string ("") instead.
Parameters
Field or Control |
Definition |
---|---|
ComponentId |
Specify the name of the component the notification is coming from as a string. To specify a generic template, you must specify a Null string ("") for this value instead. |
Market |
Specify the name of the market of the component the notification is coming from as a string. To specify a generic template, you must specify a Null string ("") for this value instead. |
TemplateId |
Specify the template ID as a string. |
TemplateType |
Specify the type of template as a string. Values are:
|
Returns
An instance of the NotificationTemplate class.
Example
import PT_WF_NOTIFICATION:*;
import PT_WF_WORKLIST:*;
Local NotificationTemplate &Notify_Temp;
/* create a generic template */
&Notify_Temp = Create NotificationTemplate("", "", "MyTemplate", "G");
Syntax
Worklist()
Description
Use the Worklist method to instantiate a Worklist object.
Parameters
None.
Returns
An instance of the Worklist class.
Example
The following example code creates a worklist.
import PT_WF_WORKLIST:*;
Local Worklist &theWorklist = Create Worklist();
Syntax
WorklistEntry()
Description
Use WorklistEntry to instantiate a WorklistEntry object.
Parameters
None.
Returns
An instance of the WorklistEntry class.
Example
import PT_WF_NOTIFICATION:*;
import PT_WF_WORKLIST:*;
Local WorklistEntry &MyWorklistEntry = Create WorklistEntry();
Syntax
WSWorklistEntry()
Description
Use the WSWorklistEntry constructor to instantiate a WSWorklistEntry object.
The WSWorklistEntry class is primarily used with web services.
Parameters
None.
Returns
A reference to a WSWorklistEntry object.