Programmatically Setting a Tab focus with JavaScript on Dynamics 365 - Part Three

On the Opportunity form, tab focus is always set on the Summary tab, if we want to set focus on the Product then JavaScript code will help us.


Step 1:  Go to form, double click on the Product tab & copy the Name of the tab

Step 2. Tab Focus JavaScript code function

function Setdefaultfocus(executionContext)
{
 var formContext = executionContext.getFormContext();           formContext.ui.tabs.get("Product_Line_Items").setFocus(); 
 }


 Step 3. Click on form properties, on page load event pass the JavaScript file, give function name & make sure context parameter option should be checked.

Comments