In crm 365 uci, I have tabs on the form and Related views list that if I choose one it becomes a tab on my form.
How do I distinguish between passing from regular tab to related tab in JS.
In crm 365 uci, I have tabs on the form and Related views list that if I choose one it becomes a tab on my form.
How do I distinguish between passing from regular tab to related tab in JS.
Related tabs are just like related entities to the current record type. You can distinguish between related tab and regular by refreshing the form. If the respective tab is not present then it is a related tab and you will able to see that entity on the related part of the current form. and all those tabs which are present on the form are the main tabs.
If you want to remove related tab then please follow below article which will help you.
community.dynamics.com/.../hide-related-tab-from-dynamics-365-form
Thank you,
Amit Katariya
You can check the expand state of normal tabs, if all the state are "collapsed" then related views is opened. Here is a code sample:
let isNormalTabExpanded = false; let tabs = formContext.ui.tabs.getAll(); for (let index = 0; index < tabs.length; index ) { const tab = tabs[index]; if(tab.getDisplayState() === "expanded"){ isNormalTabExpanded = true; break; } } console.log(isNormalTabExpanded);
How about hiding the Related Tab and show only required Tabs?
To hide tabs you can use below link:
https://carldesouza.com/remove-related-tab-from-dynamics-365-uci-form/
also, you can use below code to get all tabs.
function getAllTabs (executionContext) { 'use strict'; var formContext = executionContext.getFormContext(); var tabs = formContext.ui.tabs.get(); // all tabs for (var i = 0; i < tabs.length; i ) { if(tabs[i].getLabel() === "") { //add your logic here //for section only: -get all sections var sections = tabs[i].sections.get(); for (var j = 0; j < sections.length; j ) { var controls = sections[j].controls.get(); //add your logic here } } } }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156