Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Change field's color

Forum

Search UsersRules
Change field's color
#1
Active user
Points:: 0
Joined:: Oct 15, 2024

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.

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

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.

Profile
#3
Active user
Points:: 0
Joined:: Oct 15, 2024

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?

Profile
#4
Administrator
Points:: 0
Joined:: Oct 3, 2019

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.

Profile
#5
Active user
Points:: 0
Joined:: Oct 15, 2024

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?

Profile
Subscribe
Users browsing this topic (guests: 2, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.