Focus on a Tab using JavaScript in Dynamics 365

2 Comments

Let’s look at JavaScript code to move a user to a specific tab in Dynamics 365 / Power Apps.

Below on the Account record I have these tabs – Summary, Project Price Lists, General etc:

Let’s go to the General tab when something happens, like changing a field value.

The General tab is called Partner_Details:

Here’s the code is below. Be sure to pass the execution context:

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

Now we start on the Summary tab:

Run the code, and we’re taken over to the General tab:

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

2 Responses to Focus on a Tab using JavaScript in Dynamics 365

Leave a Reply

Your email address will not be published. Required fields are marked *