Jump to content
Server Maintenance This Week. ×

Is Conditional Formatting applied


sal88

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

Recommended Posts

Hi all

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

 

Thx

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This topic is 3195 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.