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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Javascript issue

(0) ShareShare
ReportReport
Posted on by 8

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

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    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

  • G.Vetere Profile Picture
    8 on at

    that's correct (without () )

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    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/

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans