function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ktmktm 

Formula to insert date lead is transferred from one user to another based on role

I need to track the date a lead is transferred from one group to another so I have created a custom formula field (date) and think the formula should be something like:

IF ( ISPICKVAL(  $User.UserType,  "Sales Exec" ),TODAY())

Am I on the right track?
Steve :-/Steve :-/
You may want to try using ISCHANGED to evaluate the UserType field.  The $User parm refers to the current user who is viewing/editing the record, not the User(owner).

Code:
ISCHANGED
Description:  Compares the value of a field to the previous value and returns TRUE if the values are different. If the values are the same, this function returns FALSE.
Use:  ISCHANGED(field) and replace field with the name of the field you want to compare.
Validation Rule Example:  The following validation rule prevents users from changing an opportunity name after it has been created: NOT(ISCHANGED( Name )).

NOT(AND( ISCHANGED( Priority ), ISPICKVAL( Priority , "Low") ) ) is a validation rule that ensures if a user changes the Priority of a case, the new priority cannot be "Low."
NOT( AND( ISCHANGED( CloseDate ), ​OR( MONTH(CloseDate ) <> MONTH( TODAY() ),​YEAR( CloseDate) <> YEAR(TODAY()) ),$Profile.Name <> "Sales Manager")) is a validation rule that prevents a user from changing the Close Date of an opportunity to a date outside of the current month and year unless that user has the "Sales Manager" profile.
Note
$Profile merge fields are only available in Enterprise, Unlimited, and Developer Editions.
Tips:  

    * This function is available only in:
          o Assignment rules
          o Validation rules
          o Field updates
          o Workflow rules if the trigger type is set to Every time a record is created or edited.
    * Use the NOT function to reverse the return values of TRUE and FALSE.
    * This function returns FALSE when evaluating any field on a newly created record.
    * If a text field was previously blank, this function returns TRUE when it contains any value.
    * If a number, percent, or currency field was previously blank, the function returns TRUE. If a number, percent, or currency field was previously zero and the new value is blank, this function returns TRUE.
    * For number percent, or currency fields, this function returns TRUE when:
          o The field was blank and now contains any value
          o The field was zero and is now blank
          o The field was zero and now contains any other value