Trigger An Alert When An Asset Is Changed On An Order
Content was last updated in 06.01.05-00
Revision History
| Version No. | Reference No. | Changes | 
| 06.01.05-00 | R2-14952 | Trigger an alert when an asset is changed on an Order | 
Support has been added in R2Core for the Labor or Equipment Planner/or a member of the planning team, to get an alert when on an Order an asset is assigned and or changed so that, you can take necessary actions.
Functionality Covered
- When an AssetID is directly put in an order or the reserved by Asset is changed on an order By Any Means*, system must fire an alert to the planner or any other specific employee configured as recipient in rule definition. 
- The functionality allows to setup the Rule to send out the notification: 
- When the above said action occurs only on specific type of order like Reservation or Hold etc. 
- When the above said action occurs on/with the order line status as Reserved or Hold. 
* ‘By Any Means’ includes actions like Reserving an Asset on an order, Right click on a Product on an Order > Assign Assets etc which leads to blocking of an Asset's Availability on an Order instead of product.
Pre-requisites
The Condition and the rule that triggers the alert should be pre-configured in the system.
First step is to ‘Define the Rule Condition(s)’.
Rule Condition #1:
Consider assets which are status: Reserved/ Hold/ Not Available/ Out.
The rule that triggers the alert should be pre-configured in the system.
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order Item Lines], Applicable For [Rules] 
- Provide a name for this Condition [Reserved/Hold/Not Available Asset]. 
- Select the ‘Active’ checkbox. 
- Click ‘Add’ to add a rule condition. 
- Choose the following values for the specified fields: 
- Field [Status] 
- Criteria [Equal] 
- Compare Value [Hold, Reserved, Out, Not Available, and Filled] 
- Click Save. 

Figure 1.0: Configuring the Rule Condition [Reserved/Hold/Not Available Asset]
Rule Condition #2:
Consider the item lines which have an Asset
This condition to validate the added line is an asset to the Item grid.
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order Item Lines], Applicable For [Rules] 
- Provide a name for this Condition [Line with Asset]. 
- Select the ‘Active’ checkbox. 
- Click ‘Add’ to add a rule condition. 
- Choose the following values for the specified fields: - Field [Type] 
- Criteria [Equal] 
- Is Previous Value [False] 
- Compare Value [Line with Asset] 
- Ignore Time [False] 
 
- Click Save. 

Figure 2.0: Configuring the Rule Condition [Line with Asset]
Rule Condition #3:
Consider the item lines where an Item is added, or Product ID is changed.
This condition to ensure when an asset added to order or an asset is assigned/ an asset is re-assigned to another asset.
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order Item Lines], Applicable For [Rules] 
- Provide a name for this Condition [Item is added, or Product ID is changed]. 
- Select the ‘Active’ checkbox . 
- Click ‘Add’ to add a rule condition. 
- Choose the following values for the specified fields: 
Table 1.0: Field Values For Multiple Lines - Rules
| Field | Criteria | Is Previous Value | Compare Value | Ignore Time | Relational Operator | 
| On Created | 
 | False | None selected | False | Or | 
| Product ID | Equals | False | Value Changed | False | Or | 
| Serial | Equals | False | Value Changed | False | 
 | 
- Click Save. 

Figure 3.0: Configuring the Rule Condition [Item is added, or Product ID is changed]
Second Step is to define Template Conditions required to be used in E-mail Template
These template conditions are required to be put in mail template:
- To show only the Assets which are reserved by Asset on Order. 
- When using delta tag in an E-mail template to restrict E-mail template to have below conditions 
Template Condition #1:
Consider the item lines which have an Asset
This condition to ensure when an asset added to order or an asset is re-assigned to another asset.
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order Item Lines], Applicable For [Template & Recipients] 
- Provide a name for this Condition [Type Asset]. 
- Select the ‘Active’ checkbox. 
- Click ‘Add’ to add a rule condition. 
- Choose the following values for the specified fields: - Field [Type] 
- Criteria [Equal] 
- Is Previous Value [False] 
- Compare Value [Line with Asset] 
- Ignore Time [False] 
 
- Click Save. 

Figure 4.0: Configuring the Template Condition [Type Asset]
Template Condition #2:
Consider assets, only when the status is: Reserved, Hold, Not Available, or Out.
The rule that triggers the alert should be pre-configured in the system.
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order Item Lines], Applicable For [Template & Condition] 
- Provide a name for this Condition [Reserved/Hold/Not Available Asset]. 
- Select the ‘Active’ checkbox. 
- Click ‘Add’ to add a rule condition. 
- Choose the following values for the specified fields: - Field [Status] 
- Criteria [Equal] 
- Compare Value [Hold, Reserved, Out, Not Available, and Filled] 
 
- Click Save. 

Figure 5.0: Configuring the Template Condition [Reserved/Hold/Not Available Asset]
Template Condition #3:
Consider the item lines where an Item is added, or Product ID is changed.
This condition restricts the lines that are added should show in the email template.
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order Item Lines], Applicable For [Templates & Conditions] 
- Provide a name for this Condition [Item is added, or Product ID is changed]. 
- Select the ‘Active’ checkbox. 
- Click ‘Add’ to add a rule condition. 
- Choose the following values for the specified fields: 
Table 1.0: Field Values For Multiple Lines - Rules
| Field | Criteria | Is Previous Value | Compare Value | Ignore Time | Relational Operator | 
| On Created | 
 | False | None selected | False | Or | 
| Product ID | Equals | False | Value Changed | False | Or | 
| Serial | Equals | False | Value Changed | False | 
 | 
- Click Save. 

Figure 6.0: Configuring the Template Condition [Item is added, or Product ID is changed]
Third Step is to define a Rule with the above Rule and Template Conditions
Rule Definition
- Got to R2Labor > Main Menu > Manage > Rules > Create. 
- Select a Data Source [Order], Action [Alert], and Category [Miscellaneous] using the respective drop-down list. 
- Select the ‘Deliver On Desktop’, ‘Deliver on Email’, and ‘Active’ checkboxes. 
- Select the severity as ‘Low’. And Becomes Active as ‘Immediately’. 
- Select the three Rule Conditions defined previously. 
- Provide a name for this Condition [Asset Added on Order]. 
- Click Save. 

Figure 7.0: Configuring the Rule [Item is added, or Product ID is changed]
Template Content
- Select Type as [Email] and add a Subject [Assets Added on Order ##Contract ID##] 
- Provide a name for this template [Order with Assets] 
- Click in the E-mail content window and add the Standard Fields for [Order.ItemLines] 
- Add the required fields using their respective #tags (Hashtags). 
All the fields added using the #tags, will have ##Order.ItemLines as the prefix.
- Add the three Template Conditions defined previously. 
- Click Save. 

Figure 8.0: Configuring the Template [Order with Assets]
Table 3.0: E-mail Template Hashtags Explained
| HashTag Used | Field Included By Using Hashtag | 
| ##Order.ItemLines.ItemID## | 
 | 
| ##Order.ItemLines.ITEMDESCRIPTION## | 
 | 
| ##Order.ItemLines.AssetID## | 
 | 
| ##Order.ItemLines.ASSETDESCRIPTION## | 
 | 
Template conditions condition#1, condition#2 is added for the template.
Sample Workflow

