Announcement

Collapse
No announcement yet.

Default team overrides, how to make it right?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default team overrides, how to make it right?

    Hi!
    For all records that are being created I would like to add a team "TEAM ALL"
    at the same time, some users they are in the "TEAM B", so when they are creating a record, I expect the record to have both teams on it.

    As of now, I added Entity Manager->Contacts->Teams->Default team "TEAM ALL"
    Also some users have their own teams, User->default team->"TEAM B"

    But when the user creates a contact, we are having "TEAM ALL" only, what would be the proper way to achieve the goal? Thanks

  • #2
    Using Formula, if not then use Workflow which is even more powerful than Formula.

    Here how I assigned my "User", which is different from team but same concept. I use Formula by the way:

    entity\setAttribute('parentType', 'Case'), 'parentId', id, 'assignedUserId', 'theuseridgoeshere012031023')

    But considering you want to do it on Create, you might want to combine it with

    entity\isNew()

    Comment


    • #3
      Russ,

      - Do you want when User A (who is a member of TEAM ALL and TEAM B) creates a contact, both of User A's teams are displayed in the Teams field (screenshot 1)?
      - Or do you just want User A to be able to self-select TEAM ALL and TEAM B in the Teams field (screenshot 2)?
      Attached Files

      Comment


      • #4
        Originally posted by espcrm View Post
        Using Formula, if not then use Workflow which is even more powerful than Formula.

        Here how I assigned my "User", which is different from team but same concept. I use Formula by the way:

        entity\setAttribute('parentType', 'Case'), 'parentId', id, 'assignedUserId', 'theuseridgoeshere012031023')

        But considering you want to do it on Create, you might want to combine it with

        entity\isNew()
        Hi, thanks, will this line provide 1 or 2 teams? I need 2, one default for the field, another default for the user, both to be attached

        Comment


        • #5
          Thanks
          Originally posted by victor View Post
          Russ,
          - Do you want when User A (who is a member of TEAM ALL and TEAM B) creates a contact, both of User A's teams are displayed in the Teams field (screenshot 1)?
          I want the record to have 2 teams on it. Automatically, no action required. If user has default team "Team B" and field has a default team "Team All", when that user creates a new record, expecting the system to automatically add 2 teams to the record, I will accept any solution, formulas, etc, but add 2 teams Thanks

          Comment


          • #6
            Russ,

            You can try the following formula:
            Code:
            ifThen(
                entity\isNew() && assignedUser.defaultTeamId == '_____TEAM_B_id_____',
                teamsIds = array\push(teamsIds, '_____TEAM_B_id_____', '_____TEAM_ALL_id_____')
                );​
            • _____TEAM_B_id_____ is the id of TEAM B, which is selected as the Default team in your User's profile (screenshot 1).
            • _____TEAM_ALL_id_____ is the id of TEAM ALL, which should be in the Teams field together with TEAM B in your User profile (screenshot 2).​
            The fact is that this formula will work only AFTER the record (contact) is created, and not at the time of its creation (screenshot 3).
            Attached Files
            Last edited by victor; 05-26-2023, 10:11 AM.

            Comment

            Working...
            X