Custom Tracker, BAQ, UltraGrid... How setup "open with" context menu?

Our Supplier Tracker customization added a “closed purchase orders” UltraGrid (populated via a BAQ). The first column is “POHeader.PONum” and we would like to “right click, open purchase order”.

I currently don’t have any right-click ability on this column. Also, I can’t seem to make anything work through the Context Menu Maintenance area. Is there somewhere else I need to go to make this work?

You are going to use the .ExtendedProperties of the EpiDataView.

Think the wizad will do all of the work for you.

Here is the custom code:

private static void SetExtendedProperties()
	{
		// Begin Wizard Added EpiDataView Initialization
		EpiDataView edvedv_CaseReporting = ((EpiDataView)(Script.oTrans.EpiDataViews["edv_CaseReporting"]));
		// End Wizard Added EpiDataView Initialization

		// Begin Wizard Added Conditional Block
		if (edvedv_CaseReporting.dataView.Table.Columns.Contains("Calculated_JobNum"))
		{
			// Begin Wizard Added ExtendedProperty Settings: edvedv_CaseReporting-Calculated_JobNum
			edvedv_CaseReporting.dataView.Table.Columns["Calculated_JobNum"].ExtendedProperties["Like"] = "JobHead.JobNum";
		// End Wizard Added ExtendedProperty Settings: edvedv_CaseReporting-Calculated_JobNum
		}
		}
1 Like

Thanks. Does this go right in the script editor for the customized form/tracker? I’m not sure where to get the EpiDataView value.

What wizard do you use to create the extended properties?

Thank you.

Sorry, I thought this was a E10 question, as that is what we use.

Maybe this code will get you close.

public static class Script
{
Custom Code***
	    private static DynamicQueryAdapter dqa_CaseReporting;
    	private static EpiDataView edv_CaseReporting;
        public static void InitializeCustomCode()
        	{
        		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
        		// Begin Wizard Added Variable Initialization

        		// End Wizard Added Variable Initialization

        		// Begin Wizard Added Custom Method Calls

        		Script.button_LoadResults.Click += new System.EventHandler(Script.button_LoadResults_Click);
        		Script.grid_Results.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(Script.grid_Results_InitializeLayout);
        		
        		// End Wizard Added Custom Method Calls
        		dqa_CaseReporting = new DynamicQueryAdapter(oTrans);
        		dqa_CaseReporting.BOConnect();
        		dqa_CaseReporting.GetDashboardQuery("ETK_Case_Reporting_v3");

        		edv_CaseReporting = new EpiDataView();
        		edv_CaseReporting.dataView = new DataView(dqa_CaseReporting.QueryResults.Tables["Results"]);
        		Script.oTrans.Add("edv_CaseReporting", edv_CaseReporting); 
        		

        	}
	public static void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		Script.button_LoadResults.Click -= new System.EventHandler(Script.button_LoadResults_Click);
		Script.grid_Results.InitializeLayout -= new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(Script.grid_Results_InitializeLayout);
		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal
		dqa_CaseReporting = null;
		edv_CaseReporting = null;
		// End Custom Code Disposal
	}

    private static void UD05Form_Load(object sender, EventArgs args)
    	{
    		
    		
    		grid_Results.EpiBinding = "edv_CaseReporting";
    		grid_Results.EpiTransaction = oTrans;
    		dqa_CaseReporting.ExecuteByID("ETK_Case_Reporting_v3");

    		edv_CaseReporting.dataView = new DataView(dqa_CaseReporting.QueryResults.Tables["Results"]);
    		SetExtendedProperties();
    		
    			}
}

I believe you need to make sure your like field is populated in the extended properties. Note that open with context does not work with external BAQs in E9, not sure in E10, but if what Ken says you may be able to get external BAQs to open with if you used the code.

I hope that helps.

We’re still in E9 and here’s what I use to accomplish your challenge.
This example populates an ultragrid from a BAQ then sets the “Like” attribute on the appropriate column of the BAQResult table - which, I assume, is the source of your ultragrid.

public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete ‘Begin/End Wizard Added Variable Initialization’ lines **
// Begin Wizard Added Variable Initialization
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
// End Wizard Added Custom Method Calls

	this.ordStuffDS = this.ordStuffQuery.GetByID("UTIL-OrdStuff");
	this.openOrders = this.ordStuffQuery.Execute(this.ordStuffDS).Tables["Results"];

	this.edvBAQResult = new EpiDataView();  // This is the dataview Ken referred to...
	this.edvBAQResult.dataView = this.openOrders.DefaultView;
	this.oTrans.Add("BAQResults", this.edvBAQResult);
	this.edvBAQResult.dataView.Table.Columns["OrderHed.OrderNum"].ExtendedProperties["Like"] = "OrderHed.OrderNum";
	this.edvBAQResult.dataView.Table.Columns["Customer.CustID"].ExtendedProperties["Like"] = "Customer.CustID";
	this.edvBAQResult.dataView.Table.Columns["OrderDtl.Partnum"].ExtendedProperties["Like"] = "Part.PartNum";
	this.edvBAQResult.dataView.Table.Columns["ShipHead.PackNum"].ExtendedProperties["Like"] = "ShipHead.PackNum";