web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Simple JS Code to Show...
Power Apps
Unanswered

Simple JS Code to Show/Hide Tab Now Not Working

(1) ShareShare
ReportReport
Posted on by 69

Here is the code:

 

function ShowhideWasteAudits(executionContext) {
    var formContext = executionContext.getFormContext();
    var relationship = formContext.getAttribute("customertypecode").getValue();
    formContext.ui.tabs.get("tab_wasteaudits").setVisible(relationship === 3 || relationship === 12 || relationship === 13);
}
 
The code was working with the value options of 3 and 12, but when I added 13 it is giving an error. I think it's something stupid simple but have no idea what. Thanks in advance on any help.
Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard