Samm
(Arash Farmagham)
March 5, 2019, 5:42pm
1
At the beginning I thought it would be easy to do it, I tried tracing to see what Epicor does and apparently they launch it through menu ID.
Lets say you want to launch this form through a custom form by passing order number and/or any other required info.
Anyone knows how to achieve this?
Thanks a lot in advance
WildERP
(Jim Rogers)
March 5, 2019, 5:57pm
2
If you want this screen to come up then you will have to use LaunchFormOptions to pass in the sales order number and populate it into the filter.
If you just want to print the sales order acknowledgement through code, then you can bypass this screen all together.
1 Like
tsmith
(Tyler Smith)
March 5, 2019, 6:15pm
3
Here’s a good example of printing the SOA using code without opening the form:
I’ve not printed a report from code before, so seeing this thread I gave it a go myself using code supplied above with a bit of tweaking: private void btnPrintSOA_Click(object sender, System.EventArgs args) { //Invoke the BO...
2 Likes
Samm
(Arash Farmagham)
March 5, 2019, 7:23pm
4
Yes I’d like the form to show up but haven’t yet figured out how to use the LaunchFormoptions…
Any further info would greatly be appreciated
tsmith
(Tyler Smith)
March 5, 2019, 7:45pm
6
This example opens a BAQ report form, but it should be fairly similar to the SO Ack form. If you need to store multiple pieces of data, you can create a List and store that into the ContextValue property.
Storing the data before opening the new form:
private void btnPrintBOL_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
if (edvUD101.Row > -1)
{
PrintBillOfLading(Convert.ToInt32(edvUD101.dataView[edvUD101.Row]["Key1"]));
}
}
private void PrintBillOfLading(int bolNum)
{
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.ContextValue = bolNum;
lfo.IsModal = true;
ProcessCaller.LaunchCallbackForm(oTrans, "CustBOLP", lfo);
}
To retrieve the data:
private void BAQReportForm_Load(object sender, EventArgs args)
{
// Add Event Handler Code
if (BAQReportForm.LaunchFormOptions != null)
{
if (BAQReportForm.LaunchFormOptions.ContextValue != null)
{
EpiDataView param = (EpiDataView) oTrans.EpiDataViews["ReportParam"];
param.dataView[param.Row].BeginEdit();
param.dataView[param.Row]["Field1"] = BAQReportForm.LaunchFormOptions.ContextValue;
param.dataView[param.Row].EndEdit();
oTrans.NotifyAll();
}
}
}
1 Like
Samm
(Arash Farmagham)
March 5, 2019, 7:45pm
7
This works great and thanks for posting, but I need to display the form to our users.
Samm
(Arash Farmagham)
March 5, 2019, 10:05pm
8
What dll reference do I have to add in order to use “LaunchFormOptions”?
Banderson
(Brandon Anderson)
March 5, 2019, 10:15pm
9
@Samm , this line of code launches the form. If you leave off the lfo part, it will launch it blank/empty. If you do the rest of the work to get the data, it will launch the form with the variables filled it.
1 Like
tsmith
(Tyler Smith)
March 5, 2019, 11:46pm
10
You should be able to use it without any extra references.
1 Like
Samm
(Arash Farmagham)
March 6, 2019, 4:15pm
11
Thanks a lot!! It works perfectly.
I also had to add code in the SalesOrderAck form to read the options context id and copy it into the report data view.
Thanks again everyone
1 Like