Refresh a form keeping its field values


To refresh a form keeping its field values as is:

http://authorsloft.com/SupportRef.nsf/e6b464faa52c14d1852567d90082c48f/1c05fb75304ce7a685256b710005fb38!OpenDocument

Copied the content from the above link:
Domino form / document refresh using JavaScript:

Better Option (Domino6 + ):
if(ValidationFunc()==true) {
return _doClick('$Refresh', this, null);
}

A longer version to specify a frame and what field to base refresh on:
return _doClick('$Refresh', this, '_self', '#_RefreshKW_' + 'somefieldname' );

To refresh the document

To refresh the entire document in client : @Command([ViewRefreshFields)
And to refresh entire document in web : _doClick('$Refresh', this, '_self', '#_RefreshKW_')

To run an agent from lotus notes webpage

To run a Lotus-script agent from a lotus notes webpage:

1) Write @Command([ToolsRunMacro]; "(MyWebAgent)") in the button's programmer pane Client > Formula and it will work when you click the button. No need to do Pass-thru HTML for this button.

If for some reason you are still not able to achieve your result, you can use an indirect approach, i.e.

2) In your button where you have written the code for running the agent, in it's Properties > HTML tab, give a name  and id to it. It's better if we keep the value for Name and ID same.

Then create another Button or link and in that write in the programmer pane Web > Javascript, document.forms(0).<the button's ID value>.click()

i.e. document.forms(0).btnCheckDuplicate.click()

Thus, the first button will be triggered with the click() event and your agent will run.

Proper way to logout a website...

Proper way to logout is a website in lotus notes:

After you use the default logout code you must redirect the page to another page.
This way if a PC is being used by multiple users it will not open the same session.
Once you redirect to another page, it kills the session completely post logout.

Syntax:
top.location = self.location.href.substring(0,self.location.href.indexOf('.nsf') +4) + "/<framesetname>?logout&redirectTo=http://"+window.document.forms[0].Server_Name.value+"/"+window.document.forms[0].DBNameTX.value+"/";

This is a response that I posted in IBM developers forum.
http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/7ba21b9304eaa6d6852570e500215ebf?OpenDocument

$$Fields and Reserved Notes Field Names Glossary



I got this content long back from some website.. can't remember.
I found it very useful. So, here it is for your use..


$$Fields and Reserved Notes Field Names Glossary
Anonymous on 08/26/1999 at 07:51 PM

Category: Notes Developer Tips
Forms/Subforms, Formulas
$$ Fields

$$HTMLhead
If you don't use the "For Web Access: Treat document contents as HTML" form property, adding a $$HTMLHead field to a form allows you to pass HTML information, such as Meta tags and JavaScript, to the Head tag for a document. The field can be any data type, but a hidden computed-for-display text field is the best choice.
(source: Notes Help 4.6)

$$QueryOpenAgent (4.6) or the form event WebQueryOpen (4.6)
The Notes Help 4.6 says about WebQueryOpen: A WebQueryOpen event runs the agent before Domino converts a document to HTML and sends it to the browser. Domino ignores any output produced by the agent in this context.
Create a shared agent that runs manually. Then write a formula that uses @Command({ToolsRunMacro}) to run the agent and attach it to the WebQueryOpen form events.
This simulates the LotusScript QueryOpen form event that isn't supported on the Web.
The $$QueryOpenAgent field works in the same way. Works also in 4.6.


$$QuerySaveAgent (4.5) or the form event WebQuerySave (4.6)
The Notes Help 4.6 says about WebQuerySave: A WebQuerySave event runs the agent before the document is actually saved to disk. The agent can modify the document or use the document data to perform other operations.
Create a shared agent that runs manually. Then write a formula that uses @Command({ToolsRunMacro}) to run the agent and attach it to the WebQuerySave form events.
This simulates the LotusScript QuerySave form event that isn't supported on the Web.
The $$QuerySaveAgent field works in the same way. Works also in 4.6.


$$Return
After Web users submit a document, Domino responds with the default confirmation "Form processed." To override the default response, add a computed text field to the form, name it $$Return, and use HTML as the computed value to create a customized confirmation.
(source: Notes Help 4.6)


