Hi!
How can I remove âCreate an inviteeâ field from the create meeting form?
Thanks!
Hi!
How can I remove âCreate an inviteeâ field from the create meeting form?
Thanks!
It seems to be dynamically generated here
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
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!
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
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/