Trigger An Alert Only To The Recipients Belonging To A Particular Department, Whenever A Position Is Modified On An Order
Reference No: NEPNL-11
Version No: 06.01.03-00
Details
When a position is modified in R2/ R2labor, the system should send alert to only those set of groups of people who belongs to the position's department.
For Example: Let’s say, there is in order is having three position Audio, Video, and Graphic engineers. And accordingly, the lines are added in planning order. Now lets consider that all three positions have been modified in R2/ R2labor.
This feature is supposed to work such as – Only the employees who belong to Audio Engineer Department should get the alerts about positions that are associated with Audio works. And similarly for Video and Graphics engineer positions.
Functionality Covered
Support to include a Data Source Condition Type in Data Source Condition Definition.
Support to apply the desired Second Level of Condition atRecipient grid.
Support to apply and include the selected Condition in Email Template.
Support to apply and include a Business logic to parse conditions and apply filter form template content.
Data Source, Condition Type, and Condition Definition
Field | Criteria | Compare Column/Value |
Department | Equals | Recipient |


Conditions in Recipient Grid
The condition defined above is applicable for the entity’s where Item/Labor is sub-entity.
To achieve Alert user only when data relevant to the user changed, the user is given an option to tag condition at the Recipient grid level, the user will have to tag the condition created above against the Recipient record. New field Conditions is available at the Recipients grid for a user to select an above-defined condition.
Owner Type | Recipients | Conditions |
Department | Audio Department, Video Department | Order.Labor.Item.Items specific to Department. |


Conditions in Email Template
To achieve Restrict alert content, which is relevant to recipient, user need to add condition created above into email template also. In email template screen, the Data Source Conditions drop-down list all of sub entity's which are defined as applicable for “Recipient / Template”, similar to Data sources field.
On selecting condition, the system adds conditions tag to email template, this tag should add between ##Condition_Start## and ##Condition_End## for system to identify condition. System will provide ##Condition_Start## and ##Condition_End## as part of standard fields.

Business logic to parse conditions
The rules will be triggered when the condition in Template and Condition in Recipient both will be present, and they are matching.
Recipient Type | Condition at Template | Condition at Recipient | Does Rules Triggers? |
Employee | Yes | No | No |
Employee | No | Yes | No |
Employee | Yes | Yes | Yes |
Employee | No | No | No |
DataSourceField | Yes | No | No |
DataSourceField | No | Yes | No |
DataSourceField | Yes | Yes | Yes |
DataSourceField | No | No | No |
Department | Yes | No | No |
Department | No | Yes | No |
Department | Yes | Yes | Yes |
Department | No | No | No |
Position | Yes | No | No |
Position | No | Yes | No |
Position | Yes | Yes | Yes |
Position | No | No | No |
Contact | Yes | No | No |
Contact | No | Yes | No |
Contact | Yes | Yes | Yes |
Contact | No | No | No |
Other | Yes | No | No |
Other | No | Yes | No |
Other | Yes | Yes | Yes |
Other | No | No | No |
Prerequisite #1
To use this functionality, you must have an order with at least two labor positions added, both from different departments.
Prerequisite #1
Go to R2Labor > Main Menu > Manage > Data Source Conditions > Add.
Under the option “Applicable For” – Select either of the options
Rules: If this option is selected, then the condition defined appears only under Conditions field for Rules.
Templates & Recipients: If this option is selected, then the condition defined appears under Conditions field for Recipients and/or Email Templates.
The Conditional Options used above can be defined under R2Labor > Main Menu > Manage > Rules
Got to R2Labor > Main Menu > Manage > Rules
Select the desired rule and click Edit.
On the rules Edit screen, Under Recipients, Click on Conditions field.
Use the drop-down list to select the Condition.
For Example Labor.Item Labor.Department equals to Recipient Dept.
Note:
Ensure that Owner Type is selected as Department, and Recipient is selected as one of Department names.
The value selected under Conditions Field of Edit Screen should be ‘Labor Line Changes’
If required multiple conditions can be selected by adding them one at a time.
If Owner Type is selected as Others, then the system ignores such conditions.
So, this setting would mean, that everytime there are changes made to the Labor Lines where the Departments is same as the ones mentioned under ‘Department Names’ all the recipients tagged to those department will be notified.
On the rules Edit screen, Under Email Templates, Click Edit.
Use the ‘Standard Field’ drop down to select 'Condition Start’
Use the ‘Condition Field’ to select the condition defined in the previous step.
For Example, Labor.Item Labor.Department equals to Recipient Dept..
Note:
If required multiple conditions can be selected by adding them one at a time.
Multiple conditions in template, must be separated by a comma.
Use the ‘Standard Field’ drop down to select 'Condition Start’
Click Save.
An On-screen notification will confirm once the Condition is saved successfully.

Sample Workflow
Use an existing order or create a new one (having at least two labor positions, both from different departments).
Modify details related to ONLY one of the labor positions, such as Start/End dates, ET/OT/DT hours etc.
This change will trigger an alert email to the labors associated with order, for which the details were modified.
Sample Email Output Is Given Below
