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)

ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

(0) ShareShare
ReportReport
Posted on by

Good afternoon all,

I seem to be getting an error when calling a dialogue window in the opportunity form. 

ReferenceError: 'openDialogProcess' is undefined

at eval code (eval code:1:1)
at RunHandlerInternal (/.../ClientApiWrapper.aspx)
at RunHandlers (.../ClientApiWrapper.aspx)
at OnScriptTagLoaded (/.../ClientApiWrapper.aspx)
at Anonymous function (/.../ClientApiWrapper.aspx)

JScript is as follows:

function openDialogProcess() {
var stage = Xrm.Page.getAttribute("new_salesstage".getText();
var url = Xrm.Page.context.getClientUrl() +
"/cs/dialog/rundialog.aspx?DialogId=073CEBFA-5D78-424E-9ED2-957A2840DFB7" +
"&EntityName=opportunity" +
"&ObjectId=";
{
window.open(url);
}
}

Using Dynamics 365 Online.

Thanks in advance,

Chris

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Please rectify the first line as follow:

    var stage = Xrm.Page.getAttribute("new_salesstage").getText();
  • Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Thanks Gopalan.. unfortunately I still get:

    TypeError: openDialogProcess(...) is not a function

       at eval (eval at RunHandlerInternal (/.../ClientApiWrapper.aspx), <anonymous>:1:20)

       at RunHandlerInternal (/.../ClientApiWrapper.aspx)

       at RunHandlers (/.../ClientApiWrapper.aspx)

       at OnScriptTagLoaded (/.../ClientApiWrapper.aspx)

       at /.../ClientApiWrapper.aspx

  • Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Also a second error with:

    TypeError: Cannot read property 'Initialize' of undefined

       at eval (eval at RunHandlerInternal (/form/ClientApiWrapper.aspx?ver=-278140633:153:1), <anonymous>:1:26)

       at RunHandlerInternal (/form/ClientApiWrapper.aspx?ver=-278140633:158:1)

       at RunHandlers (/form/ClientApiWrapper.aspx?ver=-278140633:117:1)

       at OnScriptTagLoaded (/form/ClientApiWrapper.aspx?ver=-278140633:232:1)

       at /form/ClientApiWrapper.aspx?ver=-278140633:201:1

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Hi

    This is because you are not supplying ObjectId, in the Url.

    If you want to use the current record in the form then modify as below:

    &ObjectId=" +Xrm.Page.data.entity.getId();
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Reference error occurs due to syntax error.

    Refer this:

    msdn.microsoft.com/.../gg328483.aspx

    community.dynamics.com/.../open-dialog-process-in-microsoft-dynamics-crm-2013-using-javascript

  • Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Thanks a lot for your help Gopalan... unfortunately, I've still got both errors.

    Jscript amended as per below:

    function openDialogProcess() {

       var stage = Xrm.Page.getAttribute("new_salesstage").getText();

       var url = Xrm.Page.context.getClientUrl() +

            "/cs/dialog/rundialog.aspx?DialogId=073CEBFA-5D78-424E-9ED2-957A2840DFB7" +

            "&EntityName=opportunity" +

            "&ObjectId=" + Xrm.Page.data.entity.getId();

       if(stage == "200 - PIN") {

    window.open(url);

           }

    }

    Thanks in advance,

    Chris

  • Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Please check your whole Library for Syntax Error.

  • Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Hi Saad,

    That's the only script running on the library.

    I've now added another library and ran just that script and I am still receiving the same two errors... :/ !

    Thanks,

    Chris

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    This function looks correct.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: ReferenceError: 'openDialogProcess' is undefined at eval code (eval code:1:1)

    Please use only this line in your function

    alert("Hello");

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
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans