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,

  • Adds the Deepwater Safety Pack item to every ticket.

  • Prevents removal of the Deepwater Safety Pack item from any ticket.

Deselect Offshore for a job,

  • Removes the Deepwater Safety Pack item from every ticket.

Setup

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Add the Offshore checkbox:

    1. From Setup, enter object in the Quick Find box, then select Objects.

    2. Click Job.

    3. Under Custom Fields & Relationships, click New.

    4. Select Checkbox and click Next

    5. In Field Label, enter Offshore.

    6. Click Next.

    7. Click Visible twice and then click Next.

    8. Select the page layouts on which to include the checkbox and click Save

    9. Grant permissions for the checkbox.

  4. Add a rule:

    1. Open the price book for which to add the rule.

    2. Under Rules, click New Rule.

    3. In Rule Name, enter Offshore.

    4. In Criteria, enter the following:

      FX5__Job__r.Offshore__c=true
    5. In Applies To, add "Ticket__c" to Chosen.

    6. Select Is Active and click Save.

  5. Add a rule action:

    1. Under Rule Actions, click New Rule Action.

    2. In Price Book Item, select Deepwater Safety Pack.

    3. In Type, select Required.

    4. Select Is Active and click Save.

  6. Run a script for the Offshore checkbox:

    1. Access Workbench.

    2. Select Utilities | Apex Execute.

    3. Enter the following script:

      System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null));
    4. 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,

  • Adds the Disposal Charge item to every ticket.

  • Prevents removal of the Disposal Charge item from any ticket.

Deselect Disposal Included for a ticket,

  • Removes the Disposal Charge item from every ticket.

Setup

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Add the Disposal Included checkbox:

    1. From Setup, enter object in the Quick Find box, then select Objects.

    2. Click Ticket.

    3. Under Custom Fields & Relationships, click New.

    4. Select Checkbox and click Next.

    5. In Field Label, enter Disposal Included and click Next.

    6. Click Visible twice and click Next.

    7. Select the page layouts on which to include the checkbox and click Save.

    8. Grant permissions for the checkbox.

  4. Add a rule:

    1. Open the price book for which to add the rule.

    2. Under Rules, click New Rule.

    3. In Rule Name, enter Disposal Included.

    4. In Criteria, enter the following:

      Disposal_Included__c=true
    5. In Applies To, add "Ticket__c" to Chosen.

    6. Select Is Active and click Save.

  5. Add a rule action:

    1. Under Rule Actions, click New Rule Action.

    2. In Price Book Item, select Disposal Included.

    3. In Type, select Required.

    4. Select Is Active and click Save.

  6. Run a script for the Disposal Included checkbox:

    1. Access Workbench.

    2. Select Utilities | Apex Execute.

    3. Enter the following script:

      System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null));
    4. 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…​

Select Offshore for a job and enter a BHT less than "500" for a ticket,

  • Adds the SlimXtreme Slimhole HPHT Logging Platform item to every ticket.

  • Prevents removal of the SlimXtreme Slimhole HPHT Logging Platform item from any ticket.

Deselect Offshore for a job,

  • Removes the SlimXtreme Slimhole HPHT Logging Platform item from every ticket.

Enter a BHT more than "500" for a ticket,

  • Removes the SlimXtreme Slimhole HPHT Logging Platform item from the ticket.

