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
syed2ibrahim
(syed ibrahim mohamed jalaludeen)
November 29, 2021, 9:08am
2
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:
It seems that I’m missing something and I cannot figure it out. Please help. Thanks.
fakhruddin
(fakhruddin husain)
February 1, 2022, 4:43am
4
Try to get invoice value from view not textfield as your field is binded field.
syed2ibrahim
(syed ibrahim mohamed jalaludeen)
February 2, 2022, 6:10am
5
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.