As we automate a task through script by invoking standard functionality, we may get a warning dialog in certain cases. The invoked functionality could have been designed to be used in an interactive way, but we want to run it in the background. To get around this problem, we can suppress the warning dialog using postUserInput
method in the MXApplicationYesNoCancelException
class.
For example, setting the schedule date on Assignment record can trigger a warning about FNL (finish no later than) or SNE (start not earlier than) constraints on the Work Order. To suppress the warning, call postUserInput
before setting the schedule date.
exp = MXApplicationYesNoCancelException("schedwoschedfinconst", "eg", "ek")
exp.postUserInput(MXServer.getMXServer(), 2, mboset.getMbo(0).getUserInfo())
The second parameter in postUserInput
should be one of the following depending on the dialog action you want to trigger:
CANCEL | 4 |
NO | 16 |
NULL | -1 |
OK | 2 |
YES | 8 |