We have a function that already works to clear the configuration item when new status is Resolved.
I am trying to write a similar function to set a zenvironment field to empty when status is Resolved. I wrote the function and I added it to the New Status with a ; inbetween the functions. It just doesn't seem to do anything.
Here is my function:
function clear_zenvironment_item(e)
{
make_desc_required(e);
var code;
if (typeof e != "undefined" && e != null)
{
if (e.type == "select-one")
{
code = nx_escape(e.value);
}
else
code = nx_escape(document.main_form.elements["SET.status"].value);
}
else
{
<PDM_IF "$args.KEEP.DEF_CODE" == "">
code = default_trans_code;
<PDM_ELSE>
code = def_code;
</PDM_IF>
}
// Clear New Configuration Item and Environment field if status changed to Resolved.
if (code == "RE"){
nx_escape(document.main_form.elements["KEY.zenvironment"].value = "<empty>");
nx_escape(document.main_form.elements["SET.zenvironment"].value = "<empty>");
detailMakeReq("zenvironment");
} else {
detailMakeReq("zenvironment", true);
}
}
Here's is my dropdown :
<PDM_MACRO name=dtlDropdown hdr="<PDM_I18N>New Status</PDM_I18N>" attr=status colspan=2 default="!default_trans_sym!" evt="onBlur=\\\"detailSyncEditForms(this)\\\" onChange=\\\"clear_config_item(this);clear_zenvironment_item(this)\\\"" factory=crs_in initial="!default_trans_code!">