Modify create meeting form

Hi!

How can I remove “Create an invitee” field from the create meeting form?

Thanks!

It seems to be dynamically generated here

https://github.com/salesagility/SuiteCRM/blob/e0a0a9cd8ad2f01049ef2d412f024fb435151652/jssource/src_files/modules/Meetings/jsclass_scheduler.js#L339-L421

1 Like

Perfect! Thankyou!

I commented out those lines and it worked, but after doing that, I got a new problem: “Create an invitee” field was gone, like I hoped, but now search button on “Add Invitee” field doesn’t work anymore. It closes the form.

I am a beginner in programming and can’t do much more than copy/paste. I tried more than 5 hours to comment out different lines one by one but nothing worked.

Could somebody help me out a little bit more?

Version 7.9.5 Sugar Version 6.5.24 (Build 509)

See the attachmet. That is what I want to hide/remove.

Instead of commenting out, I would try adding a style of “display: none!important;”

Try it first manually in your browser’s inspector window, and once you know what you’re aiming for, try to get the code to use it.

Could you be more specific? I have no idea, how to use that code :frowning:

I commented out the following lines:


314  // create_invitees.appendChild(h3);
324  // create_invitees_buttons.appendChild(button1);
331  // create_invitees_buttons.appendChild(button2);

Now the “Create an invitee” text and the buttons are gone, but the box is still there. See the attachment.

Any suggestions?

You can leave that uncommented (so that the objects are created) but then add something like this:


create-invitees-buttons.style.display = 'none';

or if that doesn’t work (I didn’t try it), this


document.getElementById('create-invitees-buttons').style.display = 'none';

Do that for all the different elements you’re trying to hide. Normally the browser’s inspector window is a great way to easily find them and experiment with styles. Good luck!

1 Like

This topic is a little older, but replying to it as I’ve experienced a similar issue and this was the only topic that pointed me in the right direction. For anyone else with this issue, I edited following @pgr pointers to hide the Create As Contact / Create As Lead buttons, and keep the ‘Search Contacts’ section working (which will otherwise reload the page if the buttons are just commented-out) for both the Meetings and Calls modules

File at /suitecrm/htdocs/jssource/src_files/modules/Meetings/jsclass_scheduler.js

Backup file to jsclass_scheduler.js.orig or similar

original code:

var h3 = document.createElement("h3");
	h3.setAttribute('id', 'create-invitees-title');
	h3.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_INVITEE'];
	create_invitees.appendChild(h3);

	var create_invitees_buttons = document.createElement("div");
	create_invitees_buttons.setAttribute('id','create-invitees-buttons');

	var button1 = document.createElement("button");
	button1.setAttribute('id', 'create_invitee_as_contact');
	button1.setAttribute('type', 'button');
	button1.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Contacts\');');
	button1.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_CONTACT'];
	create_invitees_buttons.appendChild(button1);

	var button2 = document.createElement("button");
	button2.setAttribute('id', 'create_invitee_as_lead');
	button2.setAttribute('type', 'button');
	button2.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Leads\');');
	button2.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_LEAD'];
	create_invitees_buttons.appendChild(button2);
	create_invitees.appendChild(create_invitees_buttons);

modified code:

var h3 = document.createElement("h3");
	h3.setAttribute('id', 'create-invitees-title');
	h3.setAttribute('style','display: none;'); //Hide title for creation of new invitees
	h3.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_INVITEE'];
	create_invitees.appendChild(h3);

	var create_invitees_buttons = document.createElement("div");
	create_invitees_buttons.setAttribute('id','create-invitees-buttons');

	var button1 = document.createElement("button");
	button1.setAttribute('id', 'create_invitee_as_contact');
	button1.setAttribute('type', 'button');
	button1.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Contacts\');');
	button1.setAttribute('style','display: none;'); //Hide button for Create As Contact
	button1.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_CONTACT'];
	create_invitees_buttons.appendChild(button1);

	var button2 = document.createElement("button");
	button2.setAttribute('id', 'create_invitee_as_lead');
	button2.setAttribute('type', 'button');
	button2.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Leads\');');
	button2.setAttribute('style','display: none;'); //Hide button for Create As Lead
	button2.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_LEAD'];
	create_invitees_buttons.appendChild(button2);
	create_invitees.appendChild(create_invitees_buttons);

Save changes, then in SuiteCRM go Admin > Repair and run both the Repair JS Files and Quick Repair and Rebuild. Clear browser history to clean local cache and you should be ready to go

A note that this change will likely not be upgrade safe. Personally I’d like to see another way to either remove this quick add functionality or customize it. It completely shortcuts any other controls put in place to mandate entry of certain fields during contact creation (in the Full form or the Quick forms), and in an environment where a lot of call entries are made or staff aren’t adequately trained you quickly end up with a lot of empty/useless contacts in the system

This topic is a little older, but replying to it as I’ve experienced a similar issue and this was the only topic that pointed me in the right direction. For anyone else with this issue, I edited following @pgr pointers to hide the Create As Contact / Create As Lead buttons, and keep the ‘Search Contacts’ section working (which will otherwise reload the page if the buttons are just commented-out) for both the Meetings and Calls modules

File at /suitecrm/htdocs/jssource/src_files/modules/Meetings/jsclass_scheduler.js

Backup file to jsclass_scheduler.js.orig or similar

original code:

var h3 = document.createElement("h3");
	h3.setAttribute('id', 'create-invitees-title');
	h3.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_INVITEE'];
	create_invitees.appendChild(h3);

	var create_invitees_buttons = document.createElement("div");
	create_invitees_buttons.setAttribute('id','create-invitees-buttons');

	var button1 = document.createElement("button");
	button1.setAttribute('id', 'create_invitee_as_contact');
	button1.setAttribute('type', 'button');
	button1.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Contacts\');');
	button1.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_CONTACT'];
	create_invitees_buttons.appendChild(button1);

	var button2 = document.createElement("button");
	button2.setAttribute('id', 'create_invitee_as_lead');
	button2.setAttribute('type', 'button');
	button2.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Leads\');');
	button2.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_LEAD'];
	create_invitees_buttons.appendChild(button2);
	create_invitees.appendChild(create_invitees_buttons);

modified code:

var h3 = document.createElement("h3");
	h3.setAttribute('id', 'create-invitees-title');
	h3.setAttribute('style','display: none;'); //Hide title text for creation of new invitees
	h3.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_INVITEE'];
	create_invitees.appendChild(h3);

	var create_invitees_buttons = document.createElement("div");
	create_invitees_buttons.setAttribute('id','create-invitees-buttons');

	var button1 = document.createElement("button");
	button1.setAttribute('id', 'create_invitee_as_contact');
	button1.setAttribute('type', 'button');
	button1.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Contacts\');');
	button1.setAttribute('style','display: none;'); //Hide Create As Contact button
	button1.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_CONTACT'];
	create_invitees_buttons.appendChild(button1);

	var button2 = document.createElement("button");
	button2.setAttribute('id', 'create_invitee_as_lead');
	button2.setAttribute('type', 'button');
	button2.setAttribute('onclick', 'SugarWidgetSchedulerSearch.showCreateForm(\'Leads\');');
	button2.setAttribute('style','display: none;'); //Hide Create As Lead button
	button2.innerHTML = GLOBAL_REGISTRY['meeting_strings']['LBL_CREATE_LEAD'];
	create_invitees_buttons.appendChild(button2);
	create_invitees.appendChild(create_invitees_buttons);

Save changes, then in SuiteCRM go Admin > Repair and run both the Repair JS Files and Quick Repair and Rebuild. Clear browser history to clean local cache and you should be ready to go

A note that this change will likely not be upgrade safe. Personally I’d like to see another way to either remove this quick add functionality or customize it. It completely shortcuts any other controls put in place to mandate entry of certain fields during contact creation (in the Full form or the Quick forms), and in an environment where a lot of call entries are made or staff aren’t adequately trained you quickly end up with a lot of empty/useless contacts in the system

1 Like

Thanks for posting your solution.

It should be upgrade safe if you copy the file to the custom folder and edit that copy:

/suitecrm/htdocs/custom/jssource/src_files/modules/Meetings/jsclass_scheduler.js

You’ll have to try it to see if it works, I’m not sure that mechanism covers jssource stuff.

The generic stuff is explained here: https://pgorod.github.io/Custom-folder/