Change field's color

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

Change field's color.
In Catalogs Counterparties, in ItemForm, there are field TIN. If enter number in TIN, and number already exist, field's color become red and can't be save.
If enter number in TIN, and number doesn't exist, field's color become green and can be save.

 
#2
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

Dear Gigha,

I strongly recommend that you do not do this, and perform all checks (including TIN) when trying to write.

The thing is that if you write a program code that will check every time the user enters whether such a TIN exists or not, then each time the program will make a server call, which can negatively affect performance.

 
#3
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

Quote
Dear Gigha,

I strongly recommend that you do not do this, and perform all checks (including TIN) when trying to write.

The thing is that if you write a program code that will check every time the user enters whether such a TIN exists or not, then each time the program will make a server call, which can negatively affect performance.

So, the TIN field can't change color if it already exists?

 
#4
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

You didn't get me. You can change the color of this field, it's very easy to do with the program code. We can simply use the "OnChange" event of the form element and make a query to the database, which will check - does such a TIN already exist or not?

But - imagine that the length of the TIN is ten characters. And when entering each character, the program every time will make query to the database. From the point of view of the correctness of the program architecture, this is incorrect and cannot be done!

Therefore, checks for duplication of elements are performed at the time of saving (or posting), but not at the time of user input of data.

 
#5
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

Code
Therefore, checks for duplication of elements are performed at the time of saving (or posting), but not at the time of user input of data.


How to checks for duplication of elements when saving (or posting) and change field's color?

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.