0

if statement
Hello everyone and happy new year!
I have this situation:
-Table1 with a Code text field
-Table2 with a Key text field and a button
This is the formula on the button
if Key = Table1.Code then
alert(“Right”)
else
alert(“wrong”)
end
So, if I write someting on the Code field and the same on the Key field, I always get the same message: wrong!
Why?
Thank you
Like Follow
6replies
-
Table1.Code What it is?
I think you must first select a record in your Table1 and after you can work with them.
Basically :
let myItem := (select Table1 where ID = yourIDYouNeed).Code;
//Verify if your item is empty or more than one.
if cnt(myItem) = 0 or cnt(myItem)>1 then
alert(“I find 0 item or more 1);
”Make nothing“;
void;
else
alert(”I find 1 and only 1 item);
“Make your business logic here”;
end