web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: document.getElementsByTagName

    Hello,

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

  • Community Member Profile Picture
    on at
    RE: document.getElementsByTagName

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

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: document.getElementsByTagName

    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
    RE: document.getElementsByTagName

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

  • Community Member Profile Picture
    on at
    RE: document.getElementsByTagName

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

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: document.getElementsByTagName

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

  • Community Member Profile Picture
    on at
    RE: document.getElementsByTagName

    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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans