Page 1 of 1

Inquiry Primary Key (Not server Generated)

PostPosted: Tue May 08, 2018 9:35 pm
by joseluis.clausen
Hi, i have a servoy form CRUD for a master table called "Personas" in Oracle 12c. In this table, the person_id (Primary Key) i enter for a user (i not need generate a PK with a autonumber). and i need verify that person_id not exists in the Database.

The sequence is :

1.- Click in New button
2.- foundset.newrecord()
3.- i enter the the person_id ** at this time, i need verify that this not exists in the database how can make?

thanks for your advance.
Best Regards,

Re: Inquiry Primary Key (Not server Generated)

PostPosted: Wed May 09, 2018 8:52 am
by abeermann

Query onDatachange of form element "person_id" !?
var qb = "select person_id from personas where person_id = ?"
var result = databaseManager.getDataSetByQuery(server_name,qb,[newValue],-1)
if(result.getMaxRowIndex() > 0)