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)

How to pass parameters using openEntityForm

(0) ShareShare
ReportReport
Posted on by 645

I'm trying to open a new form and pass values to use in new form JS code, the new form open but I get a CRM general error, can't find my prob...

I have 2 questions:

1. What am I missing, why do I get an error....?

2. How to get my params in my new from js?

That's my error:

 Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #65B23809Detail: 

My code:

function openNewRec(){  
       var parameters={};
       parameters["gamenumber"] = Xrm.Page.getAttribute("new_gamenum").getValue();
          var windowOptions = {
        openInNewWindow: true
       };
      Xrm.Utility.openEntityForm("new_scores",null,parameters,windowOptions);        
    }

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    BharatPremji Profile Picture
    2,485 on at

    Hi,

    What version of Dynamics are you using?

    If your online and using version 9, you should be using Xrm.Navigation.openForm, have a look at this:

    docs.microsoft.com/.../openform

    Regards

  • Suggested answer
    BharatPremji Profile Picture
    2,485 on at

    Apologies,

    Just saw your tag saying your using 2016.

    Can you check this:

    parameters["gamenumber"]

    Is gamenumber the name of the field on the entity new_scores.  

    Have a look at this:

    msdn.microsoft.com/.../jj602956.aspx

  • sahara Profile Picture
    645 on at

    I'm using 2016 on-premise

  • sahara Profile Picture
    645 on at

    Hey Bahrat , when I'm not passing params it works fine... so maybe the prob is in the new record.. I can't fund it..

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    Make sure you passed correct field name as I can see you have not passed the field name with publisher here  , otherwise your code is correct.

    function openNewRec() {
        var parameters = {};
        var parameter1 = Xrm.Page.getAttribute("new_gamenum").getValue();
        parameters["gamenumber"] = parameter1; // Field Name should be with publisher name like new_gamenum
        var windowOptions = {
            openInNewWindow: true
        };
        Xrm.Utility.openEntityForm("new_scores", null, parameters, windowOptions);
    }


  • sahara Profile Picture
    645 on at

    Hey Goutam, I changes the name now I get this error:

    System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8DF36960Detail:

    Don't know what to do..

  • sahara Profile Picture
    645 on at

    Hey Bharat yes the field is on the entity (the one that opens the new form)

  • gdas Profile Picture
    50,091 Moderator on at

    okay , what type of field value you are passing ?

    Above code is to assign single line of text.

  • sahara Profile Picture
    645 on at

    Goutam the data I pass is a single line of text so I choose in my form cunfiguration in parameters option I choose the safestringtype and gave the parameter the same name like the field and yet it doesn't work

  • sahara Profile Picture
    645 on at

    Well my problem was small but important, must be sure that the field name is the same in the form configuration and in code as well

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