Hi cdtj,
Thanks for the reply.
I don't quite understand the your solution.
But I end up using a solution of yours about a year ago.
This Macro will reset the change category to null, which will remove all tasks with wait status, then use delete_wc to delete all pending tasks.
object chg_dob;
send_wait(0, this, "call_attr", "chg", "get_dob");
chg_dob= msg[0];
send_wait(0, top_object(), "get_co_group");
object gl;
gl = msg[0];
send_wait(0, gl, "checkout", chg_dob);
chg_dob.category="";
send_wait(0, gl, "checkin");
string z_factory, z_where_clause;
z_factory = "wf";
z_where_clause = format("chg=%d and status='PEND'",chg.id);
send_wait(0, top_object(), "call_attr", "api", "delete_wc", z_factory, z_where_clause, NULL);
On the side note, how do you hide the specific status on detail_wf?
This is the OOTB detail_wf source code.
detailRowHdr("Status", 1 , "$args.REQUIRED_status");
var item = '<PDM_SELECT NAME=SET.status ESC_STYLE=HTML FACTORY=tskstat WF_FAC_FOR_TSKSTAT=wf SELECTED="$args.status" SELECTED_SYM="$args.status.COMMON_NAME" TITLE="' + _dtl.lastHdrtext + '">';
var ins_pos = item.indexOf("NAME=");
if (ins_pos > 0)
{
_dtl.tabIndex++;
item = item.substring(0, ins_pos) + " TABINDEX=" + _dtl.tabIndex + " " + item.substring(ins_pos, item.length);
}
detailSetRowData(item);
The only way I can think of:
<PDM_IF "$args.task.code" == "APP">
<PDM_MACRO name=dtlDropdown hdr="Status" attr="status" lookup="no" whereclause="code='APP' or code='REJ'">
</PDM_IF>
Anyway I can modify the OOTB source code to hide specific status base on task type?
Best regards,
Conan