Setup

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Add the Offshore checkbox:

    1. From Setup, enter object in the Quick Find box, then select Objects.

    2. Click Job.

    3. Under Custom Fields & Relationships, click New.

    4. Select Checkbox and click Next.

    5. In Field Label, enter Offshore click Next.

    6. Click Visible twice and click Next.

    7. Select the page layouts on which to include the checkbox and click Save.

    8. Grant permissions for the checkbox.

  4. Add the BHT field:

    1. From Setup, enter object in the Quick Find box, then select Objects.

    2. Click Ticket.

    3. Under Custom Fields & Relationships, click New.

    4. Select Number and click Next

    5. In Field Label, enter BHT and click Next.

    6. Click Visible twice and click Next.

    7. Select the page layouts on which to include the field and click Save.

    8. Grant permissions for the field.

  5. Add a rule:

    1. Open the price book for which to add the rule.

    2. Under Rules, click New Rule.

    3. In Rule Name, enter BHT <500.

    4. In Criteria, enter the following:

      FX5__Job__r.Offshore__c=true && BHT__c<500
    5. In Applies To, add "Ticket__c" to Chosen.

    6. Select Is Active and click Save.

  6. Add a rule action:

    1. Under Rule Actions, click New Rule Action.

    2. In Price Book Item, select SlimXtreme Slimhole HPHT Logging Platform.

    3. In Type, select Required.

    4. Select Is Active and click Save.

  7. Run a script for the Offshore and BHT fields:

    1. Access Workbench.

    2. Select Utilities | Apex Execute.

    3. Enter the following script:

      System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null));
    4. 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

  • Adds the Depth Charge 0-1000 ft item to the ticket as a child item to the Run ticket item.

  • Prevents removal of the Depth Charge 0-1000 ft item from the ticket.

Enter a Depth more than "1000" for the Run ticket item,

  • Removes the Depth Charge 0-1000 ft item from the ticket.

Setup

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Add a Run catalog item:

    1. Open the Catalog Items tab.

    2. Click New.

    3. In Item Code, enter "Run".

    4. In Description, enter Run for wireline jobs.

    5. In Sequence Number, enter a sequence number to use for the item.

    6. In Ticket Item Record Type, select a relevant option such as "Services".

    7. Click Save.

  4. Add a Run price book item:

    1. Under Price Book Items, click New Price Book Item.

    2. In Price Book, select the price book for which to add the rule.

    3. In Default Quantity, enter 1.

    4. In Included Quantity, enter 0.

    5. Click Save.

  5. Add a Depth Charge 0-1000 ft catalog item:

    1. Open the Catalog Items tab.

    2. Click New.

    3. In Item Code, enter DC<1000.

    4. In Description, enter Depth Charge 0-1000 ft.

    5. In Sequence Number, enter a sequence number to use for the item.

    6. In Ticket Item Record Type, select a relevant option such as "Services".

    7. Click Save.

  6. Add a Depth Charge 0-1000 ft price book item:

    1. Under Price Book Items, click New Price Book Item.

    2. In Price Book, select the price book for which to add the rule.

    3. In Default Quantity, enter 1.

    4. In Included Quantity, enter 0.

    5. In Price, enter the price to charge for runs less than 1000 feet.

    6. Click Save.

  7. Add the Depth field to the Ticket Item object:

    1. From Setup, enter object in the Quick Find box, then select Objects.

    2. Click Ticket Item.

    3. Under Custom Fields & Relationships, click New.

    4. Select Number.

    5. Click Next.

    6. In Field Label, enter Depth and click Next.

    7. Click Visible twice and click Next

    8. Select the page layouts on which to include the field and click Save

    9. Grant permissions for the field.

  8. Add a rule:

    1. Open the price book for which to add the rule.

    2. Under Rules, click New Rule.

    3. In Rule Name, enter Depth Charge <1000.

    4. In Criteria, enter the following formula:

      Depth__c <1000
    5. 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.

    6. In Applies To, add "Ticket__c" to Chosen.

    7. Select Is Active and click Save

  9. Add a rule action:

    1. Under Rule Actions, click New Rule Action.

    2. In Price Book Item, select Depth Charge 0-1000 ft.

    3. In Type, select Required.

    4. Select Is Active and click Save

  10. Run a script for the Depth field:

    1. Access Workbench.

    2. Select Utilities | Apex Execute.

    3. Enter the following script:

      System.debug(FX5.FXWorkerLauncher.DoWork('FX5.CustomFieldInfoHandler', null));
    4. Click Execute.