LaunchFormOptions for JobTraveler

Long story short, I created a button on JobEntry that when clicked needs to open up JobTraveler and pass/load the JobNum that was in JobEntry at the time of clicking the button to the JobTraveler for quick printing. I have everything ironed out, but the JobNum value is entered in JobTraveler as a Filter not a parameter:

If it was a parameter, all I’d have to do is set the dataview ReportParam equal to the JobNum passed to the screen, but since it’s a filter, i need to populate the dataview row with the JobNum and that’s where I’m failing at this. I’m hoping someone could share some code where they populate a filter on a report.

I’ve used the code edvjobList.dataView.Table.Rows.Add(); which gives me the blank row as shown in the screenshot above, but for the life of me I can’t populate the row.

Thanks for any/all input on this.

As a followup, when I try below I get a rows -1 index error. So even though I’m creating the new row, it is saying it’s not there?

Erp.Proxy.BO.JobEntryImpl JobEntAdapter = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.JobEntryImpl>((Ice.Core.Session)oTrans.Session,Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.JobEntrySvcContract>.UriPath);
Erp.BO.JobHeadListDataSet jhlDS = JobEntAdapter.GetList(wc, 100, 0, out vFalse);

edvjobList.dataView.Table.Rows.Add(jhlDS.Tables[0].Rows[0][0]);
oTrans.NotifyAll();

This is not trivial you’ll have to use reflection magic for it to work.

When changing a data view row I had to do a little bit of trickery. I’ll
give details when I get to work tomorrow, hopefully it will apply

Thanks for the feedback Gents! Sad to hear this isn’t an easy one.

Do you guys know if there is anyway I can send a BaseToolBars ToolClick command with c#? Basically, I added a button on JobEntry that does the same exact thing as clicking on Actions --> Print --> Job Traveler. If I could just find out a way to mimic clicking the Job Traveler button with code, I think I’ll be in good shape as the Epicor code would take over and I wouldn’t need to use LaunchFormOptions.

Nevermind, I just hacked it. I Was able to use LFOs passing to JobTraveler, then I created code that added the filter line, then code to manually select the JobNum cell and populate it. If anyone else runs into this, this method is easier than reflections. It may not work with all reports, but it definitely works with the Job Traveler:

private void JobTravForm_Load(object sender, EventArgs args)
{
	if (JobTravForm.LaunchFormOptions != null)
	{
		if (JobTravForm.LaunchFormOptions.ContextValue != null)
		{
			edvjobList.dataView.Table.Rows.Add();
			this.GridListV.ActiveRow = GridListV.Rows[0];
			this.GridListV.ActiveCell = GridListV.Rows[0].Cells["JobNum"];
			this.GridListV.PerformAction(UltraGridAction.EnterEditMode, false, false);
			this.GridListV.ActiveCell.Value = JobTravForm.LaunchFormOptions.ContextValue.ToString();
		}
	}
}

Be sure to add these guys to your using statements:
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;

2 Likes

The code Giving me this error on Job Traveler:

The name ‘edvjobList’ does not exist in the current context

Good morning! edvjobList is the epidataview. You have to declare that.

1 Like