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)

document.getElementsByTagName

(0) ShareShare
ReportReport
Posted on by

Folks,

What is the replacement for document.getElementsByTagName("script") in CRM 2015?

I tried using Xrm.Page.getAttribute("script").getValue() and was not successful.

Am I missing anything?

*This post is locked for comments

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Just curious - why do you need to use this unsupported approach?

  • Community Member Profile Picture
    on at

    I am trying to use Xrm.Page.getAttribute("script").getValue()  and that gives me error

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Ashwin,

    Their are different ways to get the value of field based on their type like

    Xrm.Page.getAttribute(<controlName>).getValue()[0].id; ----Lookup

    Xrm.Page.getAttribute(<controlName>).getValue(); ------ Standard Control

    Xrm.Page.getAttribute(<controlName>).getSelectedOption().value ------ OptionSet

    And if you are accessing the value from web resource which is in iFrame,

    Then add Window.Parent before Xrm.Page.getAttribute(<controlName>).getValue()[0].id;

    Hope this would solve your problem.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Tell me please why do you need that and I will try to help you.

  • Community Member Profile Picture
    on at

    I want to replace document.getElementsByTagName  , so I am using Xrm.Page.getAttribute.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    I'm not asking what code you write. I'm asking what is your goal?

  • Community Member Profile Picture
    on at

    i have this problem, i want to hide time in datetime fied in CRM.

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