Update parent task after child deletion

neelamallik
Tera Contributor
Hi Team, I'm unable to see any changes on Task table and how to check parent
 task could you please clarify this one
(function executeRule(current, previous /*null when async*/) {

    if (current.parent) {
        var parentTask = new GlideRecord('task');
        if(parentTask.get(current.parent)) {
            parentTask.child_count = (parentTask.child_count || 1) - 1;
            parentTask.update();
        }
    }
})(current, previous);
0 REPLIES 0