Print      Open PDF Version of Online Help


Previous Topic

Next Topic

About Conditionally Required Fields

You can set up a field so that it is not required by default but becomes required when a defined condition is met. A field that is set up in this way is referred to as a conditionally required field. For example, you might decide that when a user sets the status of an opportunity to Lost, the user must select a value in the Reason Won/Lost field before saving the record. To implement this process, you can enter the following condition for the Reason Won/Lost field in field management:

[{Status}]=LookupValue("OPTY_STATUS", "Lost")

After you set up the field in this way, if a user selects the Lost status for an opportunity, then the user cannot save the opportunity until a value is selected in the Reason Won/Lost field. A red asterisk (*) displays beside the field, and if the label is displayed for the field, it is displayed in red text.

When setting up a conditionally required field, note the following points:

  • You must make sure that the conditionally required field is displayed on the relevant page layouts. Otherwise, users will not be able to enter a value for the field when it becomes required. Similarly, it is recommended that you select the Always On Layout check box for the conditionally required field in the Page Layout Wizard, so that users cannot remove the field from their page layouts. If some users have already personalized their page layouts, then you might need to reset the personalized page layouts to the default layout after you set up the conditionally required field. For more information, see Resetting Personalized Page Layouts.
  • If you want a conditionally required field to always be required for a certain role, then you can make the field required in the page layout that is used for that role. The field is then required in all cases where that page layout is used, even if the condition that is defined for the field at field level is not met. Where other page layouts are used, the field is required only when the condition is met.

The following table explains the settings for making fields required or conditionally required in field management and in the Page Layout Wizard.

Required Check Box in Field Management

Conditionally Required Field in Field Management

Required Check Box in Page Layout Wizard

Conditionally Required Check Box in Page Layout Wizard

Outcome

Selected

Blank

Selected and read-only

Not selected and read-only

The field is always required.

Not selected

Contains an expression

Not selected and editable

Selected and read-only

NOTE: If you select the Required check box in the Page Layout Wizard, then the Conditionally Required check box is automatically cleared.

The field is required only when the condition that is specified for the field is met, unless you select the Required check box in the Page Layout Wizard.

Not selected

Blank

Not selected and editable

Not selected and read-only

If you select the Required check box in the Page Layout Wizard, then the field is required in all cases where the page layout is used. Otherwise, the field is not required.

Expression Builder Functionality for Conditionally Required Fields

The following limitations apply to the Expression Builder functionality that you can use in the conditions that you create for conditionally required fields:

For more information about using Expression Builder, see Expression Builder.

Limitations When Editing Conditionally Required Fields

Administrators and users must consider the following limitations when editing conditionally required fields:

  • The expression on a conditionally required field can include fields from associated records. For example, in the Contact Detail page you can have a field that is required only when a certain account is associated with the contact record. The expression can include the ID field or the Name field for the account as in the following examples:

    [{Account Id}]="1QA2-1IRPI7"

    [{Primary Account Name}]="ACME Computer Parts"

    When you make Web service or REST API calls to update the record, and the request includes the association, to ensure that the expression in the conditionally required field evaluates correctly, the request must contain the correct field from the associated record. In the contact example, either the ID or Name field, depending on what is configured for the conditionally required field, must be in the request. Alternatively, the request can contain both the ID field and Name field.

  • The expression on a conditionally required field can evaluate read-only fields that are automatically updated when an association between two records is updated, such as the Account Location field on a contact record. However, such a configuration does not work correctly in the following circumstances:
    • If the conditionally required field is currently not required (that is, the expression on the field evaluates to false), and the record is edited inline on the record Detail page, and the update causes the expression on the conditionally required field to evaluate to true. In this case, the conditionally required field continues to be not required.
    • If the conditionally required field is currently required (that is, the expression on the field evaluates to true), and the record is edited in the record Edit page, and the update causes the expression on the conditionally required field to evaluate to false. In this case, the conditionally required field continues to be required.
  • A conditionally required field can use an expression that evaluates custom related information fields. However, when the source field for a custom related information field is updated, there is a very short delay before the value in the custom related information field is automatically updated.

    So, if the expression on a conditionally required field evaluates a custom related information field, the expression might not be evaluated correctly immediately after the source field for the custom related information field is updated.


Published 7/6/2017 Copyright © 2005, 2017, Oracle. All rights reserved. Legal Notices.