Condition in diff

Hello!

 

I have these 3 buttons that I want to hide or remove on a condition.

 

This is the code that removes them. 

 

If the Ownership Status (added in the attributes) is 'Inactive', then these buttons should dissapear.

 

Does anybody know how I can do this on a condition in diff?

Like 0

Like

2 comments
Best reply

First of all, rather than using operation: remove, change that to operation: merge, which will let you modify the properties of the element. Then, you'll bind the visible property of them to an attribute. To show or hide them, you'll set the attribute to true or false. See this article here for more details: https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Also, to set the attribute to true or false, you'll either need to add that to a change event for whatever fields use the conditions or when the page opens, using the onEntityInitialized function. To base it on the selection of fields, you can wire a change event as shown here: https://customerfx.com/article/triggering-an-event-when-a-field-is-chan…

Info on the onEntityInitialized function and other basic info on working with page code here: https://customerfx.com/article/getting-started-with-writing-code-for-bp…

Hope this helps get you started.

Ryan

First of all, rather than using operation: remove, change that to operation: merge, which will let you modify the properties of the element. Then, you'll bind the visible property of them to an attribute. To show or hide them, you'll set the attribute to true or false. See this article here for more details: https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Also, to set the attribute to true or false, you'll either need to add that to a change event for whatever fields use the conditions or when the page opens, using the onEntityInitialized function. To base it on the selection of fields, you can wire a change event as shown here: https://customerfx.com/article/triggering-an-event-when-a-field-is-chan…

Info on the onEntityInitialized function and other basic info on working with page code here: https://customerfx.com/article/getting-started-with-writing-code-for-bp…

Hope this helps get you started.

Ryan

Show all comments