# GetNewReportQty after RQForm Load

**URL:** <https://www.epiusers.help/t/getnewreportqty-after-rqform-load/63791>\
**Category:** Epicor ERP 10\
**Tags:** customization\
**Created:** [January 21, 2020, 6:39pm UTC](https://www.epiusers.help/t/getnewreportqty-after-rqform-load/63791 "2020-01-21T18:39:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maverick](https://www.epiusers.help/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@maverick](https://www.epiusers.help/u/maverick)\
**Post date:** [January 21, 2020, 6:39pm UTC](https://www.epiusers.help/t/getnewreportqty-after-rqform-load/63791/1 "2020-01-21T18:39:53Z")

</div>

I am working on a dashboard. The dashboard displays an active labor transaction. From that dashboard am am adding a button “btnRptQty” where when clicked it takes the values on the dashboard and passes them as LaunchFormOptions to the RQForm\_Load. It should call the GetNewReportQty method and pass these values as the parameters.

I am not able to get it working. Getting this error, before the RQForm\_Load triggers)  
Index 0 is either negative or above rows count.

I see that the GetNewReportQty is being called after the RQForm\_Load. My problem is I don’t know how to pass these custom parameters to GetNewReportQty… yet I get an error even before the form loads…

This is the code I have on the dashboard for the Report Quantity button:

```
private void btnRptQty_Click(object sender, System.EventArgs args)
{
    LaunchFormOptions lfo = new LaunchFormOptions();
    
    NameValueCollection collection = new NameValueCollection();
    collection.Add("empID", strEmpID);
    collection.Add("DtlLaborHedSeq", strDtlLaborHedSeq);
    collection.Add("DtlLaborDtlSeq", strDtlLaborDtlSeq);
    string valuein = "GetNewReportQty";

    lfo.IsModal = true;
    lfo.SuppressFormSearch = true;
    lfo.ValueIn = valuein;
    lfo.ContextValue = collection;        
            
    ProcessCaller.LaunchForm(oTrans, "RptQty", lfo);        

}

```

This is the code on the RQForm\_Load:

```
private void RQForm_Load(object sender, EventArgs args)
{
    MessageBox.Show("load");
	LaunchFormOptions opts = RQForm.LaunchFormOptions;
    if(opts != null && opts.ContextValue != null && opts.ValueIn != null)
    {
        MessageBox.Show(opts.ValueIn.ToString());
        object inObj = RQForm.LaunchFormOptions.ContextValue;
        NameValueCollection collection = new NameValueCollection();
        collection = (NameValueCollection)inObj;

        empID = collection["empID"];
        DtlLaborHedSeq = Convert.ToInt32(collection["DtlLaborHedSeq"]);
        DtlLaborDtlSeq = Convert.ToInt32(collection["DtlLaborDtlSeq"]);

        //MessageBox.Show(empID + " - " + DtlLaborHedSeq.ToString() + " - " + DtlLaborDtlSeq.ToString());

  

    }
}

```

What needs to change here to pass these custom parameters to GetNewReportQty so RQForm opens with a new record with current empID, DtlLaborHedSeq and DtlLaborDtlSeq?

---

<div class="post-metadata">

**Author:** ![Chad\_Smith](https://www.epiusers.help/user_avatar/www.epiusers.help/chad_smith/32/55845_2.png) [@Chad\_Smith](https://www.epiusers.help/u/Chad_Smith)\
**Post date:** [April 12, 2021, 4:22pm UTC](https://www.epiusers.help/t/getnewreportqty-after-rqform-load/63791/2 "2021-04-12T16:22:51Z")

</div>

Any luck on ever figuring this out? I’ve done a bit of searching and found this question asked a few times over the years, but I don’t see any answers. Currently trying to see if there’s a launch form option that’s passing something, but so far I haven’t found one.

---

<div class="post-metadata">

**Author:** ![Chad\_Smith](https://www.epiusers.help/user_avatar/www.epiusers.help/chad_smith/32/55845_2.png) [@Chad\_Smith](https://www.epiusers.help/u/Chad_Smith)\
**Post date:** [April 21, 2021, 4:33pm UTC](https://www.epiusers.help/t/getnewreportqty-after-rqform-load/63791/3 "2021-04-21T16:33:44Z")

</div>

In case anyone else needs to do something along these lines in the future, here’s what I found. The ValueIn is being used to pass parameters to the Report Quantity form on open and without filling that in, the form does not open properly. When I checked the ValueIn I found:

RQForm.LaunchFormOptions.ValueIn = System.Collections.Specialized.StringDictionary

So the next step was to find out what the dictionary entries were because I needed to see how they were formatted to be able to duplicate what Epicor is doing.

```
	if (RQForm.LaunchFormOptions.ValueIn != null) {
		StringDictionary lfoValueIn = (StringDictionary)RQForm.LaunchFormOptions.ValueIn;
		foreach (DictionaryEntry de in lfoValueIn) {
			EpiMessageBox.Show(string.Format("ValueIn Entry: {0} = {1}", de.Key, de.Value));}
	}

```

Now we can see that there are 3 entries in the dictionary that we need to pass in order for the form to load properly:

laborhead = -1  
labordet = -1  
jobover = true

---

<div class="post-metadata">

**Author:** ![LoganS](https://www.epiusers.help/user_avatar/www.epiusers.help/logans/32/53356_2.png) [@LoganS](https://www.epiusers.help/u/LoganS)\
**Post date:** [July 16, 2021, 7:33pm UTC](https://www.epiusers.help/t/getnewreportqty-after-rqform-load/63791/4 "2021-07-16T19:33:49Z")

</div>

As an alternative, I’ve found it easier to just set some environment vars, then clear them after I used them.
