Hi. I'm working with InventBatchIdLookup form which three different tabs containing different grids and different datasources.
My focus here is only on the first two tabs, Batch number tab & On-hand tab.
Batch numbers tab datasource is from InventBatch table.
On-hand tab datasource is from InventDim table.
I added two fields from InventBatch table inside On-hand tab grid.
My problem is, these Best Before Date & Manufacturing Date is only displayed when I open the On-hand tab from Batch numbers tab.
If I open the On-hand tab directly as shown in the picture, the fields will be blank. Only when I switch to Batch numbers tab then switch to On-hand tab again will the values be displayed.
Honestly I don't know where to start. I figured this could be refresh issue and this tabChanged() method is where it's is happening but I don't know what to change or override.
public void tabChanged(int _fromTab, int _toTab) { super(_fromTab, _toTab); mustSaveLast = true; element.setSelectMode(); if (_toTab == #tabPageReference) { element.selectMode(inventDimTrans_inventBatchId); inventDimTrans_inventBatchId.setFocus(); inventTrans_ds.executeQuery(); } else { if (filterLookup) { selectedFormDataSource.research(); } SysTableLookup::lookupTabChanged(callerControl, selectedControl, selectedFormDataSource); } }
void setSelectMode() { void setSelectedControlAndDataSource(FormStringControl _selectedControl, FormDataSource _selectedFormDataSource) { selectedControl = _selectedControl; selectedFormDataSource = _selectedFormDataSource; } if (inventDimFormSetup.hasCallerItemId()) { switch (tab.tab()) { case 2 : this.selectMode(inventDim_inventBatchId); inventDim_inventBatchId.setFocus(); setSelectedControlAndDataSource(inventDim_inventBatchId, inventDim_ds); break; case 3 : this.selectMode(inventDimTrans_inventBatchId); inventDimTrans_inventBatchId.setFocus(); setSelectedControlAndDataSource(inventDimTrans_inventBatchId, inventDimTrans_ds); break; case 1 : default : this.selectMode(ctrlInventBatch_inventBatchId); ctrlInventBatch_inventBatchId.setFocus(); setSelectedControlAndDataSource(ctrlInventBatch_inventBatchId, inventBatch_ds); } } else { this.selectMode(ctrlInventBatch_inventBatchId); setSelectedControlAndDataSource(ctrlInventBatch_inventBatchId, inventBatch_ds); } }
Can you help explain what's actually going on with these tabs? Thank You very much.
*This post is locked for comments