Alert not working
I have a formula that looks for duplicate records and if it finds one or more than it should bring back an alert. Not working anymore. Any suggestions?
let xLast := 'Last Name';
let xFirst := 'First Name';
let xEmail := Email;
let xPhone := Phone;
let x := xLast + xFirst;
do as server
let i := count(select 'Crewing Database' where upper(Lookup) = upper(x));
if i <= 1 then
alert("DUPLICATES NOT PERMITTED IN THIS FIELD")
else
let c := (create 'Crewing Database');
c.('Last Name' := xLast);
c.('First Name' := xFirst);
c.('Email Address' := xEmail);
c.('Phone Number' := xPhone)
end
end;
3 replies
-
alert() does not work inside a do as server. You are basically telling Ninox to alert the server.
-
I use this and works for me
let me := this; let myA := first(select Artists where 'Artist Name' like me.'New Artist'); if myA = null then if dialog("Waiting answer ", "Artist not found. ¿ Include now ??", ["Yes", "CANCEL"]) = "Yes" then let newA := (create Artists); newA.('Artist Name' := me.'New Artist'); alert(" The Artist has been included."); openTable("Artist"); openRecord(newA); 'New Artist' := null else alert(" ️ The Artist was not found, it is DUPLICATE "); 'New Artist' := null end else alert(" ️ The Artist already exists, can't be INCLUDED."); 'New Artist' := null end
-
removed to a server and bang it worked! Thanks thanks for the reply.
Content aside
- Status Answered
-
1
Likes
- 11 mths agoLast active
- 3Replies
- 86Views
-
3
Following