I was able to tweak the code to utilize the $$SelectDoc field. Now you can use
any view and the "Allow selection of documents" option.
Basically the action button loops thru the $$SelectDoc values and creates an
array of the docunids. It then writes the docunids and desired status field to
the hidden HTML fields and submits the form. The rest of the process is
relatively the same. The Domino server uses the actual back-end form for the
post, executes the WQS agent and $return to refresh the page.
Enjoy!
####PASS-THRU HTML FOR $$VIEWTEMPLATE####
</form><!-- ends the default domino form // -->
<form name="processor" method="post"
action="BatchStatusChangeFrm?CreateDocument">
<input type="hidden" name="docunids" size="50">
<input type="hidden" value="" name="status">
name="viewname">
/*####### JavaScript Action Button #######*/
function bsc(status) {
var cb = document.forms[0].$$SelectDoc;
var selectcount = 0;
var docUNID = new Array();
if (cb.length) {
//has more than one value
for(i = 0; i < cb.length; i ++){
if (cb[i].checked){
docUNID[selectcount] = cb[i].value;
selectcount++;
}
}
} else {
//has only one value
if (cb.checked){
docUNID[selectcount] = cb.value;
selectcount++;
}
}
if (docUNID[0] != null ){
document.processor.docunids.value = docUNID;
document.processor.status.value = status;
document.processor.submit();
}
}
I was able to tweak the code to utilize the $$SelectDoc field. Now you can use any view and the "Allow selection of documents" option.
Basically the action button loops thru the $$SelectDoc values and creates an array of the docunids. It then writes the docunids and desired status field to the hidden HTML fields and submits the form. The rest of the process is relatively the same. The Domino server uses the actual back-end form for the post, executes the WQS agent and $return to refresh the page.
Enjoy!
####PASS-THRU HTML FOR $$VIEWTEMPLATE#### </form><!-- ends the default domino form // --> <form name="processor" method="post" action="BatchStatusChangeFrm?CreateDocument"> <input type="hidden" name="docunids" size="50"> <input type="hidden" value="" name="status"> name="viewname">
/*####### JavaScript Action Button #######*/ function bsc(status) { var cb = document.forms[0].$$SelectDoc; var selectcount = 0; var docUNID = new Array(); if (cb.length) { //has more than one value for(i = 0; i < cb.length; i ++){ if (cb[i].checked){ docUNID[selectcount] = cb[i].value; selectcount++; } } } else { //has only one value if (cb.checked){ docUNID[selectcount] = cb.value; selectcount++; } } if (docUNID[0] != null ){ document.processor.docunids.value = docUNID; document.processor.status.value = status; document.processor.submit(); } }