Skip to main content
Post a question

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Javascript issue

Like (0) ShareShare
ReportReport
Posted on 13 Apr 2022 12:38:59 by

I'm trying to get the status of the form.

I've been having issues with Xrm.Page.ui.getFormType()

So i made a small test script, running the below script gives me an error OnLoad

function SetName(){
        var formType = Xrm.Page.ui.getFormType();
        Xrm.Page.ui.setFormNotification(formType, "ERROR");
}

Im running this on CRM 2015 update 0.3

Error I get :

pastedimage1649853497344v1.png

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,959 Super User 2024 Season 1 on 14 Apr 2022 at 10:18:49
    RE: Javascript issue

    Hello,

    Do you have any other code in your js library other than what you have added in your post?

    If you have other methods added in your library then please validate the syntax of your code using below online website -

    esprima.org/.../validate.html

    Add alert in your code to see if it shows on form.

    The error is generic and not sure the cause of it.

    You should also try in different browser. Have you tried disabling the event handle to see if it does not show the same error?

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • G.Vetere Profile Picture
    G.Vetere on 14 Apr 2022 at 08:38:44
    RE: Javascript issue

    that's correct (without () )

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,959 Super User 2024 Season 1 on 13 Apr 2022 at 18:54:29
    RE: Javascript issue

    Hi,

    Can you show me the form properties screenshot?

    I hope you have only added SetName in function name in event handler and  you are not adding SetName().

    Thanks,

    Bipin

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete