Is it possible: "Open With" on OrderNum to prefill filter on Sales Order Pick List?

We want to right-click, open with on OrderNum in Order Entry, to open Sales Order Pick List with the order filter pre-filled to what we just clicked on.

I’ve added Sales Order Pick List to the Context Menu Maint, but no idea on how to bring that OrderNum over and pre-fill the filter.

Is it possible?

Short answer: yes. But I’m struggling to find the resource I need to help you. Basically, I think you can set the filter to equal your context menu order number in a customization on your SOPick report during the form load event. I’m not finding what I’m looking for though.

I will try to piece it together.

If it’s not doing it on it’s own then customize the pick list screen to look for a ContextValue on load. If it finds one, manually in code add the filter item.

The view that holds the filters is called orderList. How do we set that value? I’m assuming it’s an integer array given it’s for orders. I tried manipulating it the way I’ve set a report parameter, but it’s not having it. I can’t find any examples of this on here. I must not be phrasing it correctly.

This is what i Have so far… but I am getting an error.

	private void SOPickListForm_Load(object sender, EventArgs args)
	{
		if(SOPickListForm.LaunchFormOptions != null)
		{
			int[] orderNum = new int[1]{0};
			string val = SOPickListForm.LaunchFormOptions.ValueIn.ToString();
			
			if (val.Contains("~"))
			{
				orderNum = new int[val.Length];
				for (int i = 0; i < val.Length; i++)
				{
					orderNum[i] = Convert.ToInt32(val[i]);
				}
			}
			else if (!String.IsNullOrEmpty(val))
			{
				orderNum = new int[]{Convert.ToInt32(val)};
			}

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

			view.dataView[view.Row].BeginEdit();
			view.dataView[view.Row]["orderList"] = orderNum;
			view.dataView[view.Row].EndEdit();
		}
	}

You’re trying to jam values into what is sent to the Task Agent like you might do for an auto prnt from BPM issue is the screen itself is going to override that stuff almost immediately. Below should work, grabs the value and uses reflection to add it to the order list dataset on the order list tab.

		if (SOPickListForm.LaunchFormOptions != null && SOPickListForm.LaunchFormOptions.ValueIn != null)
		{
			// Connect to SO BO
			SalesOrderImpl boSalesOrder = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.SalesOrderImpl>((Ice.Core.Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.SalesOrderSvcContract>.UriPath);
			bool morePages;

			// Get SO by number
			OrderHedListDataSet dsNewOrderList = boSalesOrder.GetList("OrderNum="+SOPickListForm.LaunchFormOptions.ValueIn,0,0, out morePages);
			
			// Reflect the current OrderHedListDataSet
			FieldInfo fiDsOrderList = typeof(Erp.UI.Rpt.SOPickListReport.Transaction).GetField("dsOrderList", BindingFlags.NonPublic | BindingFlags.Instance);
			OrderHedListDataSet dsOldOrderList = (OrderHedListDataSet)(fiDsOrderList.GetValue(oTrans));

			// Clear 
			dsOldOrderList.Clear();
			dsOldOrderList.Merge(dsNewOrderList, true, MissingSchemaAction.Ignore);

			// Notify the UI of changes
			edvorderList.Notify(new EpiNotifyArgs(oTrans,dsOldOrderList.OrderHedList.Count-1, EpiTransaction.NotifyType.Initialize));
			edvReportParam.Notify(new EpiNotifyArgs(oTrans,edvReportParam.Row,edvReportParam.Column));
		}

This was just intended to dump into the SOPickListForm_Load method, correct? If so, testing the code returned the following errors:

Error: CS0246 - line 64 (162) - The type or namespace name ‘SalesOrderImpl’ could not be found (are you missing a using directive or an assembly reference?)
Error: CS0246 - line 68 (166) - The type or namespace name ‘OrderHedListDataSet’ could not be found (are you missing a using directive or an assembly reference?)
Error: CS0246 - line 71 (169) - The type or namespace name ‘FieldInfo’ could not be found (are you missing a using directive or an assembly reference?)
Error: CS0103 - line 71 (169) - The name ‘BindingFlags’ does not exist in the current context
Error: CS0103 - line 71 (169) - The name ‘BindingFlags’ does not exist in the current context
Error: CS0246 - line 72 (170) - The type or namespace name ‘OrderHedListDataSet’ could not be found (are you missing a using directive or an assembly reference?)
Error: CS0246 - line 72 (170) - The type or namespace name ‘OrderHedListDataSet’ could not be found (are you missing a using directive or an assembly reference?)
Error: CS0103 - line 79 (177) - The name ‘edvorderList’ does not exist in the current context
Error: CS0103 - line 80 (178) - The name ‘edvReportParam’ does not exist in the current context
Error: CS0103 - line 80 (178) - The name ‘edvReportParam’ does not exist in the current context
Error: CS0103 - line 80 (178) - The name ‘edvReportParam’ does not exist in the current context

Some of those errors look like they might be from your code it must be in there yet, and some of it is because you need usings and assemblies added for my code to work.