In meetings module, how can I set the value of the field:“assign to user” into none by default?
Currently, when about to schedule a meeting, the field is automatically filled/assigned to the one who has about to create it.
It should not have any value until we selected a user to be assigned to it.
Navigate to /custom/modules/Meetings/views/
and create view.edit.php
so it becomes /custom/modules/Meetings/views/view.edit.php
In the view.edit.php file, enter the following code:
<?php
class MeetingsViewEdit extends ViewEdit
{
function display() {
//JS to make Assigned to field blank by default
$jsscript = <<<EOQ
<script>
$('#assigned_user_name').val("");
</script>
EOQ;
parent::display();
if(empty($this->bean->fetched_row['id'])) { // If record is being created, not edited
echo $jsscript; //echo the script
}
}
}
After this, Run a Quick Repair & Rebuild in your CRM and clear your browser’s cache.
You should now have a blank “Assigned to” field when scheduling a meeting.
I think for it to work with Importing, you’d be able to either write a Logic Hook or create a Workflow to change the value of the “Assigned to” field.
However, as far as I know, there is no way to distinguish whether or not the record being saved is from Import or from the Editview.
A workaround for this may be to create a checkbox field to signify whether the record was created via Import, and then the Workflow/Logic Hook could pick up on that.
Otherwise, any Logic Hooks or Workflows would likely run on all meetings, not just imported ones.