Hi Experts,
I am working on a scenario wherein i need to check if there is an attachment along with this form or not. Is there anyway we check this, while this form will always work Offline.
Any pointers to this will be helpful..
Thanks,
Amita
Hi Experts,
I am working on a scenario wherein i need to check if there is an attachment along with this form or not. Is there anyway we check this, while this form will always work Offline.
Any pointers to this will be helpful..
Thanks,
Amita
this.syncAnnotScan(); // scan the PDF for annotationsaAnnots = this.getAnnots({nSortBy:ANSB_Type}); // get array of annotations sorted by type.// count the number of "FileAttachment" annotation typesvar sumAttachments = 0; // clear counter// loop through elements of annotation arrayfor (var i = 0; i < aAnnots.length; i++) {if(aAnnots[i].type == 'FileAttachment') sumAttachments++; // count FileAttachment} // end of loop // count the data objcts with a MIMETypevar aDataObj = this.dataObjects;var sumObjects = 0;// loop through teh data objectsfor (var i = 0; i < aDataObj.length; i++) {// count all object with a MIMETypeif(aDataObj[i].MIMEType != '') sumObjects++;} // sum total files foundvar sumFiles = sumAttachments + sumObjects; // check to see we have file attachmentsif(sumAttachments > 0) {// actions to take if there are attachmentsconsole.println("Number of Annotations: " + aAnnots.length);console.println("Number of FileAttachments: " + sumAttachments);} else {// actions to take if no file attachmentsconsole.println("Number of Annotations: " + aAnnots.length);console.println("Not FileAttachments were found.");} // end of attachment count processing // check to see we have file data objectif(sumObjects > 0) {// actions to take if there are attachmentsconsole.println("Number of Objects: " + aDateObj.length);console.println("Number of DataObject files: " + sumObjects);} else {// actions to take if no file attachmentsconsole.println("Number of Objects: " + aDateObj.length);console.println("No DataObject files found.");} // end of DataObject file count processing // check if we have filesif(sumFiles > ) {// actions for found filesconsole.println("Total files found = " + sumFiles);} else {// action for no files foundconsole.println("No files found.");} // // end of total files
George Kaiser