$$ViewBody
Value is view name (in quotes) or a formula that computes the view name. Same as Embedded View.
(source: Notes Help 4.6)
This is the field you put in a form to display a view. See also the list of $$ forms below.


$$ViewList
Has no value. Same as Embedded Folder Pane.
(source: Notes Help 4.6)
This is the field you put in a form to display the list of available views and folders. See also the list of $$ forms below.


$$NavigatorBody, $$NavigatorBody_n
Value is navigator name (in quotes) or a formula that computes the navigator name.
Same as Embedded Navigator. To create multiple $$NavigatorBody fields on a form, append an underscore and a character to each subsequent field name.
(source: Notes Help 4.6)
This is the field you put in a form to display a navigator. See also the list of $$ forms below.




The following fields are not $$ fields, but they are reserved names in a Web context.


Table of CGI variables from the Notes Help 4.6


Domino captures the following CGI variables through a field or a LotusScript agent. You can also capture any CGI variable preceded by HTTP or HTTPS. For example, cookies are sent to the server by the browser as HTTP_Cookie.


Auth_Type
If the server supports user authentication and the script is protected, this is the protocol-specific authentication method used to validate the user.

Content_Length
The length of the content, as given by the client.

Content_Type
For queries that have attached information, such as HTTP POST and PUT, this is the content type of the data.

Gateway_Interface
The version of the CGI spec with which the server complies.

HTTP_Accept
The MIME types that the client accepts, as specified by HTTP headers.

HTTP_Referer
The URL of the page the user used to get here.

HTTPS
Indicates if SSL mode is enabled for the server.

HTTP_User_Agent
The browser that the client is using to send the request.

Path_Info
The extra path information (from the server's root HMTL directory), as given by the client. In other words, scripts can be accessed by their virtual path name, followed by extra information that is sent as PATH_INFO.

Path_Translated
The server provides a translated version of PATH_INFO, which takes the path and does any virtual-to-physical mapping to it.

Query_String
The information that follows the ? in the URL that referenced this script.

Remote_Addr
The IP address of the remote host making the request.

Remote_Host
The name of the host making the request.

Remote_Ident
This variable will be set to the remote user name retrieved from the server. Use this variable only for logging.

Remote_User
Authentication method that returns the authenticated user name.

Request_Method
The method used to make the request. For HTTP, this is "GET," "HEAD," "POST," and so on.

Script_Name
A virtual path to the script being executed, used for self-referencing URLs.

Server_Name
The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.

Server_Protocol
The name and revision of the information protocol accompanying this request.

Server_Port
The port to which the request was sent.

Server_Software
The name and version of the information server software running the CGI program.

Server_URL_Gateway_Interface
The version of the CGI spec with which the server complies.


Associated with a lot of the $$ fields are the following forms:

$$ViewTemplate for viewname
Requires a embedded view or $$ViewBody field
Associates the form with a specific view. The form name includes viewname, which is the alias for the view or when no alias exists, the name of the view. For example, the form named "$$ViewTemplate for By Author" associates the form with the By Author view.
Domino requires an Embedded View or the $$ViewBody field on the form, but ignores the value.
(source: Notes Help 4.6)

$$NavigatorTemplate for navigatorname
Requires a embedded navigator or $$NavigatorBody field.
Associates the form with a specific navigator. The form name includes navigatorname, which is the navigator name. For example, the form named "$$NavigatorTemplate for World Map" associates the form with the World Map navigator.
Domino requires an embedded navigator or the $$NavigatorBody field on the form, but ignores the value. Domino ignores create and read access lists on the form.
(source: Notes Help 4.6)

$$ViewTemplateDefault
Requires a embedded view or $$ViewBody field.
Makes this form the template for all Web views that aren't associated with another form.
Domino requires an embedded view or the $$ViewBody field on the form, but ignores the value.
(source: Notes Help 4.6)

$$NavigatorTemplateDefault
Requires a embedded navigator or $$NavigatorBody field.
Makes this form the template for all Web navigators that aren't associated with another form.
Domino requires an embedded navigator or the $$NavigatorBody field on the form, but ignores the value.
(source: Notes Help 4.6)

$$SearchTemplate for viewname
Associates the form with a specific view. Domino requires the $$ViewBody field, but ignores the value. The form name includes viewname, which is the alias for the view, or, when no alias exists, the name of the view. For example, the form named "$$SearchTemplate for All Documents" associates the form with the All Documents view.
(source: Notes Help 4.6)

$$SearchTemplateDefault
Domino requires the $$ViewBody field, but ignores the value. This form is the default for all Web searches that aren't associated with a specific form.
(source: Notes Help 4.6)

$$SearchSiteTemplate
In a site search this form is used in stead of $$SearchTemplateDefault
(source: posting by Andrew S Grant on Notes.Net)

$$Search
When a user initiates a text search from the Web, Domino looks in the current database or in the search site database in a multiple-database search for a form with the actual name or the alias name $$Search. If the form exists, Domino opens it; otherwise, Domino displays the default search.htm file stored in the domino\icons directory.
(source: Notes Help 4.6)


And another set of very useful forms (i didn't even know they exsisted until a few moments
before):

$$ReturnDocumentDeleted
Displays to Web users when the user successfully deletes documents. Create an editable text field named MessageString to hold the error message.
(source: Notes Help 4.6)

$$ReturnAuthenticationFailure
Displays to Web users when the user's name and password can't be verified. Create an editable text field named MessageString to hold the error message.
(source: Notes Help 4.6)

$$ReturnAuthorizationFailure
Displays to Web users when the user doesn't have a high enough access level to access the database.
Create an editable text field named MessageString to hold the error message.
(source: Notes Help 4.6)

$$ReturnGeneralError
Displays to Web users when any other errors occur.. Create an editable text field named MessageString to hold the error message.
(source: Notes Help 4.6) 

Validating a rich text field

Validating a rich text field:

http://www.ibm.com/developerworks/lotus/library/rich-text-field-notes/

I have copy pasted the three methods from the above link for my reference.

Method 1

In the first method, if the field contains any input (even only a single space character), then it can pass the validation. This validation uses the Querysave event of the form that contains the field. The following LotusScript sample code performs this validation:


Sub Querysave(Source As Notesuidocument, Continue As Variant)
            If ( Source.FieldGetText( "rtfield" ) = "" ) Then
                 Messagebox( "Please enter some text." )
                 Call Source.GotoField( "rtfield" )
                 Continue = False
         End If
End Sub


The code checks for any character in the field rtfield. If the field contains input (even if it consists solely of one or more space characters), then validation succeeds. If the field is empty, then the code returns an error message, and doesn’t save the document (by setting Continue to False).

Method 2

In the second method, the rich text field must contain at least one non-space character (in other words, an input consisting entirely of one or more spaces is not allowed). This check also uses the Querysave event of the form:


Sub Querysave(Source As Notesuidocument, Continue As Variant)
        
         Dim rtitem As NotesRichTextItem
         Set doc = Source.Document
         Set rtitem = doc.GetFirstItem( "rtfield" )
         Dim text As String
        
         text$ = Source.FieldGetText("rtfield")
         trimmed$ = Trim(text)
           
            if ( trimmed$ = "") Then
                 Msgbox "Please enter some text."
                 Continue = False
                 source.GotoField("rtfield")
                 source.Refresh(True)
         Else
                 Continue = True
                
         End If
End Sub


Method 3

Our third method validates a rich text field in which an input consisting solely of an attachment, embedded object, or link is allowed, even if it includes no accompanying text. Once again, we use the Querysave event of the form containing the field:



Sub Querysave(Source As Notesuidocument, Continue As Variant)
        
         Dim rtitem As NotesRichTextItem
         Set doc = Source.Document
         Set rtitem = doc.GetFirstItem( "rtfield" )
         Dim text As String
        
         text$ = Source.FieldGetText("rtfield")
         trimmed$ = Trim(text)
        
         If(doc.Hasembedded)  Then
                 Continue = True
                                  
         Elseif ( trimmed$ = "") Then
                 Msgbox "Please enter some text."
                 Continue = False
                 source.GotoField("rtfield")
                 source.Refresh(True)
         Else
                 Continue = True
        
            End If
End Sub


This code will work if there is an attachment anywhere in the document, even if it's not in the field that is being validated.

Clever barcode on the Savana cider bottles, love it when companies do something different!

My Review of Juno 29" Backless Bar Stool

Originally submitted at All Barstools


Features:

  • Solid hardwood construction
  • Black faux leather seat with high density foam
  • French leg with tampered bottoms
  • Full ring footrest for strength and stability
  • Seat height: 29"
  • Dimensions:...


  • Average...nothing to praise.

    By Becca from Texas on 4/11/2011

    2out of 5

    I bought four of these chairs and was a bit disappointed. Not all the chairs are manufactured the same. Once I installed the legs, the chairs wobbled. One leg from the four was shorter and I had to find a creative way to level the legs. Pretty disappointed but not enough to send them back.

    (legalese)

    Video tutorial- How to create lists on facebook and how to block individuals and lists from seeing info on your profile and your status updates.

    In this Video tutorial I explain why creating lists for your friends on facebook is a good idea and how to make those lists. I then show you how to send status updates to specific lists or individuals and/or how to block people from seeing that status update. 

    I also show you how to block specific information like your email address, family members, phone number and a lot more from people and specific lists or how to only allow certain people to see that information. 

    Posted via email from Edwin Watson's posterous

    View and Disable Read Receipts in Lotus Notes

    This tip is for people who are worried about getting e-mail messages that contain a request for return receipt. When you open a message in Lotus Notes that contains a request to send a return receipt to the sender, Notes automatically submits the return receipt the moment you double-click the message and open it. It doesn't even prompt you if it's OK to send a receipt to the sender! Many of us find this annoying, especially when there are situations where you do not want this to happen. (Like times when you don't want your boss to know when you read the message!) Well, here is a way to circumvent this situation.

    1. Create a private view just like the Inbox view. First create a private view to duplicate the Inbox view. You can do this from the Create->View menu option. Enter a name for your view, say, MyInbox for the View Name and be sure to select Private for the View Type. Leave other things to be defaults and click on the Customize button.
    2. Insert a new column in your private view. Now customize your private view by inserting a new column. You can do this by first clicking on the second column in your view (labeled Who) and then selecting the Create->Insert New Column...menu option.
    3. Modify the new column to add some code to identify messages with return receipts in them. Double-click on the new column you just created and type in a Title (e.g., Return Receipt). (You may choose to leave the title blank; it's up to you.) In the column properties window, make sure the option "Display values as icons" is checked. In the Display options for the view, click on Formula and enter the following code: @If( ReturnReceipt="1";80;"") Note: If you see a warning message that all changes will be lost, click OK. You are basically changing the default display option to a custom display option using a formula.
    4. View your message through your private view. You are all set now. Just re-open your mailbox again. This time you should see the private view you just created, at the very bottom of the views and folders list. Click on it to see all the mails you saw in your Inbox, but this time, any mails that have a return receipt are flagged with a red icon. (Just like the No Entry road sign.)
    From now on, just go to your private view to see if the new message you received contains a return receipt or not.  

    DISABLE A RETURN RECEIPT


    Just like this tip shows you how to see if a message contains a return receipt, there is a way to delete this flag totally from the message so that the return receipt never gets sent to the sender.

    Disabling return receipts:
    1. Open your inbox.
    2. Click View->Agents.
    3. Click New Agent action button.
    4. Type the name of agent (e.g., Disable Return Receipt).
    5. Select "Actions Menu Selection" in the "Runtime" field.
    6. Select "All Selected documents" in the "Target" field.
    7. Click the Add Action button below.
    8. Select the @Function Formula from the list of Actions.
    9. Copy and Paste the code below in the formula then click OK.
      FIELD ReturnReceipt:=ReturnReceipt;
      @If(ReturnReceipt="1";
      @SetField("ReturnReceipt";"0");
      ""
      );
      SELECT @All
    10. Press Esc, then save.
    11. To use this, select the message with the return receipt then click Actions->Disable Return Receipt.