How You Compare Old and New State of Fields

You can compare and contrast old or existing values in the database with new values. The new values are changes just entered by the user, which are still in transaction and not submitted yet.

You can use this comparison to specify conditions on validation and defaulting rules. For example, you can add a condition in a rule to not allow salary change over 50%, if a job changes from exempt to non-exempt (this data is obtained from a descriptive flexfield). These are the 3 methods to compare the old and new state of fields.

Method

Description

Field Level Validation Rule

This is a quick way to compare old and new values in a single field. You can only compare old and new values, but not any related attributes about the old or new values in the field. This can only be helpful for numeric fields to allow percent change type calculations.

Field or Object Level Validation Rule

You can use a Boolean variable isFieldModified and provide the name of any field on the current object to check if it has changed. The variable will only confirm if something has changed but can't list the exact changes. Also, depending on the type of action (new versus change), this may or may not be useful. For Change Salary, you can use this field to determine if the start and end date of the inserted record has changed. This will ensure your rule only triggers on the newly inserted record and not on the already existing rows. Existing rows are also updated as they may either be end-dated or get a new start date based on the period for which you're changing salary.

For example, for a new hire, you can check if the user has changed the application default values or entered something in an empty but optional field. However, in most date-effective changes such as Promote or Transfer, since a new date effective assignment record is created, the earlier existing values of various fields are copied to the new record. Technically, every field is modified. The Boolean variable will return true and can't determine if a genuine user initiated change has been made to the field or not.

Special access to existing Employment related objects

In the Work Assignment object, a special related object, row variable of variant 2 exists to fetch the existing state of assignment prior to the current action in progress. This is the most effective way to confirm changes, if any, and the exact values along with the necessary lookup information from the existing state. Similar access is extended to other employment related objects from the Worker Assignment and When and Why objects. This is so that you can sample your necessary criteria for a default or validation rule.