Change Lead "created date" when assign it to user

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Riad
    Member
    • Aug 2018
    • 33

    #1

    Change Lead "created date" when assign it to user

    Hello,
    1- I want to Change Lead "created date" when assign it to user. So the created date of the Lead will be the same date of assign.
    2- As Admin with mass update want to make lead unfollow for any user I want. (Can change lead Followers)
    Thank you
    Last edited by Riad; 04-09-2025, 01:41 PM.
  • rabii
    Active Community Member
    • Jun 2016
    • 1288

    #2
    1- you can use before script formula under Administration > entity manager > lead > formula > before save custom script (use the code below)

    PHP Code:
    if(entity\isAttributeChanged('assignedUserId') && assignedUserId) {
        
    createdAt datetime\now();


    This code will update the created at date to now() date once the assigned user is changed and there is an assigned user.

    2- check this out it might help

    Hello, We had a user ask us if we were able to mass unfollow accounts and contacts for them as they don't have the ability to unfollow except one by one. Thank you!
    Rabii
    Here to help :)

    Comment


    • rabii
      rabii commented
      Editing a comment
      The if(){} has been introduced in version 7.4 so any version below this you should use the old formula ifThen instead. check documentation.

    • Riad
      Riad commented
      Editing a comment
      Can you type the the correct formula for v. 7 Please. Thank you

    • Riad
      Riad commented
      Editing a comment
      ifThen(
      and(
      entity\isAttributeChanged('assignedUserId'),
      assignedUserId
      ),
      createdAt = datetime\now()
      )

      This not work
  • lazovic
    Super Moderator
    • Jan 2022
    • 974

    #3
    Hi Riad,

    Please try to use the following formula script:
    Code:
    ifThen(
      entity\isAttributeChanged('assignedUserId') && assignedUserId,
      createdAt = datetime\now()
    );

    Comment

    Working...