# How to Enable/Disable HorizontalMenu Item

**URL:** <https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [June 3, 2024, 1:29pm UTC](https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288 "2024-06-03T13:29:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Pockele](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@Frank\_Pockele](https://forum.inductiveautomation.com/u/Frank_Pockele)\
**Post date:** [June 3, 2024, 1:29pm UTC](https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288/1 "2024-06-03T13:29:10Z")

</div>

I have a simple HorizontalMenu with 4 items

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/9/e90bce4c2ab58ecda645aae79add779a884c0f69.png)  
I want to disable the third item (ViewC) if a custom property "Version" is set to "Version1"  
I know that I can set an expression binding on the enabled property to accomplish this in this easy example ({view.custom.Version} != "Version1"), but in a more complex situation i want to call a custom method where i can create a more complex logic.

But i can't get i to work, any body that can help?

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [June 3, 2024, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288/2 "2024-06-03T14:21:58Z")

</div>

Add a scripting transform on your binding to do just about anything you need/want.

---

<div class="post-metadata">

**Author:** ![Frank\_Pockele](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@Frank\_Pockele](https://forum.inductiveautomation.com/u/Frank_Pockele)\
**Post date:** [June 4, 2024, 9:24am UTC](https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288/3 "2024-06-04T09:24:14Z")

</div>

That is also a possibility but if a second item needs the same disable logic i have the same logic in two different places, therefore i wanted it a common method

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 4, 2024, 9:40am UTC](https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288/4 "2024-06-04T09:40:03Z")

</div>

Create a custom boolean property, put the logic there, then bind the menu items to that property.

If you need more details, you'll also have to provide more details, particularly about the "But i can't get i to work" part - what did you try, and what didn't work ?

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [June 4, 2024, 12:18pm UTC](https://forum.inductiveautomation.com/t/how-to-enable-disable-horizontalmenu-item/91288/5 "2024-06-04T12:18:25Z")

</div>

You can do what @pascal.fragnoud mentioned or if the logic is the same but with different parameters, then put your logic in a scripting function and call that function with the custom parameters from the binding script transform.
