Problem adding User Invitees when creating a meeting

I am trying to programmatically invite additional users to a meeting when creating a meeting. However its not working.

Here is the code I use to create a meeting for a Case. I added the user_invitees line thinking that might be all that is needed. This is a comma separated list of user ids I want invited when the meeting is created.

            $meeting = BeanFactory::newBean('Meetings');
            $meeting->name = $bean->name;
            $meeting->date_start = $dateTime;
            $meeting->duration_minutes = (intval($bean->schedule_duration_c) / 60);
            $meeting->assigned_user_id = $bean->assigned_user_id;
            $meeting->assigned_user_name = $bean->assigned_user_name;
            $meeting->description = $bean->name . " - Case assigned to: " . $bean->assigned_user_name;
            $meeting->status = "Planned";
            $meeting->contact_id = $bean->contact_id;
            $meeting->parent_id = $bean->id;
            $meeting->parent_type = 'Cases';
            $meeting->update_vcal  = false;
            $meeting->user_invitees = "619a19b0-4d61-0a33-45fb-633de26eba7a,9e8991a2-b8df-fe5f-2fb0-6304fe418a2d,489560de-6cc7-301c-d3f3-635179155ea5";

Is there something else needed or should I just use a SQL statment:

INSERT INTO meetings_users (id, user_id,meeting_id,accept_status, date_modified) 
VALUES ($id, $userid, $meetingid, 'accept', date())


Ensure you’re filling all the required fields. In your case it seems to be missing the end date.


Even setting the end date does not add the user_invitees.
Do you see any meeting fields that I am missing?


Sorry, don’t know what else to check. I would just use a debugger, step into that save function and see where it’s getting into trouble.


I think that you shouldn’t use variable:


It doesn’t work. You need to add relationship after save the meeting. Try like this:

$user_invitees = array
foreach ($user_invitees as $user_id) 

If you want sending ‘invitation’ or doing ‘accept’ you need add a code.

I don’t recommend to using this:


For information only.
Objects Meeting and Call use function ‘handleSave’ form files ‘modules/Meetings/MeetingFormBase.php’ or ‘modules/Meetings/CallFormBase.php’ for save.

1 Like

Thank you very much. This worked as you mentioned.

I see now that you must save the meeting first and then add users to an existing meeting.