Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Is Conditional Formatting applied


This topic is 3395 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all

Is there a calculation that can determine whether a layout object's conditional formatting is applied at a given moment?

 

Thx

Posted

Nothing major. I have buttons that have conditional formatting. I want to prevent the script running if the condition for the formatting is not met.

It would just save me having to have the criteria in both the script and the object's conditional formatting.

Posted

It would just save me having to have the criteria in both the script and the object's conditional formatting.

Can you capture the calculation logic into a custom function, and then cite that in both the conditional formatting expression and in a guard clause in your script?  That would allow you to maintain the underlying logic in just one place (DRY). Just a thought.

Posted (edited)

It would just save me having to have the criteria in both the script and the object's conditional formatting.

The best way to do this, IMHO, would be to define a calculation field and use the result both for the conditional formatting and for the script. Or use some layout object to declare a global variable, which you can then use in the same manner. Or perhaps a custom function will do (we know nothing of the nature of the calculation, so...).

The alternative using GetLayoutObjectAttribute() would be more complicated, not less - assuming it even works, which I haven't tested. Also keep in mind that a condition may exist, but the window hasn't been refreshed yet. It's best to stay at data level for this type of thing.

 

Edited by comment
Posted

Thanks guys, I'll do an underlying calculation that both the script and formatting can refer to.

AFAIK GerLayoutObejctAttributes can't ascertain the type of formatting I'm using.

Cheers

Posted

We won't know that until you tell us what it is.

Good point - the formatting is text, fill and border colour. In the help though, I can't find any attributes within the function that refer to any formatting at all, only dimensions. Did I miss something?

This topic is 3395 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.