IsValid

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)?

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
{}