Friday, December 30, 2011

Validation for Text field

In Xpage, If we want to validate the Text filed, e have two choice...

1. Use of Xpage properties, We can validate

2. Use of java Script.,

In first one, We have one contradiction for validating the fields. If you want to move the page to home page, the validation does not allow you to go the Home page.

So the best way to validate the field is javaScript...
In @formula we have the @match for exact validation of fileds. Samething is here in java script is regular expression...

For Ex:

Text Field Validation:

var name=document.getElementById("#{id:inputText1}").value;
var patt=/([a-z][A-Z])/i;
var num=/([0-9])/i;
var numflag=name.match(num);
alert(numflag);
var flag=name.match(patt);
var len=name.length;
if(len==0)
{
alert("Enter the Name");
exit(0);
}
else if((flag==null) || (numflag!=null))
{
alert("Enter the Propername");
exit(0);
}
alert("Correct Value");



Exit sub for @formula is @return

Basically We confused for many times because handling the @formula...

When we are executing the @if commands there will some problem we will get ...

@if(
@isnull(fieldName)
@prompt(1;"Alert";"Field is Null");
@prompt(1;"Alert";"Field is Not Null")
);
@prompt(1;"";"Here will be executed when the @if command finished");
.................
.................
.................

After executing the @if condition, @formulas never bother about condition falls True or False. It continues the execution...

Here we can handle the situation using @return command.

Example:

@if(
@isnull(fieldName)
@return(@prompt(1;"Alert";"Field is Null"));
@prompt(1;"Alert";"Field is Not Null")
);
@prompt(1;"";"Here will be executed when the @if command finished");
.................
.................
.................

Here If the Validation returns "Field is Null", It does not continues the execution...

Invalid and nonexistent document "IBM ERROR"

I got a Problem While transferring document from one to another....

[Best way to Recover "Copy All your form Contents and Paste it to Another form..."]

Their i used @mailsend(;;;;;;;"[IncludeDoclink]);

But the IBM Error Occurs "Invalid and nonexistent document"

After that I try to preview my corresponding( to that Document) Notes form...

Similar Error was thrown...

I think that We have No option...

There are some Option i found in NET but that as not working in my PC (Notes 8.5.2)

1. In server Your db may corrupt so only that Error Came, you type the following in Server

>LOAD FIXUP filename


2. Clear Cache.NDK in notes data Directory... and It may be Run....

3. Reinstall notes After taking Backup

4. I did Copyall the corresponding form and Renamed. Make a new form as same name as old.. And i pasted Every thing.. their I have lost Some data Not All....

"Lotus Script" How to Put Values In Combo box

Step 1:

First, In my Knowledge there is no direct way for this Task. Make a field as hidden.

Step 2:

Get the values Dynamically, And put it in our hidden field using FieldAppendText with seperator "," .

Step 3:

After that, Using Combo box formula window Write a single line code as follow

"@Explode(HiddenFieldName;";")

Step 4:

Never forget one thing that is to check the property given Below...

Lotus Script code:

Dim ws As New
NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set
uidoc=ws.currentdocument
Dim ns As New NotesSession
Dim db As
NotesDatabase
Dim doc As notesdocument
Dim vw As
notesview
Dim vc As NotesViewEntry
Dim vec As
NotesViewEntryCollection
Set db=ns.CurrentDatabase
Set
vw=db.GetView("vwName")
Dim ab As
Variant
Dim str1 As String
ab=vw.GetColumnValues(0)
Forall
a In vw.GetColumnValues(0)
If str1=""
Then
str1=a
Else
str1=str1+","+a
End
If
End
Forall
Call uidoc.FieldSetText("test",str1)
Call
uidoc.Refresh

To view the Design Elements In Our Own View

%Rem

If we want to view our Documents is Possible in Lotus Notes

But If we want to view the Design Elements Like Forms , Views, Folders, Agents, Script -

Libaraies and Etc.,

Blindly Someone says "NO"

But It is Possible...

By

LOTUS NOTES "$FLAGS" AND "$FORMULA CLASS" Reserve Fields

End %Rem


Step : 1

'Agent Code In Initialize

Sub Initialize()
Dim ns As New
NotesSession
Dim db As NotesDatabase
Dim vw As
NotesView
Dim doc As NotesDocument
Dim a As
Integer
Set db=ns.currentdatabase
Set
vw=db.Getview("ViewName")
Set
doc=db.Getdocumentbyunid(vw.Universalid)
Call
doc.Replaceitemvalue("$FormulaClass","1548")
doc.save
True,True
End Sub

Step :2

' And We Have some Hidden Fields In All Design Elements

' We Have To Create Two Columns in our View,

' Use The Following Code in our First Column

'Column Name : Type

@If(
@Contains($Flags;"W");"Pages";
@Contains($Flags;"Y");"Views";
@Contains($Flags;"F");"Folders";
@contains($Flags;"");"Forms";
"Others"
)

' And In Second Column You Put Default Value As $Title

'Displays the Forms, Pages , view and Other Design Elements

Step :3

* Run the View,

* Select the some Documents that May be "HIDDEN"

* And Run the Agent

* Press Shift + F9

* You will See, What U want...
For More Information goto
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/view-of-design-elements.htm