Pass callContextBpmData field from UBAQ to dashboard customization?

Hey,

I’m wanting to refresh the dashboard when I hit the update on the BAQ (advanced update). So, in the BAQ update I set callContextBpmData.ShorChar10 when the routine finishes.

In the dashboard customization I check this field when the dataset initializes, but it never shows any contents.

Is it possible to do this?

Thanks,

Joe

image

	private void edvV_LSP_IssueMaterialsDetail_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes

		if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
		{
			if ((args.Row > -1))
			{
				MessageBox.Show("Shorchar10 " + edvCallContextBpmData.dataView[edvCallContextBpmData.Row]["ShortChar10"].ToString());

				if (edvCallContextBpmData.dataView[edvCallContextBpmData.Row]["ShortChar10"].ToString() == "MtlIssued")
				{
					mtlIssued = true;
					MessageBox.Show("Back from update.");
				}

I use the follwing code to run my custom action in the BAQ from a dahsboard.

	 void BAQRunCustomAction(EpiDataView iEdv, string iActionID)
	{
	    BAQDataView BAQView = (BAQDataView)iEdv;
	    Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
	    Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
	    MethodInfo mi = t.GetMethod("BAQRunCustomAction", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
		mi.Invoke("Ice.Lib.Framework.BAQUpdater", new object[]{BAQView, iActionID});
	}

Then I run this to refresh the BAQs on the dashboard:

	void RefreshAllBAQs()
	{
		oTrans.PushStatusText("Refreshing all views. Please be patient...", false);      
		MainController.AppControlPanel.HandleToolClick("RefreshAllTool", new 
		Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshAllTool"], null)); 
		oTrans.PushStatusText("Done!", false);
		
	}

There is a button on my form to execute the custom action and refresh the form.

	private void epiButtonC1_Click(object sender, System.EventArgs args)
	{
		BAQRunCustomAction(edv, "ProcessCommands");
		RefreshAllBAQs();
        }

I hope this helps!
Good luck!
Nate

Thanks, Nate.

I didn’t make myself clear, an unfortunate habit.

I’m wanting the BAQ to tell me it has updated a record so I can run the refresh as is suggested in your code above.

I had thought I would set the callContextBpmData field in the BAQ update directive and then check it in the customization when it comes back in the epidataview notification, but the field isn’t reporting any contents.

I’ve done that with customizations and method directives but haven’t tried it on an updatable BAQ.

Still wrestling.

Thanks again.

Joe

I’m still not sure I follow, but here is some more useful code for refence.

Normally I use the customized dashboard to assign a callcontext, then I reference that in my BPM. Here is a chunk of code from my AddAnyOp dashboard. Also a whole thread on it here: Add or Edit any Operation - My Custom Dashboards

{
		// ** Place Event Handling Code Here **
		EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
		System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
		edvCallContextBpmDataRow["Character01"] = MyPart.Text;
		edvCallContextBpmDataRow["Character02"] = MyRev.Text;
		edvCallContextBpmDataRow["Character03"] = MyComment.Text;
		edvCallContextBpmDataRow["Character04"] = MyReason.Text;
		EpiDataView edv = (EpiDataView)this.oTrans.EpiDataViews["CallContextClientData"];
		string myUserString = edv.dataView[0]["CurrentUserId"].ToString();
		edvCallContextBpmDataRow["Character05"] = myUserString;
		edvCallContextBpmDataRow["Character06"] = MyResourceID.Text;
		edvCallContextBpmDataRow["Number01"] = MyOp.Text;		
		edvCallContextBpmDataRow["Number02"] = MyQtyPerParent.Text;	
		edvCallContextBpmDataRow["Number03"] = MySetHours.Text;
		edvCallContextBpmDataRow["Number04"] = MyProdTime.Text;	
		
		// Run custom code in BPM
		var edvV = oTrans.Factory("V_AddAnyOp_1View");
		BAQRunCustomAction(edvV, "AddOp");
	}

Inside my BPM, I refence the variable a custom code widget like this:

myPart = callContextBpmData.Character01;
myRev = callContextBpmData.Character02;
myReason = callContextBpmData.Character04;
myUser = callContextBpmData.Character05;
myOp = Convert.ToInt32(callContextBpmData.Number01);
myResGrpID = callContextBpmData.Character06;
myQtyPerParent = Convert.ToDecimal(callContextBpmData.Number02);
mySetHours = Convert.ToDecimal(callContextBpmData.Number03);
myProdTime = Convert.ToDecimal(callContextBpmData.Number04);
SkipCheckIn = callContextBpmData.Checkbox01;

Thanks, Nate.

What I’m looking for goes the other direction. I need the BPM in the updatable dashboard to report back to the customization that it has taken an action. I can set the field in the BPM, but the contents don’t make it back to the customization when the update is finished.

I thought there might be an update of the callContextBpmData record available in the BPM but haven’t found one.

Joe

Perhaps you could add a bit calculated field to your BAQ, and default the value to false. Then, in your BPM you can update the bit field. You can use that to pass data back from the BPM to the Customization. Hopefully it updates in a way that you can capture the event in your customization.

1 Like

@jdtrent - did you ever find a solution to this? I am having the same issue. Updating a UD table through a UBAQ and I want to communicate back to the dashboard assembly which row I modified so that when it refreshes, it will then select that same row. Not quite the same thing but ultimately I’m trying to pass info from callContextBpm fields back into my customization and it’s not picking it up in the customization.

I’ve had the same or similar issue.

I moved my update to a custom action, and could do what I wanted.

What does it mean to move your update to a custom action?

No, I don’t think I found how to do it. I don’t remember what I did instead, sadly.

Joe

Basically you would add a custom action to the BAQ, and pass the data from the dashboard
to it yourself to do the update.

You could pass any data you need between the call context with a custom action.

1 Like