IsValid

Questions, tips and tricks and techniques for scripting in Servoy

IsValid

Postby Riccardino » Wed Aug 13, 2003 12:00 pm

Hi,

I tried to reproduce the IsValid function without using the fmp_isValid command.

I thought (erroneously) that I could use a boolean function to determine if there are related records, but if I write

if (clienti_to_webemail = true )
{
elements.portal_clienti_to_webemail_70.visible = true;
}
else
{
elements.portal_clienti_to_webemail_70.visible = false;

}

the method has no effect.
I found a different way (I used if (clienti_to_webemail.recordIndex > 0 ), instead), but I'd like to know more about using the boolean: is it possible to use it to get to know if a relation is valid (in FileMaker's sense)?
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby maarten » Wed Aug 13, 2003 1:51 pm

if (clienti_to_webemail.recordIndex > 0 )
{

You can also check like this:
if (clienti_to_webemail.recordIndex)
{

"clienti_to_webemail.recordIndex" returns true or false in itself.


related note:
When checking fieldvalues you can do this:
if(myTextField)
{}
else
{}

instead of...
if(myTextField != null && myTextField != "")
{}
else
{}

or...
if(myIntegerField != 0)
{}
else
{}
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 1 guest