I think code is not neccesary. I only try to insert a record. If this record is duplicate, server sais to me "Internal Server Error". The question is how can i know that this server error is for duplicate entry and not for other reason. Do you know how to do it?
B4A log shows to me this issue, so i think that there is any way to detect it. See attached imagen.