Ticket Rules
Ticket rules have criteria that triggers rule actions if a job, ticket, or ticket item meets the criteria.
Use information entered in job, ticket, or ticket item fields for ticket rule criteria.
| Review CPQ Rules prior to working with ticket rules for FieldFX CPQ. |
Add Ticket Rules
When adding rules, here are some examples showing how to add a rule with:
Add a Rule with Job-Based Criteria
In this example, we will add a ticket rule using criteria based on the selection of Offshore for a job.
Once we set up the rule, the following applies:
| If you… | Then the Rule Engine… |
|---|---|
Select Offshore for a job, |
|
Deselect Offshore for a job, |
|
Setup
-
Add the Offshore checkbox:
-
From Setup, enter
objectin the Quick Find box, then select Objects. -
Click Job.
-
Under Custom Fields & Relationships, click New.
-
Select Checkbox and click Next
-
In Field Label, enter
Offshore. -
Click Next.
-
Click Visible twice and then click Next.
-
Select the page layouts on which to include the checkbox and click Save
-
Grant permissions for the checkbox.
-
-
Add a rule:
-
Open the price book for which to add the rule.
-
Under Rules, click New Rule.
-
In Rule Name, enter
Offshore. -
In Criteria, enter the following:
FX5__Job__r.Offshore__c=true
-
In Applies To, add "Ticket__c" to Chosen.
-
Select Is Active and click Save.
-
-
Add a rule action:
-
Under Rule Actions, click New Rule Action.
-
In Price Book Item, select Deepwater Safety Pack.
-
In Type, select Required.
-
Select Is Active and click Save.
-
-
Run a script for the Offshore checkbox:
-
Select Utilities | Apex Execute.
-
Enter the following script:
System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null)); -
Click Execute.
Add a Rule with Ticket-Based Criteria
In this example, we will add a ticket rule using criteria based on the selection of Disposal Included for a ticket.
Once we set up the rule, the following applies:
| If you… | Then the Rule Engine… |
|---|---|
Select Disposal Included for a ticket, |
|
Deselect Disposal Included for a ticket, |
|
Setup
-
Add the Disposal Included checkbox:
-
From Setup, enter
objectin the Quick Find box, then select Objects. -
Click Ticket.
-
Under Custom Fields & Relationships, click New.
-
Select Checkbox and click Next.
-
In Field Label, enter
Disposal Includedand click Next. -
Click Visible twice and click Next.
-
Select the page layouts on which to include the checkbox and click Save.
-
Grant permissions for the checkbox.
-
-
Add a rule:
-
Open the price book for which to add the rule.
-
Under Rules, click New Rule.
-
In Rule Name, enter
Disposal Included. -
In Criteria, enter the following:
Disposal_Included__c=true
-
In Applies To, add "Ticket__c" to Chosen.
-
Select Is Active and click Save.
-
-
Add a rule action:
-
Under Rule Actions, click New Rule Action.
-
In Price Book Item, select Disposal Included.
-
In Type, select Required.
-
Select Is Active and click Save.
-
-
Run a script for the Disposal Included checkbox:
-
Select Utilities | Apex Execute.
-
Enter the following script:
System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null)); -
Click Execute.
Add a Rule with Job & Ticket-Based Criteria
In this example, we will add a ticket rule using criteria based on the selection of Offshore for a job and the value in BHT for a ticket.
Once we set up the rule, the following applies:
| If you… | Then the Rule Engine… |
|---|---|
Deselect Offshore for a job, |
|
Enter a BHT more than "500" for a ticket, |
|
Setup
-
Add the Offshore checkbox:
-
From Setup, enter
objectin the Quick Find box, then select Objects. -
Click Job.
-
Under Custom Fields & Relationships, click New.
-
Select Checkbox and click Next.
-
In Field Label, enter
Offshoreclick Next. -
Click Visible twice and click Next.
-
Select the page layouts on which to include the checkbox and click Save.
-
Grant permissions for the checkbox.
-
-
Add the BHT field:
-
From Setup, enter
objectin the Quick Find box, then select Objects. -
Click Ticket.
-
Under Custom Fields & Relationships, click New.
-
Select Number and click Next
-
In Field Label, enter
BHTand click Next. -
Click Visible twice and click Next.
-
Select the page layouts on which to include the field and click Save.
-
Grant permissions for the field.
-
-
Add a rule:
-
Open the price book for which to add the rule.
-
Under Rules, click New Rule.
-
In Rule Name, enter
BHT <500. -
In Criteria, enter the following:
FX5__Job__r.Offshore__c=true && BHT__c<500
-
In Applies To, add "Ticket__c" to Chosen.
-
Select Is Active and click Save.
-
-
Add a rule action:
-
Under Rule Actions, click New Rule Action.
-
In Price Book Item, select SlimXtreme Slimhole HPHT Logging Platform.
-
In Type, select Required.
-
Select Is Active and click Save.
-
-
Run a script for the Offshore and BHT fields:
-
Select Utilities | Apex Execute.
-
Enter the following script:
System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null)); -
Click Execute.
Add a Rule with Ticket Item-Based Criteria
In this example, we will add a ticket rule using criteria based on the Depth for a ticket item.
Once we set up the rule, the following applies:
| If you… | Then the Rule Engine… |
|---|---|
Enter a Depth less than "1000" for the Run ticket item |
|
Enter a Depth more than "1000" for the Run ticket item, |
|
Setup
-
Add a Run catalog item:
-
Open the Catalog Items tab.
-
Click New.
-
In Item Code, enter "Run".
-
In Description, enter
Run for wireline jobs. -
In Sequence Number, enter a sequence number to use for the item.
-
In Ticket Item Record Type, select a relevant option such as "Services".
-
Click Save.
-
-
Add a Run price book item:
-
Under Price Book Items, click New Price Book Item.
-
In Price Book, select the price book for which to add the rule.
-
In Default Quantity, enter
1. -
In Included Quantity, enter
0. -
Click Save.
-
-
Add a Depth Charge 0-1000 ft catalog item:
-
Open the Catalog Items tab.
-
Click New.
-
In Item Code, enter
DC<1000. -
In Description, enter
Depth Charge 0-1000 ft. -
In Sequence Number, enter a sequence number to use for the item.
-
In Ticket Item Record Type, select a relevant option such as "Services".
-
Click Save.
-
-
Add a Depth Charge 0-1000 ft price book item:
-
Under Price Book Items, click New Price Book Item.
-
In Price Book, select the price book for which to add the rule.
-
In Default Quantity, enter
1. -
In Included Quantity, enter
0. -
In Price, enter the price to charge for runs less than 1000 feet.
-
Click Save.
-
-
Add the Depth field to the Ticket Item object:
-
From Setup, enter
objectin the Quick Find box, then select Objects. -
Click Ticket Item.
-
Under Custom Fields & Relationships, click New.
-
Select Number.
-
Click Next.
-
In Field Label, enter
Depthand click Next. -
Click Visible twice and click Next
-
Select the page layouts on which to include the field and click Save
-
Grant permissions for the field.
-
-
Add a rule:
-
Open the price book for which to add the rule.
-
Under Rules, click New Rule.
-
In Rule Name, enter
Depth Charge <1000. -
In Criteria, enter the following formula:
Depth__c <1000
-
In Price Book Item, select the Run price book item.
When you link a price book item to a rule, the Rule Engine triggers rule actions for that rule when you add the price book item to tickets.
-
In Applies To, add "Ticket__c" to Chosen.
-
Select Is Active and click Save
-
-
Add a rule action:
-
Under Rule Actions, click New Rule Action.
-
In Price Book Item, select Depth Charge 0-1000 ft.
-
In Type, select Required.
-
Select Is Active and click Save
-
-
Run a script for the Depth field:
-
Select Utilities | Apex Execute.
-
Enter the following script:
System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null)); -
Click Execute.