Create Configured Notification
In IFS Notfy Me it is possible to create own configured notifications. This
section will explain in detail how this is done in the IFS Touch Apps
Server,
Customer
Portal.
Contents
IFS Notify Me included several built-in Notification types. These could not
be customized or modified.
In Configured Notification you have the ability to do new customized
notifications to be shown in IFS Notify Me.
- An SQL statement returns one row for each “Notification” to be shown -
columns from SQL statement become fields on the notification object.
- E-mail and dialer can be invoked for Contacts.
- HTML5 templates for List and Detail views specify how to format, style
and render the fields.
- Actions can be specified, along with PL\SQL block to execute when
performing Action.
- Additional SQL statements can fetch child data and render them as
tables.
- Translations can be provided for labels, Actions etc.
In order to create a configured notification, there are a set of skills that
the one who creates the notification need to have.
- Knowledge and understanding of the underlying database model
- i.e.: what data to fetch from the database
- SQL experience to create and test the SQL statement for notifications
- i.e.: how to fetch that data, keeping performance implications in
mind
- PL\SQL experience to create and test Actions (in addition to the above
two)
- Understanding of DOCMAN integration if attached documents needed
- Basic understanding of HTML, CSS and Javascript to create the List and
Detail Templates
- Some advanced styling and layout may be possible by someone familiar
with Bootstrap. These will not be supported by R&D.
- Basic understanding of Javascript and JSON syntax to create translations
file
- Familiarity with IFS Touch Apps Server,
Customer
Portal in order to create, enable/disable and test the notification type.
Before we start to do a customized notification, let's have a look at what we
have in Notify Me
In IFS Notfy Me we have the following screens
- List view
- Detailed view
- Child tables in detail view
The following types of elements can be configured for a customized
notification type:
- Contacts
- Actions
- Child Detail table
- Child Documents (Docman)
In the Configuration Screen you have the following:
- Enabled - Yes/No
If checked then the configured
notification is enabled for IFS Notify Me.
- HTML List Template
In this section you define the
look and feel of the configured notification listed in IFS Notify Me.
- HTML Detail Template
In this section you define the
look and feel of the configured notification details in IFS Notify Me.
- Translations
In this section you define the
translations.
- SQL Statements
In SQL statement you can
- Add a new sql statement. Add will open up an new window.
- Edit an existing sql statement
- Delete an existing sql statement
- Actions
In Actions you can
- Add a new Action. Add will open up a new window.
- Edit an existing Action
- Delete an existing Action
The SQL statement is done using Add button under
sql statement in the first page of configured configuration.
You enter the following information
- Name of the statement
The name you want to have for
SQL select statement
- Description of the statement
A more detailed
description of the SQL statement then only the name of the SQL statement
- Type of SQL statement
There are three different
types of SQL statements
- Parent
Parent is the statement that
select the list view.
- ChildDetail
ChildDetail is the
statement that selects the details from a certain notification.
- ChildDocument
ChildDocument is the
statement that select the document for a certain ChildDetail.
You enter the following information
- Action Name
The name you want to have for the Action
- The PL/SQL block to execute when a user performs the action
The SQL statement is done using Add button under
sql statement in the first page of configured configuration.
Type of SQL Statement = Parent
Think about the following when creating the sql statement:
- Use &AO to refer to AppOwner tablespace.
- Configuration Page currently has no validation for the SQL statements.
- Be sure to test in IFS Developer Studio, SQLPlus or similar tool
- Pay attention to performance considerations!
- &AO.Fnd_Session_API.Get_Fnd_User() should be first choice for fetching a
user’s notifications
- IFS_ID should be defined
- Unique identifier for Notification, so that no duplicates are
created on sync
- i.e.: database record == Notification object
- Server side translations (enums etc.) generally work
- Do NOT use comments in any SQL statement
- Column aliases are optional
Example - SQL Statement
Example - Special field aliases
The IFS_ID column is required, and should be the primary identifier of a
Notification.
The Aliases (PERSON_1, PERSON_1_EMAIL, PERSON_1_PHONE and PERSON_1_ROLE), and
the same combination with PERSON_2 are treated as special fields and will be
rendered as contacts.
ACTION_1 and ACTION_2 will control whether the primary
and secondary actions are enabled or not.
The SQL statement is done using Add button under
sql statement in the first page of configured configuration.
Type of SQL Statement = ChildDetail
The SQL statement is done using Add button under
sql statement in the first page of configured configuration.
Think about the following when creating the sql statement:
- Column aliases will become column headers on the client
- Translations can be injected with aliases like UNREAD_ITEM_COUNTER
AS ‘#Unread items#’
- Detail queries can impact performance, so use sparingly.
- Multiple child queries can be used, but they will all be rendered as
child tables
- The description becomes the child table’s title.
- In the detail query’s WHERE condition, define bind variables so that the
bind variable (:FOLDER_ID as an example) appears as a column in the
Notification query. This way, the child query will be parameterized at run
time.
Examples SQL Statement Detailed Data
Example - Child Table
Example - Master Detail Connection
The SQL statement is done using Add button under
sql statement in the first page of configured configuration.
Type of SQL Statement = ChildDocument
Think about the following when creating the detailed sql statement:
- Make sure all the columns in the example are present, and in the same
order
- i.e.: doc_info, doc_class, doc_no, doc_sheet, doc_rev, title
- LU_NAME and KEY_REF are the only changes that need to be done
- Copy/paste example query and only make those two changes
- KEY_REF check can use multiple bind variables as long as all (e.g.:
“KEY_1” in example) are in SELECT list of main query
- KEY_REF check can be either an equality check or a LIKE
- Use Documents queries sparingly – they can impact performance just like
detail queries.
- Grants are needed to all packages and views.
- Only one Documents query supported for a Notification Type.
Template for a document query
SELECT &AO.Edm_File_API.Get_Edm_Repository_Info(refobj.doc_class,
refobj.doc_no, refobj.doc_sheet, refobj.doc_rev, 'ORIGINAL') AS doc_info,
refobj.doc_class,
refobj.doc_no,
refobj.doc_sheet,
refobj.doc_rev,
&AO.Doc_Title_Api.Get_Title(refobj.doc_class,refobj.doc_no) AS title
FROM
&AO.Doc_Reference_Object refobj
WHERE
&AO.Edm_File_API.Check_Exist(refobj.doc_class, refobj.doc_no, refobj.doc_sheet,
refobj.doc_rev, 'ORIGINAL') = 'TRUE'
AND
&AO.Doc_Issue_API.Get_View_Access_(refobj.doc_class, refobj.doc_no,
refobj.doc_sheet, refobj.doc_rev) = 'TRUE'
AND refobj.lu_name = '<replace
with LU name e.g.: PurchaseOrder>'
AND refobj.key_ref LIKE 'KEY_1=' ||
:KEY_1 || '%'
/* make sure the keyref matches notification object. Remove
this comment before use.*/
Example - Document Connection
Example - How documents are rendered
The Actions is done using Add button under Actions
in the first page of configured configuration.
You enter an Action Name and the PL/SQL Block.
Think about the following when creating the sql statement:
- Implicit support for first and second actions to be enabled/disabled on
the fly.
- More than two Actions can be defined, but only the first and second
can be enabled/disabled conditionally.
- Actions should check the object’s current state
- This is important because after a Notification is fetched to the
device and the Action is determined to be enabled, the Action can be
invoked while the device is offline. The next time the device is online
again, it will execute the Action, and the SQL for the Action is run
only then, but by this time, the object’s state may have changed.
- Actions should be idempotent and safe
- The Action created can be called multiple times and should always
produce the same result.
Example of PL/SQL Block:
BEGIN
UPDATE &AO.FND_STREAM_TAB
SET READ
= "FALSE"
WHERE MESSAGE_ID = :$MESSAGE_ID$;
COMMIT;
END;
Define parameters using the syntax shown above (e.g.: “:$MESSAGE_ID$”).
The parameter value will be bound to the current Notification’s corresponding
column (MESSAGE_ID in this example).
Example - Actions
Example - Parameters for Actions
Define parameters using the syntax shown above (e.g.: “:$MESSAGE_ID$”). The
parameter value will be bound to the current Notification’s corresponding column
(MESSAGE_ID in this example).
The list view template is created on the configuration page, HTML List View.
Use the following template with this recommended structure:
<ifs-row>
<ifs-label
label-text=“<replace with Notification title>" label-data="ND.<title
field>"></ifs-label>
</ifs-row>
<ifs-row>
<ifs-status-icon icon-status-id="ND.StatusId" class=""></ifs-status-icon>
<ifs-data ifs-data-field="ND.<field for first label>"
class="col-xs-9"></ifs-data>
<ifs-data
ifs-data-field="ND.<field for first label>" class="col-xs-9"></ifs-data>
<ifs-label label-data="ND.<field 1> + ' ' + ND.<field 2>"
class="col-xs-9"></ifs-label>
</ifs-row>
Note that
the last item is an <ifs-label> instead of an <ifs-data>, so it renders as an
emphasized text block. Note also the use of a Javascript expression, in this
case to concatenate two strings.
Think about the following when creating a list view:
- The List template is intended to have four rows of content. It will not
show more than 4 rows.
- For visual consistency, use the same template structure as the example –
two <ifs-row> tags with the first having a single <ifs-label> and the second
having an <ifs-status-icon> tag and two to three <ifs-data> tags
- This left-aligns the first label and the status icon
- Emphasizes the first label (usually as bold) to be used as a title
- Also indents the 2nd, 3rd and 4th fields – auxiliary data fields.
Also use the col-xs-9 style to ensure they are laid out in different
lines.
Example - List View
Example - List Template Structure
Example - Data Binding to Template
The detailed list view template is created on the configuration page, HTML
Detail Template.
Think about the following when creating a detailed template:
- <ifs-header> items are formatted in bold
- Both <ifs-header> and <ifs-label> items can contain Javascript
expressions
- Useful for concatenating strings etc.
- Other usages not recommended nor supported by R&D!
- Limitation: All child table will be shown in the order they are defined.
You cannot manipulate any data in the child tables, nor reference them from
the main section.
Template = html snippet bound the notification data. The structure of of the
html snippet is the following
- Detail template root is <ifs-detail-body> tag
- List template and <ifs-detail-body> are made up of one or more <ifs-row>
tags
- Ifs-row child elements
Example - <ifs-table> tag
Styling is done by using the tag attrbute class.
The following needs to be thought about when styling.
- Styling currently controls size, positioning and responsive layouts
- Screen broken into 12 columns
- Each <ifs-?> tag can be sized on this grid, and Notify Me will render it
correctly based on device size
- xs: Extra Small devices (phones, less than 768px on longest edge)
- small: Small devices (tablets, 768px-992px typically)
- medium: Medium devices (desktops, 992px-1200px typically)
- large: Large devices (large desktops, 1200px and up)
- Internally, Notify Me uses Bootstrap for layout. Bootstrap-specific
styling and layouts are thus possible, but not supported by R&D.
Here is a list of the ifs style attribute aliases and bootstrap style:
IFS Template Style |
Bootstrap Style |
xs-full |
col-xs-12 |
xs-half |
col-xs-6 |
xs-quarter |
col-xs-3 |
small-full |
col-sm-12 |
small-half |
col-sm-6 |
small-quarter |
col-sm-3 |
medium-full |
col-md-12 |
medium-half |
col-md-6 |
medium-quarter |
col-md-3 |
large-full |
col-lg-12 |
large-half |
col-lg-6 |
large-third |
col-lg-4 |
large-quarter |
col-lg-3 |
large-sixth |
col-lg-2 |
To make you understand the detailed template, it is easier to show with some
examples:
Example - Template:
ss
Example - Showing Contacts
Example - Formatting Dates
Three formatting options are available for Date and Time values:
- date
for date only,
- time
for time only
- datetime for date and time.
All are formatted based on the device’s current language’s locale.
Example - Showing Detail (Child Data)
Note that this will show all child tables, in the order that they are defined
in the configuration.
Example - Showing Documents
Example - Data bindings to template - Simple Fields
Example - Data bindings to template - Special Fields
The translations is created on the configuration page, Translation.
Think about the following when creating translations:
- You can only override translations for customized notifications
- Substrings in templates, headers of detail tables etc. can be translated
by wrapping in hash symbols - ‘#like this#’
- String interpolation with placeholders is currently not possible
- E.g.: (this will not work!) ifs-mail-to-subject="#RE: {ND.Type} –
{ND.Header}#"
Example - Translation:
Example - Translation Mechanism
Example - Advanced Translation
It is important to test and in wirst case debug the sql statements.
Think about the following while testing:
- Remember to test your SQL outside of Notify Me prior to creating the
Notification type.
- Child queries and document queries add a performance overhead – use
sparingly.
- Use the “Debug” notification only if you suspect runtime Oracle errors
- The “Debug” notification will appear for all users, so remember to
disable after diagnosing any issues.
Debug is done in IFS Touch Apps Server,
Customer
Portal. The same page as when you create a configured notification. Enable
the “Debug” notification type to see what notification types are active on your
system (some may be inactive because of missing grants even though they are
enabled on the customer portal).
You will also get Oracle error messages etc., if a notification type fails.
This is global to all users, so remember to turn this off in production
environments!