Hi!
What is the correct way to open a record from an automation script and immediately display a pop-up dialog? (It has an action launch point.)
First, I tried this:
wcs = service.webclientsession()
app = wcs.getCurrentApp()
appBean = app.getAppBean()
# wo is the record I want to open:
uID = wo.getUniqueIDValue()
#Jump to the record:
appBean.moveToUniqueId(uID)
#I'm not sure these 2 lines are needed:
appBean.setupBean(wcs)
appBean.save()
#open the dialog:
event = WebClientEvent("DIALOG_ID", app.getId(), None, SessionContext(wcs))
wcs.queueEvent(event)
This code works with the UI.
The problem with the above code is that the ResultsBean remains the same in the background (i.e. not the new record that I jumped to), which can cause a lot of bugs.
I tried also something like this:
wcs = service.webclientsession()
app= wcs.getCurrentApp()
appBean = app.getAppBean()
uID = lastNRC.getUniqueIDValue()
changeAppEvent = WebClientEvent("changeapp", app.getId(), "ace_wo_base", None, None, None, uID, wcs);
wcs.queueEvent(changeAppEvent)
openDialogEvent = WebClientEvent("ACE_MATERIAL_REQ", app.getId(), None, SessionContext(wcs))
wcs.queueEvent(openDialogEvent )
With this code the ResultsBean changes as expected, but the dialog does not pop-up.
Do you have any idea how could I achieve this?