locked
CRM 2013 - get Error: Cannot retrieve property length when calling xrm.Utility.openEntityForm RRS feed

  • Question

  • In CRM 2013, I have a javascript that calls xrm.Utility.openEntityForm().

    But I get an error:

    Error: Cannot retrieve property length when it is undefined or null reference

    Before the openEntityForm is called, a xrm.Page.data.save() is performed, and then a call to a custom Action type Workflow.

    This is some of the details that is sent to Microsoft:

     <PageURL>/main.aspx?etc=4210&extraqs=%3fAccount_3%3d%257b445E350B-5C88-E211-A69E-D067E5F2D6C6%257d%26Accountname_4%3dPER%2520OLSEN%26Regarding_2%3d%26etc%3d4210&pagemode=iframe&pagetype=entityrecord</PageURL>
       <Function>anonymous(a,b){a[a.length]=b}</Function>

    The jump to the new entity is performed if I ignore the errors.

    I run CRM 2013 UR1.

    Monday, March 24, 2014 12:27 PM

Answers

  • I had to change focus, did this after initial save like this:

    xrm.Page.getControl("description").setFocus();

    xrm.Page.getControl("subject").setFocus();

    Wednesday, April 2, 2014 2:15 PM

All replies

  • In CRM 2013 you can attach JavaScript to your post-save event, which might help you here.

    Xrm.Page.data.save().then(function() {
        // Do your openEntity
    });

    http://msdn.microsoft.com/en-us/library/dn481607(v=crm.6).aspx#BKMK_dataSave

    Hope that helps

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Wednesday, March 26, 2014 6:43 AM
  • Thank you for suggestion. But sorry, it did not help :-(

    In the meantime I have upgraded to UR2, but it did not help either.

    Friday, March 28, 2014 9:33 AM
  • I had to change focus, did this after initial save like this:

    xrm.Page.getControl("description").setFocus();

    xrm.Page.getControl("subject").setFocus();

    Wednesday, April 2, 2014 2:15 PM