How to Get InvoiceNum and Pass it to BAQ Report Designer

Hello everyone,

We have added a Print button in AR Invoice Tracker and it’s calling the BAQ Report Designer “Print Sales Invoice Form”. How can I get the Invoice No. entered in AR Invoice Tracker and pass it to the BAQ Report Designer so it will automatically fill out the AR Invoice No. field?

Thanks in advance.

Regards and stay safe,
Daisy

Hi @daisygonzales

Good Day!

Change the below code according to your Need

Code from (sending form)

public void btnmtl_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **

	LaunchFormOptions lfo = new LaunchFormOptions();
	lfo.IsModal = false;
	lfo.ValueIn = (tbJobNum.Text + "~" + cboAsmSeq.Value + "~" + cboOper.Value);
	ProcessCaller.LaunchForm(oTrans, "UDPARTAG", lfo);

}

BAQ Report (Receiving form)

public void btnjob_Click(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **


			if(BAQReportForm.LaunchFormOptions != null)
	{
		string val = BAQReportForm.LaunchFormOptions.ValueIn.ToString();

		string[] items = val.Split('~');
		
		string job = items[0];
		string asm = items[1];
		string opr = items[2];

		EpiDataView view = ((EpiDataView)(this.oTrans.EpiDataViews["ReportParam"]));

		view.dataView[view.Row].BeginEdit();
		view.dataView[view.Row]["field1"]= job;
		view.dataView[view.Row].EndEdit();

		view.dataView[view.Row].BeginEdit();
		view.dataView[view.Row]["field2"]= Convert.ToInt32(asm);
		view.dataView[view.Row].EndEdit();

		view.dataView[view.Row].BeginEdit();
		view.dataView[view.Row]["field3"]= Convert.ToInt32(opr);
		view.dataView[view.Row].EndEdit();
		
		oTrans.Update();
	
		txtfield1.Text = job;
		numfield2.Value = Convert.ToInt32(asm);
		numfield3.Value = Convert.ToInt32(opr);


	}	
	else
	{
	}

}
1 Like

Hi @syed2ibrahim thanks for your response. I tried it and it seems that the code for “lfo.ValueIn = (txtInvoice.Text);” is not working. I’m getting this error:

image

It seems that I’m missing something and I cannot figure it out. Please help. Thanks.

Try to get invoice value from view not textfield as your field is binded field.

Hi @daisygonzales ,
EpiDataView edvInvcHead = ((EpiDataView)(this.oTrans.EpiDataViews[“InvcHead”]));
int txtInvoice = Convert.ToInt32(edvInvcHead .dataView[edvInvcHead .Row][“InvoiceNum”]);

or

EpiTextBox txtInvoice = (EpiTextBox)csm.GetNativeControlReference(“22bd4d9e-f149-4794-847a-17e04ecdeeba”);

Add the above code into your invoice button click event.