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)

Javascript not working on form load

(0) ShareShare
ReportReport
Posted on by 437

javascripterror.PNG

Hi folks,

I want to disable a new button + new in a look up for this I am writing a javascript to hide the + new button.
when i checked its HTML i found it is inside a div whoes id is XXX_productgrade and its attribute which is
highlighted in yellow colour is set to "1" when I changed it to "0" it was disabled .

So this i wanted to do  by javascript  and got error . I was calling this function on formLoad event 

function test (){

      var h1 = document.getElementById("angus_productgrade");   // here h1 is returning null
      h1.setAttribute("isinlinenewenabled", 0);

Please help me  regarding this.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Replace the line of code as shown below.

    var h1 = window.parent.document.getElementById("angus_productgrade");

    Hope this helps.

  • ashlega Profile Picture
    34,477 on at

    This is unsupported.. just for the record:)) Nithya's answer should work, though.

  • windyMill Profile Picture
    437 on at

    Thanks it is working.

  • Ravi Fulani Profile Picture
    836 on at

    Hi,

    I am getting null for

    var h1 = window.parent.document.getElementById("angus_productgrade");

    what should i do?

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