Optimizing Gantt Chart Data Columns in D365 for Enhanced Production Management
April 29, 2025
By: Jake Zenick
This covers how to re-order and add new data columns to the gantt chart production grid – specifically we will be adding “Product Name” and “Action Date” to the grid, removing “To Date” and replacing resource with “Item Number”.
- The first thing we need to do is add our ActionDate, ItemId, and ProductName fields to a table extension of the GanttTmpWrkCtrJob table.
- Once this is done we will need two class extensions.
- The first class extension will be of the GanttTable_WrkCtrJob, we will be doing 3 COC extensions and adding 1 new method.
* The new method we are adding will get us the action date so we can use it on our gantt chart.[ExtensionOf(classStr(GanttTable_WrkCtrJob))]
final class GanttTable_WrkCtrJob_Extension
{
private ActionDate getActionDate()
{
ReqTrans reqTrans;
ReqPlanVersion reqPlanVersion;
select firstonly reqTrans
where reqTrans.ActionMarked == NoYes::Yes
&& reqTrans.RefId == ganttTmpWrkCtrJob.RefId
&& reqTrans.ItemId == ganttTmpWrkCtrJob.ItemId
exists join reqPlanVersion
where reqPlanVersion.RecId == reqTrans.PlanVersion
&& reqPlanVersion.ReqPlanId == ganttTmpWrkCtrJob.ReqPlanId;
return reqTrans.RecId != 0 ? reqTrans.displayActionDate() : dateNull();
}
} - Once that is done we can add our 3 COC methods to set our values on the temp table for displaying on the gantt chart grid.
* The first two methods we need to extend are initFromProdTable and initFromReqPO as sopublic void initFromProdTable([ProdTable _prodTable)
{
next initFromProdTable(_prodTable);
ganttTmpWrkCtrJob.ItemId = _prodTable.ItemId;
ganttTmpWrkCtrJob.ProductName = InventTable::find(_prodTable.ItemId).productNameInUserLanguage();
ganttTmpWrkCtrJob.ActionDate = this.getActionDate();
}
public void initFromReqPO(ReqPO _reqPO)
{
next initFromReqPO(_reqPO);
ganttTmpWrkCtrJob.ItemId = _reqPO.ItemId;
ganttTmpWrkCtrJob.ProductName = InventTable::find(_reqPO.ItemId).productNameInUserLanguage();
ganttTmpWrkCtrJob.ActionDate = this.getActionDate();
}
- The first class extension will be of the GanttTable_WrkCtrJob, we will be doing 3 COC extensions and adding 1 new method.
- The final COC extension in this class will be for setting our action date when the plan is selected is changed with an extension of setReqPlanId
public void setReqPlanId(ReqPlanId _reqPlanId)
{
next setReqPlanId(_reqPlanId);
if (!ganttTmpWrkCtrJob.ActionDate)
{
ganttTmpWrkCtrJob.ActionDate = this.getActionDate();
}
} - For the second and final class extension we will extend the GanttControlVisualization_WrkCtr class with 3 COC methods to actually insert our new column names and data values into the grid
- The first method we will extend will be getConfiguration so we can expand the total grid size to be a little bigger and fit all of our new values
[ExtensionOf(classStr(GanttControlVisualization_WrkCtr))]
final class GanttControlVisualization_WrkCtr_Extension
{
public GanttControlConfiguration getConfiguration()
{
GanttControlConfiguration ret = next getConfiguration();
ret.parmGridWidth(800);
return ret;
}
} - The second method extension will be on getColumns where we will add the EDT types to set our column names widths in the grid
public List getColumns()
{
List col = next getColumns();
col = new List(types::class);
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, RefId), 120, true));
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, OprNum), 60, true));
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, JobType), 80, true));
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, ItemId), 100, true));
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, ProductName), 240, true));
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, SchedFromDateTime), 150, true));
col.addEnd(GanttControlColumn::newParameters(fieldPName(GanttTmpWrkCtrJob, ActionDate), 150, true));
return col;
} - The final method we will extend is getColumnTexts which we will override to set our new column data values
protected List getColumnTexts(GanttTmpWrkCtrJob _ganttTmpWrkCtrJob)
{
List col = next getColumnTexts(_ganttTmpWrkCtrJob);
col = new List(Types::String);
col.addEnd(_ganttTmpWrkCtrJob.RefId);
col.addEnd(int2Str(_ganttTmpWrkCtrJob.OprNum));
col.addEnd(enum2Str(_ganttTmpWrkCtrJob.JobType));
col.addEnd(_ganttTmpWrkCtrJob.ItemId);
col.addEnd(_ganttTmpWrkCtrJob.ProductName);
col.addEnd(strFmt('%1', DateTimeUtil::applyTimeZoneOffset(_ganttTmpWrkCtrJob.SchedFromDateTime, DateTimeUtil::getUserPreferredTimeZone())));
col.addEnd(strFmt('%1', DateTimeUtil::newDateTime(_ganttTmpWrkCtrJob.ActionDate, 0, DateTimeUtil::getUserPreferredTimeZone())));
return col;
}
- The first method we will extend will be getConfiguration so we can expand the total grid size to be a little bigger and fit all of our new values
- Now after a build and sync our gantt chart data columns will be updated

In conclusion, optimizing Gantt chart data columns in D365 significantly enhances production management by improving visualization and functionality. By adding key fields such as "Product Name" and "Action Date" to the grid, and replacing "To Date" with "Item Number," you can streamline your workflow and ensure more accurate data representation. The step-by-step process of extending the GanttTmpWrkCtrJob table and modifying class methods provides a comprehensive approach to achieving these improvements. With these changes, your production management system will be better equipped to handle complex tasks and deliver more efficient results.
Interested in learning more about how Strabo Partners can be your implementation partner? Contact us today!