Hey jmayer,
this line <input type="hidden" name="SET.status" value="ACK"> is in that form.
Part of the form:
<PDM_MACRO name=dtlStartRow>
<PDM_MACRO name=dtlReadonly hdr="Número de $args.type.sym" attr=ref_num>
<PDM_MACRO name=dtlReadonly hdr="Resumen de $args.type.sym" attr=summary colspan=2>
<PDM_MACRO name=dtlStartRow>
<PDM_MACRO name=dtlReadonly hdr="Estado actual" attr=status>
<PDM_IF "$args.KEEP.DEF_CODE" == "">
<PDM_IF "$args.type" == "I">
<PDM_MACRO name=dtlReadonly hdr="Nuevo estado" attr=status_prev> // here is when a popup appears and it goes to the previous state but only in the pop up!
<PDM_ELIF "$args.type" == "P">
<PDM_MACRO name=dtlDropdown hdr="Nuevo estado" attr=status default="!default_trans_sym!" evt="onBlur=\\\"detailSyncEditForms(this)\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_pr initial="!default_trans_code!">
<PDM_ELSE>
<PDM_MACRO name=dtlDropdown hdr="Nuevo estado" attr=status default="!default_trans_sym!" evt="onBlur=\\\"detailSyncEditForms(this);\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_cr initial="!default_trans_code!">
</PDM_IF>
<PDM_ELSE>
<PDM_IF "$args.type" == "I">
<PDM_MACRO name=dtlDropdown hdr="Nuevo estado" attr=status_prev default="!def_sym!" evt="onBlur=\\\"detailSyncEditForms(this)\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_in initial="!def_code!">
<PDM_ELIF "$args.type" == "P">
<PDM_MACRO name=dtlDropdown hdr="Nuevo estado" attr=status default="!def_sym!" evt="onBlur=\\\"detailSyncEditForms(this)\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_pr initial="!def_code!">
<PDM_ELSE>
<PDM_MACRO name=dtlDropdown hdr="Nuevo estado" attr=status default="!def_sym!" evt="onBlur=\\\"detailSyncEditForms(this);\\\" onChange=\\\"make_desc_required(this)\\\"" factory=crs_cr initial="!def_code!">
</PDM_IF>
</PDM_IF>
<PDM_MACRO name=dtlStartRow>
<PDM_MACRO name=dtlTextbox hdr="Tiempo invertido" attr=alg.time_spent evt="onBlur='validate_duration_ts(this)'" maxlength=100>
<PDM_MACRO name=dtlDate hdr="Fecha de la actividad" attr=alg.time_stamp>
<PDM_MACRO name=dtlDateReadonly hdr="Marca de tiempo" attr=alg.system_time>
<PDM_IF "$prop.view_internal" == "1">
<PDM_MACRO name=dtlCheckbox hdr="¿Interno?" attr=alg.internal>
</PDM_IF>
<PDM_MACRO name=dtlStartRow>
<PDM_MACRO name=dtlTextbox hdr="Descripción del usuario" attr=alg.description colspan=4 rows=8 size=80 spellchk=yes>
make_desc_required();
if (resp_ids.length > 1)
{
<PDM_MACRO name=dtlStartRow>
<PDM_IF "$args.type" == "R" || "$args.type" == "">
<PDM_MACRO name=dtlDropdown hdr="Respuesta personalizada" attr="n/a" evt="onBlur='add_response(selectedIndex)' onChange='reset_resp_on_blur_flag()'" factory=response list_display="$list.sym" rel_attr_name="id" use_list_display=1 whereclause="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND cr_flag=1">
<PDM_ELIF "$args.type" == "I">
<PDM_MACRO name=dtlDropdown hdr="Respuesta personalizada" attr="n/a" evt="onBlur='add_response(selectedIndex)' onChange='reset_resp_on_blur_flag()'" factory=response list_display="$list.sym" rel_attr_name="id" use_list_display=1 whereclause="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND in_flag=1">
<PDM_ELIF "$args.type" == "P">
<PDM_MACRO name=dtlDropdown hdr="Respuesta personalizada" attr="n/a" evt="onBlur='add_response(selectedIndex)' onChange='reset_resp_on_blur_flag()'" factory=response list_display="$list.sym" rel_attr_name="id" use_list_display=1 whereclause="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND pr_flag=1">
</PDM_IF>
}
if (typeof document.main_form.elements["KEY.status"] != "undefined")
set_default_toggle(document.main_form.elements["KEY.status"]);
else
set_default_toggle(document.main_form.elements["SET.status"]);
</script>
<!--<input type="hidden" name="SET.status" value="status_prev"> -->
<PDM_MACRO name=dtlEnd>
</PDM_FORM>
</center>
The Macro that was created for the transition PTE-ACK to WIP with the condition:
if (( !is_null(getval_by_name("type")) && getval_by_name("type") == "I" ) && ( !is_null(getval_by_name("status")) && getval_by_name("status") == "PTE-ACK" ) && ( !is_null(getval_by_name("status_prev")) && getval_by_name("status_prev") == "WIP" ))
set_return_data(TRUE);
else
set_return_data(FALSE);
And the Spell code:
if(status_old == 'PTE-ACK') {
if((status_new != status_old) || (group_old != group_new)) {
if (is_empty(fecha_resolucion_real) || is_null(fecha_resolucion_real)) {
status = status_prev; // doesn't do anything, before status_prev was 'ACK', I've vreated a no one with a new .mod but doesn't work
assignee = '';
}
else {
status = 'RE';
if(group_old != group_new) {
assignee = '';
}
}
}
}
Thank you!