for various reasons, I need to be able to move groups of tasks from one parent task to another.
i created the function: set task
function set_task_of(item) {
var copy = item.copy({handlers: false}),
selections = item.selections;
if (selections.length > 1000) {
item.alert('Too many records selected.');
}
else if (selections.length || item.rec_count) {
if (selections.length === 0) {
selections = [item.id.value];
}
copy.set_fields(['project', 'task_of']);
copy.open({open_empty: true});
copy.edit_options.title = 'Set Task of to ' + selections.length + ' record(s)';
copy.edit_options.history_button = false;
copy.edit_options.required = true;
copy.on_edit_form_created = function(c) {
c.edit_form.find("#item_text").hide();
c.edit_form.find('#ok-btn').off('click.task').on('click', function() {
try {
c.post();
item.server('set_task_of', [c.task_of.value, selections], function(res, error) {
if (error) {
item.alert_error(error);
}
if (res) {
item.selections = [];
item.refresh_page(true);
c.cancel_edit();
item.alert(selections.length + ' record(s) have been modified.');
}
});
}
finally {
c.edit();
}
});
};
copy.append_record();
}
}
now, in the lookup that pops up on the task-of, I would like to filter by project....
but i can't do it..
some suggestion?