Hello Maryann! I think I have a relatively simple solution--looks something like this:
- Go to the Assets application in application designer
- Create a new signature option ASSET_CREATE_WO - "Assets - create new work order" and be sure to check the box This is an action that must be invoked by user in the UI in the Advanced Signature Options section
- Open the "Create Work Order" dialog box (CREATEWO) in the application designer and change the event for the OK button from dialogok to ASSET_CREATE_WO (this will make the OK button fire an automation script)
- Grant security to the signature option to whatever group(s) would be invoking this functionality
- Go to Automation scripts > Create new automation script with ACTION launch point. Be sure to have the script ID and action ID = ASSET_CREATE_WO
- Make the CODE for the script this:
from psdi.webclient.system.controller import WebClientEvent;
## get context
session = service.webclientsession();
databean = session.getDataBean("CREATEWO");
appinstance = session.getCurrentApp();
appbean = appinstance.getAppBean();
WO = databean.getMbo(); # get the work order that exists in the dialog box
UID = WO.getUniqueIDValue(); # get the UNIQUE ID of that work order
## SAVE and move to WOTRACK
appbean.SAVE();
## Jump to WOTRACK application
newEvent = WebClientEvent("changeapp", appinstance.getId(), "wotrack", None, None, None, UID, session);
session.queueEvent(newEvent);
Cheers,
Jade