Custom code: Material Queue Entry form not displaying data in transaction

Hi All,

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

Any ideas on what I might be missing?

Giving it a bump in case anyone has any ideas.

Looks you need to instanciate that form with an EpiTransaction

I think you may need to pass in mtlqTran, not oTrans to that form (after its all set up)

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.

Here is is how epicor instanciates it

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))
							{
...

Thanks for all the help Chris.
It turns out I had to set the row to 0. It was set to -1.
((EpiDataView)mtlqTran.EpiDataViews[“IssueReturn”]).Row = 0

In my specific case, there will only ever be one row.