Auto Scheduling issues

Hi - I have this process where I need to create auto-scheduling based on sort order. What I do to achieve this is I add temporary links in combination with existing links. However I’m getting odd results like this gap in the data when I want task 4 and 5 to be scheduled ASAP. Is this a bug that my older version of Gantt hasn’t resolved?

Hello Skoofy,
It can be that Task #4 has the SNET constraint, so it cannot start earlier that date. By default, the constraints are not displayed, so it may not be clear why the task doesn’t move to the end of its predecessor.
The dev team will fix that issue in the future and add a way to display constraints when the constraint logic is used.
Here is an example:

You can read about auto-scheduling modes in the following article:

If that doesn’t help you, probably the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.
In that case, please add your configuration to the following snippet and make sure that the issue is reproduced there:

Then, click on the Save button and send me the link.
Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.

Is there a way I can simply set all constraints to ASAP to test this?

Hello Skoofy,
If you want to use the constraint logic, you will need to manually modify the constraints before the task is fully updated:

gantt.attachEvent("onBeforeTaskUpdate", function(id,updatedTask){
    updatedTask.constraint_type = "asap";

Here is an example in the snippet:

After you drag a task, it will stay on that date. But as soon as you call the autoSchedule method or drag its predecessor, the task will be auto-scheduled to the predecessor’s end_date.

A simpler way would be to not use the constraint logic at all:

Here is the snippet:

Thanks, ramil. I really had to wrangle this one to get it to suit my requirements.

I just wanted to let you know that I came across a small issue where I had unscheduled tasks as part of a main project. If these unscheduled tasks had no children when I fired autschedule() multiple times it would eventually return a start_date invalid error for those unscheduled tasks. As soon as they were removed everything would work fine. I ended up adding placeholder values for my unscheduled tasks and everything was fine. Just thought I’d let you know.

Hello Skoofy,
Thank you for the additional details. We are aware of the issue that Gantt tries to auto-schedule unscheduled tasks. So, when these tasks don’t have the date parameters, the function returns an error. The dev team will fix that bug in the future.
As a workaround, you can cancel auto-scheduling for these tasks in the onBeforeTaskAutoSchedule event handler: