After they login successfully. I wanted to create a BPM to set a warning message, stating that, you have logged into production and no transaction until we go live…Since we have 3 databases, our team may do some accidents in the production db, just to avoid that, would like to popup the warning message the moment they logged in. Please help how to do that.
A BPM on Ice.ShellLayout.GetHomePageForUser with a messagebox looks like it fires on log-in. You could use that, and set a variable to Session.AppServerURL.ToString() to find which appserver/db is logged into.
Now that I think about it a little more, you probably don’t need the Session.AppServerURL.ToString() part. If you are only worried about users doing transactions in the production environment, you can make just make this message BPM in that environment (the AppServerURL will always be the same anyway), and give some arbitrary/static message.
EDIT: one thing to watch out for is when you copy/restore the Production environment’s database into Test or Pilot, this BPM will start to fire there and may confuse users. This is where Session.AppServerURL.ToString() could help. You could use it to verify you are in Production when the message sends.
Hmm, maybe that method isn’t getting called for you on launch for some reason. The way I stumbled upon that BO/method was by running a trace and then “changing user”. You could try that and see what BO’s/methods are being used, then try with one of those (a trace didn’t work for me when I completely closed epicor, restarted then logged in. I had to “change user” to see anything in the trace)
I think that GenXData.GetByID method gets called pretty regularly when opening stuff up. You may be able to add some additional conditions in the BPM using info from the dataset. Or you could try a different method from the trace.