I am trying to display the MaterialQueueEntry.MtlMoveByQueueIDForm at the point in the process when a material queue record is created. In this case, during PO receipt entry.
I have the steps down and the data in the associated transaction object for this form is correct but when I display the form, it is blank.
At a high-level, here is the code I have.
Erp.UI.App.MaterialQueueEntry.MtlMoveTransaction mtlqTran = new Erp.UI.App.MaterialQueueEntry.MtlMoveTransaction(oTrans);
Erp.UI.App.MaterialQueueEntry.MtlMoveByQueueIDForm mtlMoveForm= new Erp.UI.App.MaterialQueueEntry.MtlMoveByQueueIDForm(mtlqTran);
mtlqTran.issueReturnAdapter.BOConnect();
mtlqTran.ScanQueueID(passing in a confirmed valid material queue);
//at this point, both mtlqTran.MtlQueueRowid and mtlqTran.MtlQueueSeq have correct values
mtlqTran.issueReturnAdapter.PreGetNewIssueReturn(mtlqTran.MtlQueueRowid, out pcAction, out pcMessage, out pdQtyAvailable);
mtlqTran.issueReturnAdapter.GetNewIssueReturn("", mtlqTran.MtlQueueRowid, “MaterialQueue”);
mtlqTran.NotifyAll();
//verified that mtlqTran.issueReturnAdapter.IssueReturnData.IssueReturn contains data and is valid
mtlMoveForm.ShowDialog();
//form opens but blank
Thanks Chris.
I am instantiating the form with mtlqTran. I moved the instantiating after mtlqTran is all set but I still have the same issue where the form is blank. What is interesting is that if I click OK, the material queue is processed as normal.
using (MtlMoveForm mtlMoveForm = new MtlMoveForm(mtlMoveTransaction, num2))
{
if (mtlMoveForm.ShowDialog(base.EpiBaseForm) != DialogResult.OK)
{
this.UnlockMtlQueue();
return;
}
if (this.autoRefresh)
{
this.GetData();
return;
}
this.removeRow(text);
return;
}
But earlier they are wrapping some logic inside a MtlMoveTransaction (snippet)
using (MtlMoveTransaction mtlMoveTransaction = new MtlMoveTransaction(this))
{
mtlMoveTransaction.MtlQueueRowid = Guid.Parse(base.LastView.dataView[base.LastView.Row]["SysRowID"].ToString());
mtlMoveTransaction.EpicorFSA = bool.Parse(base.LastView.dataView[base.LastView.Row]["EpicorFSA"
...
this.issueReturnAdapter.PreGetNewIssueReturn(mtlMoveTransaction.MtlQueueRowid, out text2, out text3, out num2);
...
if (mtlMoveTransaction.GetNew())
{
using (MtlMoveForm mtlMoveForm2 = new MtlMoveForm(mtlMoveTransaction))
{
...