Skip to main content

Posts

Showing posts from 2012

Commom Interview Questions for a Domino Developer

1. To find if a particular item exists in lost of items what commands are there in formula lang and lotusscript? Ans : Formula : @Contains; @IsMember Script : Instring 2. Difference between @UserRoles and @UserNamesList Ans : @UserRoles - Roles in the ACL which the user has @UserNamesList - Groups in the ACL to which the user belongs to 3. If there are multiple commands to be executed on a click of a button in formula lang, how will you do it And : @Do(@Command1;@Command2.....) 4. What is the difference between @DBColumn adn @DBLookup. Where will each of them be used? 5. File upload using Formula language? And : The field to which the file is uploaded should be a Rich Text Field. Command is @@Do(@PostedCommand([EditGotoField]; "Field Name");@PostedCommand([EditInsertFileAttachment])) 6. On click on a button in the left frame, open a view in the right frame. Ans : @SetTargetFrame("FRAMERIGHT"); @Command([OpenView];...

What is the difference between soft locking and document locking (sometimes called hard locking) in Lotus Notes®, and when are these locking features are enabled?

Document Locking: In Notes/Domino 6.x, a database property feature called "Allow document locking" was introduced. When this property is enabled, any user with Author access or above can lock a document across all replicas . This prevents two or more users from making changes to the same document and then replicating - which would create replication conflict documents. To enable this feature, you can select the database property "Allow document locking" in the basics tab. Soft Locking: Soft locking was also a new feature in Notes/Domino 6, but it was not documented as clearly as document locking. Soft locks are in-memory locks that are enabled when documents are in memory, and are not persistent. The editor takes out a soft lock on a document when it is opened in edit mode, and then unlocks it when the document is closed. During the period of time when it is soft locked, no one else can edit that document but it only affects the current repl...

Make Sure Your Stylesheets Have the Right Content Type

Why a Domino-based website lost all its CSS styling when viewed over the internet, whereas it worked fine when viewed via the local intranet. The browser in question was Internet Explorer and almost instinctively. It's when stylesheets are sent to the browser with the wrong content-type, like with this Page: Make sure you use "other" and enter "text/css", like so: Some browsers let you off with this mistake. Some don't (Firefox). IE only allows the wrong content type until viewed with "Internet" settings.

During application development, you may find that you are dealing with a database that contains numerous Profile Documents. Individual Profile Documents can be modified or deleted using the GetProfileDocument method, but this is a time-consuming process if there are thousands of Profile Documents. How can multiple Profile Documents be processed or deleted simultaneously?

For example, the following returns all profiles named "Profile-Name" from the current database: Dim s as New NotesSession Dim db as NotesDatabase Dim col as NotesDocumentCollection Set db = s.currentdatabase Set col = db.GetProfileDocCollection("Profile-Name") Call col.RemoveAll(True) In Notes/Domino 8.0 and later, the following agent script example would return and delete all profiles within the current database: Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim col As NotesDocumentCollection Set db = s.currentdatabase Set col = db.GetProfileDocCollection Call col.RemoveAll(True) Messagebox"All Profiles Document Deleted" End Sub Note: In the Agent properties > Runtime section, the Target should specify None.

Using LotusScript in Lotus Notes®/Lotus Domino®, how can you get a handle to selected documents in an embedded view? How can you set a form or view so that documents can be selected?

Dim s As New notessession Dim db As notesdatabase Dim col As notesdocumentcollection Dim doc As notesdocument Set db=s.CurrentDatabase Set col=db.UnprocessedDocuments Print "Collection size: " & col.count Set doc=col.getfirstdocument While Not doc Is Nothing 'Perform desired operations Set doc=col.GetNextDocument(doc) Wend

JavaScript Errors - Throw and Try to Catch

The try statement allows you to define a block of code to be tested for errors while it is being executed. The catch statement allows you to define a block of code to be executed, if an error occurs in the try block. The JavaScript statements try and catch come in pairs. Syntax try   {   //Run some code here   } catch(err)   {   //Handle errors here   }

Notes DOM

Replacing xpage tabbed panel with jQuery tabs:

Replace xpage tabbed panel with jQuery tabs. So that every time when the tabs are changing the refreshing won't occur. And it is fancy as you like. Step1: Paste the following code in the editor side of your xpage to get the tabs:   <script>     $(function() {         $( "#tabs" ).tabs();     });   </script> <div id="tabs">     <ul>         <li><a href="#tabs-1">Nunc tincidunt</a></li>         <li><a href="#tabs-2">Proin dolor</a></li>         <li><a href="#tabs-3">Aenean lacinia</a></li>     </ul>  <div id="tabs-1">        tab1 content     </div>     <div id="tabs-2">      ...

Sample HTML page.

<html> <title>Sample Test Page</title> <h1>Test Page</h1> <head> <script> function myFunction() { alert("Successfully submitted!"); } </script> <style> #header ul {     list-style: none;     padding:0;     margin:0; } #header li {     float: left;     border: 1px solid;     border-bottom-width: 0;     margin: 0 0.5em 0 0; } #header li a {     padding: 0 1em; } #header a {         padding: 0 1em;         text-decoration: none;         color: #a80;         background: #fe5; } #header a:hover {         background: #fc0;         color: #540; } body {         font: small arial, helvetica, sans-serif;   ...

sahaayane sahaayane

sahaayane sahaayane from saattai

Dynamically changing the combo box values in Javascript:(Lotus Notes)

I need to change the 2nd combobox value depend on the value of the first combobox value. Steps: 1) Create a combo box name it as "cmbValue" . And have some values. 2) Give  default value to that combobox. 3) In the Onchange of that combo box place the code below. 4) Create another combobox value and name it as "cmbValue1" . 5) Give default value to that combobox also. Sample Code(Modify according to your values):   var doc = document.forms[0].cmbValue; var doc1 = document.forms[0].cmbValue1; if(doc.options[doc.selectedIndex].text=="--Select--") { doc1.remove(0) doc1.options[0] = new Option("--Select--","cmbValue1") return false; } else { if(doc.options[doc.selectedIndex].text=="One") {     doc1.options[0] = new Option("four","cmbValue1")     doc1.options[1] = new Option("five","cmbValue1")     return false; } else if(doc.options[doc.selectedIndex].text=="Two") {     doc1.opt...

"Responses" and "Response to responses"

Lotus Notes has any kind of format of lotus notes document, but what about the “response” and “response to the response.” When you design the form in lotus notes application you can chosen: to create a document with the document format under the primary documents call “response document” or create a document under response documents call “response to the response.” Lotus notes develops can decide whether to provide some structure when you create notes documents. There are many cases that are more relevant documents are clear. Example: a data entry in a document, you can information to employees in the two documents to be attached to the first. Remember that you have entered in the accounting documents of each set a unique ID.  How to tie documents to respond to the main document is to add a field in response documents called $REF. $REF argues that ID is not taken into account. copies of the parent. How “responses” differ from “response to responses”? Do you have a hierarchy of do...

Lotusscript to establish ODBC connection:

The script, when executed from a button, will create a new record in a specified ODBC data source, attempt to save the new record and display a message indicating whether the operation was completed successfully. If the operation is not completed sucessfully, it is likely that either your data source is read-only or your ODBC driver does not permit updates to the data source. Important: Complete each of the four steps below before running the script. 1. Create a new agent and add the following UseLSX command to the Options event: UseLSX "*LSXODBC" 2. Add the following script to the Initialize event of the agent. NOTE: Do not add the 'Sub' and 'End Sub' lines. Dim ui As New NotesUIWorkspace     Dim uidoc As NotesUIDocument     Dim doc As NotesDocument     Dim connection As ODBCConnection     Dim query As ODBCQuery     Dim result As ODBCResultSet         Set uidoc=ui.CurrentDocument ...

Getting the Combo box and radio button values in javascript:

Put it on the Onchange of the Combo box field: var doc = document.forms[0].cmbGender; if(doc.options[doc.selectedIndex].text=="--Select--") { return false; } else { alert(doc.options[doc.selectedIndex].text) return false; } Put it on the onchange of the radio button: var doc = document.forms[0] rdButtonvalue="" for(i=0;i<rdGender.length;i++) { if(rdGender[i].checked) { alert(rdGender[i].value) } }  

To find the number of seconds, minutes, hours, days, weeks between the two selected dates in lotus script.

Dim workspace As New NotesUIWorkspace     Dim uidoc As NotesUIDocument     Dim varDate1 As NotesItem     Dim varDate2 As NotesItem     Dim dt1 As NotesDateTime     Dim dt2 As NotesDateTime     Dim dt3 As New NotesDateTime("")     Dim dt4 As New NotesDateTime("")     Dim diffSeconds As Long     Dim minutesLeft As Long     Dim hoursLeft As Double     Dim daysLeft As Integer     Dim weeksLeft As Integer     Dim monthLeft As Integer     Dim remDays As Integer     Dim mNames As Variant     Dim currMonth As String     Dim lastMonth As String             Set uidoc = workspace.CurrentDocument     Set varDate1 = uidoc.Document.GetFirstItem("txDate1")     Set dt1 = varDate...

Duplication check in Lotusscript

CODE: Function IsDocumentDuplicate (db As NotesDatabase, viewName As String, _ keyColumnName As String, doc As NotesDocument, errorMsg As String) IsDocumentDuplicate = False Dim viewLookup As NotesView Dim docLookup As NotesDocument Dim errorString As String errorString = "Document already exists in the database!" Set viewLookup = db.GetView(viewName) If Not viewLookup Is Nothing Then Set docLookup = viewLookup.GetDocumentByKey(keyColumnName, True) If Not docLookup Is Nothing Then If doc.IsNewNote Then errorMsg = errorString Exit Function Else If doc.UniversalID <> docLookup.UniversalID Then errorMsg = errorString Exit Function End If End If Else errorMsg = "Error getting doc object for lookup document!" Exit Function End If Else errorMsg = "Error getting view object for lookup document!" Exit Function End If IsDocumentDuplicate = True End Function

Common web based questions in lotus Notes.

1. Which server task is used for Lotus Notes web applications? 2. What are the commands to load and quit the HTTP server task? load http tell http quit restart task http 3. What are the programming language used for web applications? 4. What is pass - thru HTML, how to use it ? Notes rich-text has a feature called 'Pass-thru HTML.' This is text that the Domino server will NOT attempt to format for the web, it will just 'pass it through'. If you create content with a Notes client that gets published to the web, you may wish to use this so you can 'hand-code' your HTML for special effects or some other purpose. 5. What is the difference between pass - thru html and Render pass thru html in Notes ? Check "Render pass through HTML in Notes" in the Form or Page Properties box to have the Notes client process the HTML. If you do not check "Render pass through HTML in Notes," the HTML appears as plain text. 6. What changes are to be done for a Form ...

Remote Service in Xpages

Remote Service: communicating from client side to server side json remote procedure call Can create ssjs methods in remote service gettting the inputbox value through ssjs for refreshing. Method initiating the ssjs and fetch the values from the input box control return the value generated from the ssjs and v can use it in csjs. service name in the Remote service: myRPC method name should be given next step is to create the ssjs in the remote service do not write the ssjs in the computed value of the script property. whatever the value obtained from the ssjs stored in the myResult variable

$$ Return in Lotus Notes web

viewName:=@Subset(@ViewTitle;-1); @If (Action=6;"[/"+DbReferer +"/"+viewName+"/"+@Text (@DocumentUniqueID ) + "?EditDocument]";Prj_IsNewDoc=1 | viewName = "lkupAllProjects"; "[/"+DbReferer +"/vwMyAllDocuments?OpenView&restricttocategory=" + CurrentUser + "]"; viewName="vwAllMyDrafts" | viewName="vwAllWaitingMyApproval" | viewName="vwMyAllDocuments"; "[/"+ DbReferer +"/" + viewName + "?OpenView&restricttocategory=" + CurrentUser + "]"; "[/"+ DbReferer +"/" + viewName + "?OpenView]")

Xpages Tips

Tips Solution Themes in OneUI Layout: 1) Oneuiv2.1 2) Oneuiv2.1_blue 3) Oneuiv2.1_gen1 4) Oneuiv2.1_gold 5) Oneuiv2.1_green 6) Oneuiv2.1_onyx 7) Oneuiv2.1_orange 8) Oneuiv2.1_pink SSJS @Adjust on Javascript Dates: The following code will generate results that you may not expect: Eg : var myDate = new Date(2010,2,15); //this is MARCH 15th, months for JSDate is zero based myDate = @Adjust(myDate,0,-1,0,0,0,0); //--> expected date 2/15/2010 The key is to specify the "[InLocalTime]" keyword to the @Adjust function, so the correct call would be: @Adjust(myDate,0,-1,0,0,0,0,"[InLocalTime]") Open Links in Own window in Ext Lib App Layout: To open the link in its own window, you will use a simple JavaScript Function: window.open(“http://www.mydomain.com”, “_blank”); Now, if you try to add this to the href property, it will not work, because it would be regarded as a link and not a JavaScript Function. So, t...

Xpages issues and Solutions

Issue List Solution For opening a '<a href>' in Xpage in new window, pls use this code: docID:=@Text(@DocumentUniqueID); database := @Subset(@DbName; -1); databasename:=@ReplaceSubstring(database;"\\";"/"); server :=@ServerName; servername:=@Name([Abbreviate];server); xspfrm:=@If(form="FormA";"XpageA.xsp"; form="FormB";"XPageB.xsp";"XPageC.xsp"); "<a href='/"+databasename+"/"+xspfrm+"?databaseName="+servername+"!!"+databasename+"&documentId="+docID+"&action=openDocument' target=_new>"+Open Document+"</a>" Redirecting one Xpage to another Xpage: If Redirecting One Xpage to another Xpage is done by using “redirectToPage” function available in SSJS @DbColumn in SSJS: var viewHandle:NotesView=database.getView(viewName) return viewHandle.getColumnValues(...