Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Conditional Apperence

Forum

Search UsersRules
Conditional Apperence
#1
Just came
Points:: 0
Joined:: Oct 10, 2022

In the documents section, you select the form section and the conditionals apperance section does not appear. For example, when a warning is selected somewhere, I want that part to be yellow when it is approved, and I want that part to be green, I cannot do this because there is no conditional apperence.

https://ibb.co/qYgjZvj

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

Hello Kadoryz,

judging by your screenshots, you are using the so-called "thick client".

However, conditional appearance can only be applied in the "thin client" when the application is running in managed application mode.

Please specify which 1C configuration you're using and what task you want to solve. Anf I'll try to help you.

Profile
#3
Just came
Points:: 0
Joined:: Oct 10, 2022

https://ibb.co/nDj34QX

Thank you for your help.

I am using an old version 1TÇ and what I want to do is that when I select the first of the selections that appear in the table row, I want the color of the selected part (Teklif Kalemlerine Ait Durmlar) to be yellow. When I select the others, I want the color to be different.

Profile
#4
Just came
Points:: 0
Joined:: Oct 10, 2022

Sorry, I posted the wrong picture above, this is the correct picture.

https://ibb.co/rFW3PNv

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

in general it's possible to do it...

i'll try to give you an example tomorrow

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

Hi Kadoryz,

the following code will help you:

The 1C thick client uses a different event model. In order for you to implement your task, you need to use the OnRowOutput event - take a look at the first screenshot.

The code will be something like this:

Code
Procedure TabularSection1OnRowOutput(Control, RowAppearance, RowData)
   
   colorRed    = New Color(255,0,0); // red
   colorBlue    = New Color(0,0,255); // blue
   
   If RowData.Product.Code = "000000001" Then 
      RowAppearance.BackColor = colorRed;
   EndIf;
   
   If RowData.Product.Code = "000000002" Then 
      RowAppearance.TextColor = colorBlue;
   EndIf;
   
EndProcedure


I think how the code works doesn't need to be explained. As you can see, you can change not only the background color, but also the font color and other parameters (screenshot 2).

And you can see the result in screenshot 3.

However, keep in mind that this method is not very efficient, as it is called every time the document's form changes. With a large number of rows, this can greatly slow down the program.

Profile
#7
Just came
Points:: 0
Joined:: Oct 10, 2022

Thanks for your help Aleksandr. Yes, what you say is true, I will take it into consideration.Have a good day.

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



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