Normal Topic Checking Unique Value don't work on numeric field (Read 834 times)
alex_smits
Member
*
Offline


No personal text

Posts: 27
Location: Arnhem, The Netherlands
Joined: Dec 15th, 2003
Checking Unique Value don't work on numeric field
Dec 1st, 2005 at 11:07am
Print Post Print Post  
I'have the following code

var vinvoernr as String

vinvoernr = INVOERNR

If @IsNew then

{

If vinvoernr = @XLU(@FN, invoernr, "inschrijvingen!invoernr", "invoernr") then

{
NotifyForm(1)
@MsgBox("Deze waarde bestaat al", vinvoernr, "Pas dit aan OF sluit af zonder op te slaan.")
}
}


Else

{
NotifyForm(0)

}

This code will only work on text fields, when i want to check my following number wat's a numeric field the code doesn't work.

The field have a custom format with 0 decimal places.
On a text field it works fine

Is there a possibility to get this work?
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Checking Unique Value don't work on numeric fi
Reply #1 - Dec 1st, 2005 at 6:46pm
Print Post Print Post  
Hello,

Is @Error being set?

Below is code to see if @Error is being set by the @XLU(). Just put it at the end of your existing code in that element.

Code
Select All
If @Error Then
{
	writeln("The X command Failed.")
}
Else
{
	writeln("The X Command did not Fail.")
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
alex_smits
Member
*
Offline


No personal text

Posts: 27
Location: Arnhem, The Netherlands
Joined: Dec 15th, 2003
Re: Checking Unique Value don't work on numeric fi
Reply #2 - Dec 1st, 2005 at 8:01pm
Print Post Print Post  
Yes @error will be set

if i  enter a duplicated value i get "The X Command did not Fail."

if i enter a unique value i get " The X command Failed."

Alex
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Checking Unique Value don't work on numeric fi
Reply #3 - Dec 1st, 2005 at 8:39pm
Print Post Print Post  
Hello Alex,

Give the following code a try.

Code
Select All
var vinvoernr as Double

vinvoernr = INVOERNR

If @IsNew Then
{
If vinvoernr = @TN(@XLU(@FN, invoernr, "inschrijvingen!invoernr", "invoernr")) Then
 {
 NotifyForm(1)
 @MsgBox("Deze waarde bestaat al", vinvoernr, "Pas dit aan OF sluit af zonder op te slaan.")
 }
}
Else
{
NotifyForm(0)
}
 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
alex_smits
Member
*
Offline


No personal text

Posts: 27
Location: Arnhem, The Netherlands
Joined: Dec 15th, 2003
Re: Checking Unique Value don't work on numeric fi
Reply #4 - Dec 2nd, 2005 at 7:11am
Print Post Print Post  
Thanks

This works !!  Smiley
  
Back to top
IP Logged