Set task Due Date to Milestone Date

We have a classic screen that calls a BPM when a new task is added and the update button is clicked.

The Data Directive is an In-Transaction Data Directive.

The intent was to apply the due date of the milestone to the new task when a new task was added.

The logic in the custom code loops through the task temp table, then tries to find the details from the TaskSDtl table, do some logic and assigned task.DeDate

From testing I have found the Task temp table row has no TaskSetID nor a TaskSetSeq resutling in no rows returned which makes the result for details null.

Is this not possible in a In-Transaction Data Directive that runs just before writing to the table?

For some processes, the records are first created with blank data, and then immediately after are updated with the data. I’d put in messageboxes that display all the data from all rows in the temp table, find what exactly is happening. You can also do tracing though I don’t usually have much luck with it.