Hotfix will be available Monday.  It may have something to do with your spam gateway device.  We use Ironmail.  This cant be good…..

 

Xpages: Validation for a field, hopes this helps someone

On August 25, 2010, in xpages, by Mark Hughes

Today i needed to do some validation on an Xpages form.

The scenario
I had a field, it had typeahead enabled on an Xpage.  This view has 6000 documents so a combo box was out of the question.  I didnt really want to do a pick list either since most people know the number they want in the first place.  But i needed a way to figure out  if the value in the field existed in the view.

So i looked at adding a custom validator, couldn’t seem to make that work.  So i looked on the wiki and a few other places and discovered this.  Create a validateExpression validator.

In the expression field you need to add your code to calculate to true or false.  Syntax should be something like

return var1 == var2

Mine looked like

account1 = @Trim(@Text(document3.getItemValueString(‘job’)));
chargetype = document3.getItemValueString(‘jobaccount’);
db1 = new Array(“notes1”, “Applications\\viewpoint.nsf”)
var iffound = “”
if(chargetype == ‘Job’)


{  iffound = @Trim(@Text(@DbLookup(db1,”Project Import”,account1,1)));
return account1 == iffound
}
else
{return (@IsMember(account1, @DbColumn(db1,”Accounts7″,1))!= 0)
}

Then here is the part i didn’t get from the wiki post,  You need to add a DisplayError control next to the field you are validating.  Then set that displayerror to show error messages for that field you are validating.  It will not pop up like the simple can not be 0 or can not be empty messages you get from the default validators.

Anyways I hope this helps someone else.
 


ITANA V4.0 has been completely rewritten to work offline for editing and adding tasks.  As a great side benefit, ITANA opens quickly(sub 2 seconds) and moving between tasks is very very fast(sub second).   Since this update requires Domino 8.5.2(for the cache manifest), it will be released shortly after it is available later this month. Please let me know what you think

 

ITANA V4.0 has been completely rewritten to work offline for editing and adding tasks.  As a great side benefit, ITANA opens quickly(sub 2 seconds) and moving between tasks is very very fast(sub second).  Here are a few screen shots, notice that they were taken from airplane mode(offline for you non iPhone users).   Since this update requires Domino 8.5.2(for the cache manifest), it will be released shortly after it is available later this month. Video will be posted in the next few days.  Please let me know what you think