AnsweredAssumed Answered

Can't prevent status=completed on 'Close and create new' button in TASKS entity Sugarcrm CE

Question asked by Sergey Sergey on Aug 29, 2014
Latest reply on Aug 31, 2014 by Sergey Sergey
Hello guys!I need help!
My purpose is when user clicked @Close and create new" task, to save only the actual task, without making it 'completed', and open form for editing.
I decided that there is enough to remove the fragment of 'customeCode' in editviewdefs.php, at the tasks/metadata/ . Then i copied my custom editviewdefs.php to custome/modules/Tasks/metadata/
Repair&rebuild

The problem is that after that actions the tasks still become completed. But i need only save current form with existing status and duplicate it.

Any help will be helpful!!! Thanks in advance

The code which i removed from editviewdefs is
document.getElementById(\'status\').value=\'Completed\'; 

And the full code in button "Close and create new"
'customCode' => '{if $fields.status.value != "Completed"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" class="button" onclick="document.getElementById(\'status\').value=\'Completed\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Tasks\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.return_id.value=\'{$fields.id.value}\'; if(check_form(\'EditView\'))SUGAR.ajaxUI.submitForm(this.form);" type="button" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',

Outcomes