Project not updated in server DB

Hello,

if i change the duration of a child from a project in the gui the Project is also changing.
But there is no project change triggered for the database update.
Only the task child is updated in the database.

If i allow for example to drag projects “drag_project = true” and change the project by drag then it is updated in the database.

So how can i trigger a database update from the project if a child duration is changed?

BR
René

Hi @IFM!

Tasks with the “project” type ignore parameters such as start_date, end_date, and duration. Instead, they take data not from the database, but from their child tasks.

If you need to save the dates of “Project” tasks in the database, you can apply the methods like in this snippet:
https://snippet.dhtmlx.com/9fc77aec6

Alternatively, you can check if the task has the parent and update it using onBeforeTaskUpdate event:
https://docs.dhtmlx.com/gantt/api__gantt_updatetask.html
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskupdate_event.html

gantt.attachEvent(“onBeforeTaskUpdate”, function(id,task){
if (task.parent) gantt.updateTask(task.parent);
});

Here is the sample, where you can see how it can be implemented:
http://snippet.dhtmlx.com/d4bafb259

Ok, thanks. Taht helped me.
By the way, if you use AutoSchedule you should use onAfterAutoSchedule otherwise on onBeforeTaskUpdate all task trigger updateTask.

BR
René