Verify data against database field

34 views
Skip to first unread message

bigg...@gmail.com

unread,
Apr 7, 2021, 1:42:02 PM4/7/21
to Xataface
Ok, got a request from a (L)user of the system. 

There's a place where you can enter a 'relationship' between users...like spouse, etc. The other person *SHOULD* have an account in the system already. What's desired is when someone enters their unique user name/number (like R184A8), and clicks SAVE, if that user name doesn't exist in the system, it should throw up an error message. 

Looks like the fieldname_validate is what I'm after, but don't see how to get that to look in the MySQL table, but just at what's on the screen.  Thoughts?

tom wible

unread,
Apr 7, 2021, 1:58:06 PM4/7/21
to Xataface
why not give them a list of users to pick from?
in fields.ini:
[UserID]
widget:type = select
vocabulary = selectUserByName

in valuelists.ini:
[selectUserByName]
__sql__ = "SELECT Users.UserID, CONCAT(CAST(Users.UserID AS CHAR), ': ',Users.firstNAME, ' ', Users.lastNAME)  FROM Users  order by Users.lastNAME, Users.firstNAME;"

bigg...@gmail.com

unread,
Apr 9, 2021, 7:13:14 PM4/9/21
to Xataface
Nice!  That is an excellent option. Thanks!
Reply all
Reply to author
Forward
0 new messages