Workflow to add Teams for all attendees users of Meetings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LukasShultz
    Junior Member
    • Jun 2021
    • 7

    Workflow to add Teams for all attendees users of Meetings

    Hello,
    I have selected permission for meetings: read: teams.
    I would like to user could see meetings if they are in attendees users of meetings.

    I create workflow that add teams all attendees user of Meetings but it doesn't work. Could someone help?
    PHP Code:
    $idMyUsers = list(UsersIds);
    
    ifThen(
    $idMyUsers,
    (
    $idMyTeam = record\attribute('User', $idMyUsers, 'teamsIds');
    
    ifThen(
    $idMyTeam,
    (
    entity\addLinkMultipleId(
    'teams',
    $idMyTeam
    );
    )
    );
    )
    ); 
    
  • alter
    Member
    • Apr 2018
    • 57

    #2
    Hi, I'm not sure what exactly you are trying to achieve. Do you want users to see it in shared calender, or you want automatically add users to Attendees from the team you would set on meeting? Thank you.

    Comment

    • LukasShultz
      Junior Member
      • Jun 2021
      • 7

      #3
      alter thanks for your interest in the topic.
      I would like the user who was added to the meeting as an 'attended user' to be able to see the entire content of this meeting with permissions read: team

      Comment

      • LukasShultz
        Junior Member
        • Jun 2021
        • 7

        #4
        Somone have any idea where I made mistake?

        Comment

        • Katia
          Junior Member
          • Jul 2021
          • 20

          #5
          Hi Lukas,
          I guess you used wrong values that's why it isn't working.
          You can use Workflow Actions > Update Related Record. Then Link: Users > Teams and in value choose the team which you need.
          After this all the users added to the Attendees will be added to the Team you indicated.

          Comment

          • item
            Active Community Member
            • Mar 2017
            • 1476

            #6
            Hello,

            //getMettingId
            $meetingId = entity\attribute('id');
            //getRelatedUsers
            $userIds=record\findRelatedMany('Meeting', $meetingId, 'users', 50);
            $i = 0;
            //loop on all userIds
            while($i < array\length($userIds),
            //getUserId
            $userId = array\at($userIds, $i);

            after.. i don't know
            If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

            Comment

            • LukasShultz
              Junior Member
              • Jun 2021
              • 7

              #7
              Originally posted by Katia
              Hi Lukas,
              I guess you used wrong values that's why it isn't working.
              You can use Workflow Actions > Update Related Record. Then Link: Users > Teams and in value choose the team which you need.
              After this all the users added to the Attendees will be added to the Team you indicated.
              Hi Katia,
              I think I wrote not too clearly. I would like the Team to which the user belongs to be added to the Teams in the Meeting. Like on screen.

              Comment

              • LukasShultz
                Junior Member
                • Jun 2021
                • 7

                #8
                Originally posted by item
                Hello,

                //getMettingId
                $meetingId = entity\attribute('id');
                //getRelatedUsers
                $userIds=record\findRelatedMany('Meeting', $meetingId, 'users', 50);
                $i = 0;
                //loop on all userIds
                while($i < array\length($userIds),
                //getUserId
                $userId = array\at($userIds, $i);

                after.. i don't know
                Hi item,
                I try like that:
                //$iduzyt = usersIds;
                //description = record\attribute('User', $iduzyt, 'teamsIds');
                //getMettingId
                $meetingId = entity\attribute('id');
                $userIds=record\findRelatedMany('Meeting', $meetingId, 'users', 50);
                $i = 0;
                while($i < array\length($userIds),
                $userId = array\at($userIds, $i);
                $idMyTeam = record\attribute('User', $userId, 'teamsIds');
                entity\addLinkMultipleId('teams', $idMyTeam);
                );

                But it doesn't work :/

                Comment

                Working...