Thursday, 24 November 2022

Hide Tab using JavaScript - Dynamics 365

 

Hide Tab using JavaScript


Introduction :

In this blog we will see how to hide tab using JavaScript.

Dynamics 365 
Home 
Recent 
Pinned 
My Work 
Dashboards 
Activities 
Customers 
Accounts 
R Contacts 
Sales 
Leads 
Opportunities 
R Competitors 
Sales 
Sales Hub 
+ New 
Sales > Opportunities > For template 
Copy CD Refresh 
Close as Won 
Qualify (5 Hrs) 
uotes Related 
Close as Lost 
(S Close all quotes 
o 
Develop 
Billing Method 
No data available. 
Recalculate Opportunity 
Est. Close Date 
o 
Propose 
Convert to Work Order 
For template 
Opportunity • Project Information v 
Opportunity Sales Process 
Active for 5 hours 
In Progress 
Est. Revenue 
Summa 
Opportunity Lines 
CRM Admin 
o 
Close 
Refresh 
Project-based Lines 
Write-In Product 
Product-based Lines 
Open 
+ Add New Opportunity... 
Budget Amount 
S save

Implementation :

Step 1 : Javascript for hiding tab :

var hideTab ={
hideTabs: function (executionContext) 
{
       
          var formContext = executionContext.getFormContext();
            formContext.ui.tabs.get("OpportunityLinesTab").setVisible(false);
    },
};

 Step 2 : Upload script on load of form -> ok -> Save and Publish .

Handler Properties 
Details 
De pendencies 
Library 
Function 
Enabled 
Paramet ers 
new HideTab 
BideTab.hideTabs 
•J Pass execution context as first parameter 
Comma separated list of parameters that be passed to the function

Result :

Dynamics 365 
Home 
Recent 
Pinned 
My Work 
Dashboards 
Activities 
Customers 
Accounts 
R Contacts 
Sales 
Leads 
Opportunities 
Competitors 
Sales 
Sales Hub 
+ New 
Sales > Opportunities > For template 
Copy CD Refresh Close as Won 
Close as Lost 
(S Close all quotes 
o 
Develop 
Recalculate Opportunity 
Est. Close Date 
o 
Propose 
Convert to Work Order 
In Progress CRM Admin 
For template 
Opportunity • Project Information v 
Opportunity Sales Process 
Active for 5 hours 
Summary Quotes Related 
Est. Revenue 
Status 
(7) 
Qualify (5 Hrs) 
Owner 
o 
Close 
Topic 
Contact 
Account 
Account Manager 
Contracting Unit 
Purchase Timeframe 
Currency 
For template 
test account 2019 
CRM Admin 
DataFronts 
US Dollar 
Timeline 
Enter a notem 
Auto-post on wall... 
1248 PM 
Opportunity: Created by CRM Admin... 
STAKEHOLDERS 
Name 
No data available. 
SALES TEAM 
Name 
Rc R 
Page I

Hope this helps

No comments:

Post a Comment

Power Apps Drag & Drop Kanban code sample

  Introduction: The Kanban Board App Developers at a software company use the Kanban board to show their progress on development tasks and b...