Close attached incidents
I was asked by the business folk in my company to come up with a way to close all attached incidents (just like the "Actions, Close All Children").
STEP I: I started by creating the following object in WSP:
//////////////////////////////////////////////////////////////////////// // Factory: z_cr_close_att_inc ////////////////////////////////////////////////////////////////////////
OBJECT z_cr_close_att_inc {
ATTRIBUTES z_cr_close_att_inc {
description STRING 4000
REQUIRED;
owning_pr SREL pr
REQUIRED;
res_code SREL resocode;
root_cause SREL rc;
last_mod_dt DATE { ON_CI SET NOW; };
last_mod_by SREL cnt { ON_CI SET USER;
ON_NEW DEFAULT USER; };
};
FACTORY z_cr_close_att_inc {
STANDARD_LISTS {
MLIST OFF;
RLIST OFF;
};
REL_ATTR id;
COMMON_NAME description;
};
TRIGGERS {
POST_CI z_close_att_inc( persistent_id ) 1040 FILTER (EVENT("INSERT") );
};
}; /////////////////////////////////////////////////////////////////////////////////////////// End of object code //////////////////////////////////////////////////////////////////////////////////////////
The only two required field here are the "owning_pr" (problem ticket srel) and the "description" (this becomes the solution. The other fields are just fields in the incidents that we will update at the same time we close them.
STEP II: Next, I created a detail form for the above object in WSP. I used the standard detail template but made the following changes:
1. Search for <PDM_MACRO NAME=dtlForm factory="z_cr_close_att_inc>