Hello everyone, I’m going to ask for help with something that is very complex for me and I’m not able to make it work as requested, I’m going to explain a little how it works and the best I could do.
I’m creating a CRM for property sales, and it’s important that before registering a new property, the system can inform me if it already exists. It doesn’t work because it seems that as I enter the information in the fields, it will be inserted in the table, so when the form is sent the property will always exist and duplicity will be accused. This is a serious error and I need this to work, the solution I created was to use a “hint” element that, based on a Javascript column, shows a warning that the property has already been registered, the Javascript column works in a simple way, it receives a number, and analyzes whether this number is in a joined list, these numbers are the concatenation of 3 values:
property number
zip code number
and property reference number
For better understanding, a house in any neighborhood will have the house number and the zip code. If it is an apartment, it will have the condominium number, zip code and apartment number, based on this we will have a number such as:
13033876123654
considering it is an apartment, for example. Considering this number, the Javascript analyst if it already exists in a joined list to find out if this record has already been made, the Row ID column has another purpose, here it is duplication of the property and not the record in the table, especially because in two rows in the table I can register the same property with the same data, and this cannot happen.
the perfect situation would be for the system to inform you that the property already exists and not lose the data already entered in the registration form, but if it can’t, ok, another thing, each action of the brokers is recorded in a control column, we need this to analyze events and ensure data security, etc. So I need to analyze this duplicity, before sending it to the tables so that an action is not registered without it actually occurring, this would trigger, several property registrations in failed attempts where the property was not registered, I tried to explain as much as possible of details.