Show/Hide Toolbars

In the cases of the record that triggers the qualifier or action and the record with the custom block, you do not need to call the service class to access to the record.

The following table shows whether you use ResourceService classes in qualifiers, actions, and screens.

Services in Qualifiers, Actions, and Screens

Method

Qualifiers and Actions

Custom Screens

read()

(for the initial record)

No

No

create()

No

Yes

update()

No

Yes

new<object>()

(for the new object method in the Service class)

Yes

Yes

Qualifiers and Actions

When you create an automated qualifier or action, the code calls the CustomCondition.condition(M) or CustomAction.action(M) methods. Your code must override these methods, which allows access to the record that triggered the qualifier or action. Because you have access to the record, you do not need to call the service class to read the record.

Rules, wizards, and conditions save all changes automatically. As a result, you do not need to use the create() or update() service methods. To delete an object or create an object using the new<Object>() method in a service class, you must still call the service class for the object.

Custom Screens

When you create a custom block for a record, you use the CustomBlock.getRecord() method to access the record. Because you have access to the record, you do not need to call the service class for the record.

Unlike with automated qualifiers and actions, custom screens do not save automatically. As a result, if you want to create a new record or update the record with the screen, you must use the create() or update() methods. Because create() and update() are ResourceService methods, you must call the service class of the record as part of the code.

For example, if the custom screen is on the contact object definition, but you are not creating a new record or updating an existing contact, you do not need to call ContactService. However, if you want to update a field in the contact record when another field changes, your custom screen code must include the call to ContactService so that you can use the update() method.