Wednesday, September 18, 2019

Work Rule of Record Type: Field Service - Match Boolean

This type of Work Rule filters Service Resources based on its Checkbox fields. Go to Work Rule tab and create a new Work Rule of record type “Field Service - Match Boolean”.



After selecting “Field Service - Match Boolean” click on “Next” button and it will open the below screen. Enter the details as shown in below screen and save it.



Here you will find four fields and its detail is as follows,
Field
Type
Description
Work Rule Name
Text
Name of your Work Rule.
Description
Text
Description of your Work Rule.
Resource Property
Pick List
1. This is the main field for this Work Rule.
2. This is a pick list field and we can update it's LOV with Service Resource's check box API name.
3. While installing FSL package, by default a rule record named as "Active Resources" has been created whose LOV value is set as "IsActive".
Value is True
Checkbox
With this checkbox, we can set the value of the above selected LOV's (Service Resource's checkbox field) as true/false.

Note: After installing FSL managed package system will automatically create a Work Rule of Boolean type named as “Active Resources” for Service Resource’s field name “Active” (API Name: IsActive).

As noted above, similarly we can create custom Work Rule for any Service Resource’s field of checkbox type by adding its API name as LOV of “Resource Property” field.

Limitation

A scheduling policy can contain up to 10 Match Boolean work rules.

Scenario:

Create a custom checkbox field named as “Is Valuable Resource” under Service Resource Object and then create a Work Rule (Valuable Resource) of “Match Boolean” type and then put it in Scheduling Policy, so that only valuable resource(s) will show in Dispatch Console for appointment.

Solution:

Note: For this example, I will work on existing record to make this discussion to the point. Because here our aim is to check, exclude work rule behavior, but not to create a Work Order or Service Appointment or Scheduling Service Resource etc.

Initial Check è Check Service Resource(s) for Service Appointment (SA-0017).



Check there is four Service Resources are available for appointment and they are “Alan Reed, Martino Castanon, Paul Morrison, Ralph Clark”.

Record Update è
Create a custom checkbox field named as “Is Valuable Resource” under Service Resource Object.
Now update “Is Valuable Resource” field as true for Alan Reed and Martino Castanon. For other two it is set as false.



Work Rule Creation è
First, add new LOV under Work Rule’s “Resource Property” pick list and LOV value should be the API name (Is_Valuable_Resource__c) of above created field (Is Valuable Resource) under Service Resource.



Then Create a Work Rule of named as “Valuable Resource” of type “Field Service - Match Boolean” and details should be as below screen.



Assign rule to Scheduling Policy è
Assign the above-created rule to your Scheduling Policy.



Test Resource Availability è
As per Work Rule, only two resources (Alan Reed and Martino Castanon) should be show in Dispatch Console for appointment. As other two resources (Paul Morrison and Ralph Clark) are not valuable resource, so they will not available for appointment.



Note: If we want opposite rule, i.e rule for non-valuable resource, then just unchecked “Value is True” field value of work rule “Valuable Resource” and now Paul Morrison and Ralph Clark will be show in dispatch console for appointment.

LWC to LWC Communication using Lightning Messaging Service (Part - 2)

In my previous post ( previous post link ) we have learn how to create a Lightning Messaging Service with 6 steps and today we will use the ...