In Servoy 7.4 I can do the find() on a uuid field. When i try in webclient I get the error:
ERROR: operator does not exist: uuid = character varying. You might need to add explicit type casts.
I couldn’t find a method to set String.toUUID(), only the other way around.
It’s a dynamically find method: Depending on user selection it performs a search on multiple fields. Fields and search values are stored in an object.
With JSDOC type I have declared the attributes as UUID but still it seen as String.
{{user_uuid:UUID, solution_uuid:UUID, project_uuid:UUID, group_uuid:UUID}} oSELECTION
var sField
if (foundset.find()){
for (sField in oSELECTION){
foundset[sField]=oSELECTION[sField];
foundset.user_uuid
}
foundset.search();
}
Can anyone please tell me how to handle this?
Thanks in advance.
japink.m:
With JSDOC type I have declared the attributes as UUID but still it seen as String.
That’s correct, it’s documentation not code.
Adding JSDoc will help the parser nothing more.
japink.m:
I couldn’t find a method to set String.toUUID(), only the other way around.
you can use: application.getUUID()
Hope that last bit helps you to solve the problem.
Thanks for your reaction .
No it keeps complaining. I changed the search criteria to:
foundset[sField]=application.getUUID(oSELECTION[sField]);
smartclient is still working. Webclient won’t work. I don’t understand why web is behaving here different from smart. I flagged the uuid columns so Servoy should be aware?
Are there any examples with find and UUID? Cannot find any.
Hi, you can try the following to see if it helps – it works in smart-client.
You need to change the query to match your table and field names.
var query = "SELECT uid FROM some_table WHERE uid LIKE ? ORDER BY something";
var args = [];
//search_for is a uuid.
args.push(search_for + "%")
if(controller.loadRecords(query,args)) {
//you may have found something
}
you can make a case so that we can look at it.
i guess when you have a UUID field in the db. we really need to use a special setXxxx on the sql statements or something