Hi Steven,
Thanks again for the push in the right direction!
Your script worked perfectly... the only thing I found was that from the list tab with no specific records selected, it wasn't raising the "ConfirmListAction" warning message. So I had to manually raise that in the script.
Will poke around to try to figure out the "invalid binding" hiccup... but that only occurs if i cancel the dialog the launch it again immediately (which shouldn't happen often).
maxvalue="COMP"
value="WCLOSE"
session=service.webclientsession()
dialogid="status"
if session.getCurrentApp().onListTab():
dialogid="list_status"
def yes():
appBean=session.getCurrentApp().getAppBean()
statefulMbo=appBean.getMbo()
appBean.targetStatusOption=maxvalue
appBean.statusChangeButtonSigoption=maxvalue
statefulMbo.setTargetStatusOption(maxvalue)
statefulMbo.setStatusChangeButtonSigoption(maxvalue)
appBean.STATUSSUB()
session.loadDialog(dialogid)
statusBean=session.getCurrentApp().getDataBean(dialogid)
if statusBean:
statusBean.setValue("STATUS",value)
def no():
result = "no"
def dflt():
service.log("dflt")
service.yncerror("jspmessages", "ConfirmListAction")
cases = {service.YNC_NULL:dflt, service.YNC_OK:yes, service.YNC_CANCEL:no}
if dialogid=="list_status":
x = service.yncuserinput()
cases[x]()
else:
yes()
------------------------------
Ryan Coghlin
------------------------------
Original Message:
Sent: Mon March 21, 2022 02:47 PM
From: Steven Shull
Subject: Synonym Status won't display Change Status dialogue from Common Actions
Trying to mimic what we do in the StatefulAppBean, you want something like below (replacing the maxvalue & value settings with your desired choices). This helps ensure some checks occur such as the record is in a state where the status change is allowed and that the user has the permission prior to loading the dialog. It requires no imports.
I'm seeing the same issue you reported (hitting cancel and then opening it again gets invalid binding error) but haven't had time to look into it.
maxvalue="APPR"value="SCHEDASSIGN"session=service.webclientsession()dialogid="status"if session.getCurrentApp().onListTab(): dialogid="list_status"appBean=session.getCurrentApp().getAppBean()statefulMbo=appBean.getMbo()appBean.targetStatusOption=maxvalueappBean.statusChangeButtonSigoption=maxvaluestatefulMbo.setTargetStatusOption(maxvalue)statefulMbo.setStatusChangeButtonSigoption(maxvalue)appBean.STATUSSUB()session.loadDialog(dialogid)statusBean=session.getCurrentApp().getDataBean(dialogid)if statusBean: statusBean.setValue("STATUS",value)
------------------------------
Steven Shull
Original Message:
Sent: Mon March 21, 2022 11:03 AM
From: Ryan Coghlin
Subject: Synonym Status won't display Change Status dialogue from Common Actions
Hi Steven,
Yes, I was hoping the action would load the Change Status dialog with the WCLOSE status set. Thanks for the suggestion of an ACTION launch point automation script that loads the dialog.
I've got the automation script hooked up to the Common Action. It launches the Change Status dialog successfully... I just need to figure out how to set the status to "WCLOSE" in the dialog. Struggling with that one a bit... looking for a "set" something, but not having much luck.

I've also got a little hiccup where if I click the action > cancel the dialog > click the action again, I get some weird "invalid binding" stuff happening.

Automation script:
from psdi.server import MXServerfrom psdi.common.context import UIContextfrom psdi.webclient.system.controller import SessionContext, Utility, WebClientEventmxServer = MXServer.getMXServer()context = UIContext.getCurrentContext()if context: wcs = context.getWebClientSession() Utility().sendEvent(WebClientEvent("status", wcs.getCurrentPageId(), None, SessionContext(wcs)))
------------------------------
Ryan Coghlin
Original Message:
Sent: Tue March 15, 2022 09:41 AM
From: Steven Shull
Subject: Synonym Status won't display Change Status dialogue from Common Actions
On your signature option, did you expand the Advanced Signature Options and choose "This is an action that must be invoked by the user in the UI"? That is required when our action is an automation script for example. I've never tried tying it to a standard action but I assume it would cause the action to fire.
That being said, I don't think this would function as you intend. That change status action is used by workflow & escalations to change the status silently. The other status actions actually bring up the dialog for the user to record a memo and be able to cancel (in case they accidentally select it). I think you would have to do this as an ACTION launch point automation script that loads the dialog (either list_status or status depending on if you're on the list tab) and then sets the status in the dialog. Since you're on at least 7.6.1.X based on the UI you would be able to do this.
------------------------------
Steven Shull
Original Message:
Sent: Fri March 11, 2022 03:51 PM
From: Ryan Coghlin
Subject: Synonym Status won't display Change Status dialogue from Common Actions
Hello,
We're implementing a new WCLOSE status (synonym of COMPLETE) for WOs. Our users will choose this status instead of fully closing the WO. (system will automatically close the WO through an escalation)
I'd like to maintain the user's ability to move a WO to this new status from the "Common Actions" menu (like they have with "Close Work Order" now).
I've got that option showing up in Common Actions, but clicking it doesn't do anything. (doesn't open the Change Status dialog with "WCLOSE" selected, as hoped).
Is the above possible?
Below are the pieces of the puzzle I have so far.
Thanks for any assistance you can provide.
- Action to change WO status to WCLOSE

- Added WCLOSE sig option in App Designer for WOTRACK

- Added WCLOSE option to Toolbar Menu in App Designer for WOTRACK (and hid the existing CLOSE option)

- "Set WO Waiting to CLOSE" appears in Common Actions in WOTRACK, but doesn't do anything when clicked

------------------------------
Ryan C.
------------------------------
#Maximo
#AssetandFacilitiesManagement