Skip to main content link. Accesskey S

XPages Wiki

Submit Search

XPages Wiki Documentation

Home > Markup Examples > Source Code

Source Code

ShowTable of Contents

Source Code in no wiki

//--------------------------------
    this.prototype.checkForDoc = function(strSubject) {
    //--------------------------------
    try {        
        
    var doc:NotesDocument=subjectView.getDocumentByKey(strSubject,true);
    if(doc==null){
        return false;       
    }else{
        return true;
    }               
   
    } catch (e) {
            print (e);
        }
    }      

Source code in basic code

{code:}source{code}
//--------------------------------
    this.prototype.checkForDoc = function(strSubject) {
    //--------------------------------
    try {        
        
    var doc:NotesDocument=subjectView.getDocumentByKey(strSubject,true);
    if(doc==null){
        return false;        
    }else{
        return true;
    }                
    
    } catch (e) {
            print (e);
        }
    } 
    

Source Code with alt lines and numbering

{code:|an}source{code}
   1:  //--------------------------------
   2:      this.prototype.checkForDoc = function(strSubject) {
   3:      //--------------------------------
   4:      try {        
   5:      
   6:      var $name="fred"; //Testing dollar sign
   7:      var doc:NotesDocument=subjectView.getDocumentByKey(strSubject,true);
   8:      if(doc==null){
   9:          return false;        
   10:      }else{
   11:          return true;
   12:      }                
   13:      
   14:      } catch (e) {
   15:              print (e);
   16:          }
   17:      }        

Source Code with alt lines and numbering plus height restriction

{code:|an|50|100}source{code}
   1:  //--------------------------------
   2:      this.prototype.checkForDoc = function(strSubject) {
   3:      //--------------------------------
   4:      try {        
   5:          
   6:      var doc:NotesDocument=subjectView.getDocumentByKey(strSubject,true);
   7:      if(doc==null){
   8:          return false;        
   9:      }else{
   10:          return true;
   11:      }                
   12:      
   13:      } catch (e) {
   14:              print (e);
   15:          }
   16:      }