Formula not working on mass update

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shef
    Member
    • Jul 2018
    • 38

    Formula not working on mass update

    I have a case which is failing to work when mass update is used.

    Prep-work:
    1. Create One-to-One Left relationship with User on Lead entity, set the name assignedBy for the User part.
    2. Add this to Formula of the Lead entity:
    Code:
    ifThen(
    entity\isAttributeChanged('assignedUserId'),
    /* other code that works */; entity\setAttribute('assignedById', entity\attribute('modifiedById'))
    );
    3. Add the Assigned By field to the Lead details or list Layout so you can see the contents of the field visually.

    Test:
    Select multiple leads on the list and then go to Actions -> Mass Update select Assigned User and choose a user you like and then hit Update.

    It fails to update the Assigned By field this way (with Mass Update selecting multiple leads).

    It works for single leads, either selecting single lead and then Mass Update, or going to a specific lead and changing the Assigned User.

    Am I doing something wrong or is this a bug?

  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi there,
    Please describe what is the field 'assigned By' (its type, etc.) so we can reproduce it and investigate the issue. What EspoCRM version do you use?

    Comment

    • smithclarkson02
      Junior Member
      • Jan 2020
      • 1

      #3
      happened with me too, any update...?
      Last edited by smithclarkson02; 08-30-2020, 12:34 AM.

      Comment

      • shef
        Member
        • Jul 2018
        • 38

        #4
        Originally posted by Maximus
        Hi there,
        Please describe what is the field 'assigned By' (its type, etc.) so we can reproduce it and investigate the issue. What EspoCRM version do you use?
        "Assigned By" is the field created by the relationship on step 1 of the Prep-work I have mentioned above. it's a Link One (User) field basically.

        I am on version 5.9.3.

        You just need to follow the Prep-work steps I have mentioned in the first post to get the environment ready for testing.

        Comment

        • shef
          Member
          • Jul 2018
          • 38

          #5
          Hi all, any update/input on this issue?

          Comment

          • Maximus
            Senior Member
            • Nov 2018
            • 2731

            #6
            Hi shef,
            I apologize for the delayed reply.

            I've tested it and it works like a charm. I think that you don't have such an attribute as 'assignedById'. I believe you set the 'assignedBy' name for lable, but your real attribute key is 'userId'.
            Please Investigate my screenshot.
            Also you can define more easier Formula code instead of entity\setAttribute('assignedById', entity\attribute('modifiedById')):
            Code:
            userId = modifiedById
            Attached Files

            Comment

            Working...