Custom Dialog Yes No Before Creation of Followup Workorder

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

create a custom dialog to get user input Yes and No only before followup workorder

workORDER
new custom non-persistent object ZZCREATEWO with any field or these SITEID, WONUM,
PRIORITY, DESCRIPTION

insert this dialog into wotrack.xml


<dialog id="CREATEWO" label="Create Follow-up Work Order"
relationship="ZZCREATEWO">
<section border="true" id="mxdwodialog_grid1">
<sectionrow id="mxdwodialog_grid1_1">
<sectioncol id="mxdwodialog_grid1_1_1">
<section id="mxdwodialog_grid1_1_1_grid2">
<label here>
</section>
</sectioncol>
</sectionrow>
</section>
<buttongroup id="mxdwodialog_2">
<pushbutton id="mxdwodialog_2_1" label="OK" mxevent="dialogok"/>
<pushbutton id="mxdwodialog_2_2" label="Cancel"
mxevent="dialogcancel"/>
</buttongroup>
</dialog>
-----------
delete this 4233 DELETE <action id="CREATEWO" method="createWorkorder"
savemode="ONLOAD"/> IF we don't want button to do this. Therefore we use CREATEWO
as dialogId.
--------

create a new object automation on zzcreatewo object, preinsert

# to get the non persistent object of the dialog we need a small trick
mbo = mboset.getMbo(0)

# get the originationg work order MBO


origWo = mbo.getOwner()

# call the createWorkorder method to create a followup work order


newWo = origWo.createWorkorder(origWo.getThisMboSet(), None, False)

You might also like