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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set focus to a tab

(0) ShareShare
ReportReport
Posted on by 1,942

Hi all,

I have a two option set field placed on header, when value is true it should focus on to a tab otherwise do nothing. I am writing a JS code to achieve this but for some reason it is failing. Below is the complete code.

Any inputs over here?

function checkstatus(){
var get_value = Xrm.Page.getAttribute("header_iis_flagstatusnew").getValue();
if(get_value == true){
Xrm.Page.ui.tabs.get("tab_16")setFocus();
}
}

*This post is locked for comments

I have the same question (0)
  • Verified answer
    JohnAnonymous Profile Picture
    5,241 on at

    It looks like you are getting the option set text, which is a string, and in the next line you do a compare for string vs boolean.

    And this line misses a dot: Xrm.Page.ui.tabs.get("tab_16")setFocus();

    Have you tried debugging your code e.g. in the Chrome browser?

  • Vighnesh Profile Picture
    1,942 on at

    Hi Martjin,

    Thanks for pointing out, that was a copy mistake. Basically i was testing the code with different possibilities.

    I have corrected the code now.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans