Determine the "Calling App" from within a customization

Continuing from Pass variables from dashboard to Inventory Move using context menu, does anyone know how to determine the Calling App from within a customization. I have searched high and low and can’t seem to find it.

Thanks in advance!

Have you looked through the CallContextClientData epibindings? There are some app/module related fields there, not sure if AssemblyName == Calling App though.

@Asz0ka The AssemblyName seems to be the currently running app. In this case since I am calling
Inventory Transfer is shows: ‘Erp.UI.InvTransferEntry’. Is there a way to Loop through the available columns in a CallContextClientData row?

I’m not sure, but I think the columns are always the same.

@Asz0ka Understood, I am just trying to figure out their names. @josecgomez I can’t seem to find this in any of the docs, I would think this is this something simple?

Check in LFO LaunchFormOptions it should have a property or two in there CalledFrom (Off the top of my head mind you)

I gotcha, the fields are listed in a few places you can look. If you go into customization mode and look through the epibindings, that table and field is available. You can also see them in the BPM designer.

Thanks @josecgomez. I was able to get the calling app using:

if (InvTransferForm.LaunchFormOptions != null)
{
	string callingApp = InvTransferForm.LaunchFormOptions.Sender.ToString();
}

Thanks @Asz0ka. I am afraid it was a little more obvious than I would have liked to have seen here. :stuck_out_tongue:

@josecgomez - OK, so I can get the calling app so that when Inventory Transfer gets launched, I can ensure that the code I want will only get executed when the calling form matches my dashboard name. Now to pass the other values? I have searched extensively and everything I read shows instantiating an LFO and then launching from a button or customization event. I see that the Dashboard already has an associated LFO in MainController.LaunchFormOptions. When I call the Inventory Transfer from the ContextMenu, it seems that this is what is being used as the LFO. So I tried: this.MainController.LaunchFormOptions.ContextValue = myValues
but I get null at the other end when looking at InventoryTransferForm.LaunchFormOptions.ContextValue. I can see the InventoryTransferForm.LaunchFormOptions.Sender and the InventoryTransferForm.LaunchFormOptions.ValueIn fine. Also, each subsequent time I right click for the context menu on my dashboard, I get the ‘Object reference not set to an instance of an object’ error. Is this some sort of Instantiation 101 issue?

Thanks in advance as always.

Hi Jim,

I am working on a similar customization, trying to do an open with context to open dashboard to correct record(s). Have you seen this post?

It appears helpful!

Nancy

Oh, and this post too: Pass Right-Click Value to Custom Dashboard?

Thank you Nancy for the links. The only way I currently see to do this “properly” (Pass variables from a dashboard to an Epicor Form opened from a standard context menu) is to use the existing MainController.LaunchFormOptions.ContextValue since I am not calling a new instantiated LFO like most of the answers I have read. This may be simple for someone in-the-know, but I am currently at a loss of how to instantiate the existing LFO or set the value of the existing LFO’s ContextValue? I have already tried setting CallContext variables in both customizations, and BPM’s in-between to hold the values. All seem kludgy, but I couldn’t make them work 100%. @Chris_Conn I have seen you do much in this area, do you have any suggestions? I greatly appreciate everyone’s help.

Since I have really found the answer to this thread (with the help @josecgomez and @Asz0ka ) , should I answer/close this thread and continue on the original question that started this one Pass variables from dashboard to Inventory Move using context menu?

I have marked solutions and will continue this conversation on the original thread. Thanks all.

2 Likes