I have a customization which is calling another customization with ProcessCaller.LaunchForm(oTrans, “IMSALUS”, lfo);
I would like to execute some code automatically when this is finished. Is there a way to know when control is returned to my calling customization which I presume occurs when the ProcessCaller.LaunchForm(…) is closed.
I’m not sure what this is. I am looking for the instant the calling form regains control after the called customization has done its thing. I tried an EpiviewNotification but that didn’t work. I am not looking to get info back from anywhere unless it is from the called customization
saying “I’m finished doing my thing”.
ProcessCaller.ProcessCallBack += new ProcessCallBack(standardCallBackHandler);
LaunchFormOptions lfo = new LaunchFormOptions();
// the CallBackToken allows us to respond to standard callback
lfo.CallBackToken = "myCallBackToken";
// Launch a Form
ProcessCaller.LaunchForm(oTrans, "UD01", lfo);
//Get notified of transactions and events that happen on the other form.
void standardCallBackHandler(object Sender, TransactionCallBackArgs args)
{
ILaunch il = Sender as ILaunch;
string msgFrom = il == null ? "" : " on " + il.WhoAmI;
if (args.CallBackToken == "myCallBackToken")
EpiMessageBox.Show("ShipVia form handles standard callback from transaction event" +msgFrom+ ": " +
args.TransactionEvent.ToString());
}
//Don't forget to unsubscribe from the handler when the form closes unless you enjoy memory leaks
ProcessCaller.ProcessCallBack -= new ProcessCallBack(standardCallBackHandler);
This has worked handsomely. I now have a PerformClick() that clicks a button and in turn launches another customization. After that customization does its thing it returns to where I did the PerformClick(), which is in a Load event, I want to execute some more code. This is after the load is complete and the PerformClick is done and I would like for it to execute automatically. How can I do this? I tried another callback handler but that didn’t seem to work.