locked
CRM 2011 Rollup 5 - URL Addressable Form RRS feed

  • Question

  • I am trying to create a new record from a URL Addressable Form.  I am using the following URL to create (for example) a new Account Record:

    http://<crmserver>/<myorg>/main.aspx?etn=account&pagetype=entityrecord

    After saving the new Acccount, I am getting an error, the ribbon bar locks, and the form fields disappear and do not come back.  The new account record saves, so the problem is apparently in retrieving and displaying the newly created record.  The error contents are as follows:

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>'undefined' is null or not an object</Message>
       <Line>6</Line>
       <URL>/_common/global.ashx?ver=-577180778</URL>
       <PageURL>/userdefined/edit.aspx?etc=1&pagemode=iframe&sitemappath=CS%7cRoutines%7cwnsft_preliminaryworkorder</PageURL>
       <Function>anonymous(appendQuery){if(appendQuery.startsWith("&"))appendQuery="?"+appendQuery.substr(1);elseif(!appendQuery.startsWith("?"))appendQuery="?"+appendQuery;var$v_0=this.$3f_0(appendQuery),$$dict_1_0=$v_0;for(var$$key_1_1in$$dict_1_0){var$v_1={key:$$key_1_</Function>
       <CallStack>
        <Function>anonymous(appendQuery){if(appendQuery.startsWith("&"))appendQuery="?"+appendQuery.substr(1);elseif(!appendQuery.startsWith("?"))appendQuery="?"+appendQuery;var$v_0=this.$3f_0(appendQuery),$$dict_1_0=$v_0;for(var$$key_1_1in$$dict_1_0){var$v_1={key:$$key_1_1,value:$$dict_1_0[$$key_1_1]};this.get_query()[$v_1.key]=$v_1.value}}</Function>
        <Function>anonymous(parameters,extraParams){if(Mscrm.NavigationMode.DefaultNavigationMode===1){var$v_8=extraParams["isNew"],$v_9=extraParams["newId"];if($v_8&&!IsNull($v_9)&&$v_9.length>0){var$v_A={};$v_A["updateQueryString"]=String.format("id={0}",$v_9);Mscrm.PageManager.get_instance().raiseEvent(43,$v_A)}}var$v_0=parameters["etc"],$v_1=parameters["title"],$v_2=parameters["id"];if(parameters["isNew"])$v_2=extraParams["newId"];Mscrm.Utilities.refreshParentGrid($v_0,$v_1,$v_2);var$v_3={};$v_3["Id"]=$v_2;$v_3["otc"]=parameters["etc"];$v_3["etn"]=parameters["etn"];$v_3["entitydisplayname"]=parameters["entitydisplayname"];$v_3["title"]=$v_1;Mscrm.PageManager.get_instance().raiseEvent(51,$v_3);Mscrm.DefaultDeferredActionHandler.get_instance().handleDeferredAction(parameters,extraParams);var$v_4=parameters["action"];switch($v_4){case"save":var$v_5=parameters["refreshOnSave"];if(!IsNull($v_5)&&$v_5){var$v_B=false,$v_C=Mscrm.CrmUri.create(window.top.location.href),$v_D=null;if($v_C.get_path().endsWith("/main.aspx")){var$v_E=$v_C.get_query()["extraqs"];$v_D=Mscrm.CrmUri.create("");$v_D.appendToQuery($v_E);if(IsNull($v_D.get_query()["id"]))$v_B=true}if($v_B&&parameters["isNew"]){$v_D.get_query()["id"]=extraParams["newId"];$v_C.get_query()["extraqs"]=$v_D.toString();window.top.location.href=$v_C.toString();break}else{var$v_F=Mscrm.CrmUri.create(parameters["uri"]),$v_G=parameters["isNew"];if($v_G){var$v_I=extraParams["newId"];$v_F.get_query()["id"]=$v_I}if(!IsNull($v_2)&&IsNull($v_F.get_query()["id"]))$v_F.get_query()["id"]=$v_2;var$v_H={};$v_H["uri"]=$v_F.toString();if(Mscrm.PageManager.isPageLoaded)Mscrm.PageManager.get_instance().raiseEvent(22,$v_H);elsewindow.setTimeout(Function.createDelegate(this,function(){Mscrm.PageManager.get_instance().raiseEvent(22,$v_H)}),0)}}break;case"saveandclose":case"delete":Mscrm.Utilities.closeCurrentWindow();break;case"saveandnew":parameters["sameWindow"]=true;var$v_6=null,$v_7=Mscrm.CrmUri.create("");if(!IsNull(parameters["_CreateFromType"])&&!IsNull(parameters["_CreateFromId"])){$v_7.get_query()["_CreateFromType"]=parameters["_CreateFromType"].toString();$v_7.get_query()["_CreateFromId"]=parameters["_CreateFromId"].toString()}if(!IsNull(parameters["pId"])&&!IsNull(parameters["pName"])&&!IsNull(parameters["pType"])){$v_7.get_query()["pId"]=parameters["pId"].toString();$v_7.get_query()["pName"]=parameters["pName"].toString();$v_7.get_query()["pType"]=parameters["pType"].toString()}if(!IsNull(extraParams["partyid"])&&!IsNull(extraParams["partyname"])&&!IsNull(extraParams["partytype"])){$v_7.get_query()["partyid"]=extraParams["partyid"].toString();$v_7.get_query()["partyname"]=extraParams["partyname"].toString();$v_7.get_query()["partytype"]=extraParams["partytype"].toString()}switch($v_0){case1071:case1011:case1013:case1089:case1091:case1083:case1085:case1055:var$$dict_1_0=extraParams;for(var$$key_1_1in$$dict_1_0){var$v_J={key:$$key_1_1,value:$$dict_1_0[$$key_1_1]};if($v_J.key!=="etc"&&$v_J.key!=="pagemode")if($v_J.key==="appendqs"){var$v_K=Mscrm.RecordUpdatedHandler.$3r_0(extraParams);if($v_K)$v_7.get_query()[$v_K[0]]=$v_K[1]}else$v_7.get_query()[$v_J.key]=extraParams[$v_J.key]}break;case3234:if(!IsNull(extraParams["connectToMe"]))$v_7.get_query()["connectToMe"]=extraParams["connectToMe"].toString();elseif(!IsNull(extraParams["appendqs"])){var$v_L=Mscrm.RecordUpdatedHandler.$3r_0(extraParams);if(!IsNull($v_L)&$v_L[0]==="connectToMe")$v_7.get_query()["connectToMe"]=$v_L[1]}break}$v_6=$v_7.get_queryString();openObj($v_0,null,$v_6,null,1,parameters);$v_0===1010&&IsNull(parameters["_CreateFromType"])&&closeWindow();break}}</Function>
        <Function>anonymous($p0){if(this.$1T_2){var$v_0=Mscrm.CrmUri.create("");$v_0.appendToQuery(this.$2N_2.join("&"));var$v_1=$v_0.get_query(),$$dict_2_0=$p0;for(var$$key_2_1in$$dict_2_0){var$v_2={key:$$key_2_1,value:$$dict_2_0[$$key_2_1]};$v_1[$v_2.key]=$v_2.value}for(var$v_3=0;$v_3<this.$1T_2.length;$v_3++){var$v_4=this.$1T_2[$v_3],$v_5={};$v_5["key"]=$v_4;var$v_6=this.raiseEvent(10,$v_5);if(!$v_6||!$v_6.length)continue;var$v_7=$v_6[0],$v_8=Mscrm.DeferredActionHandlerFactory.create($v_7["handlerId"]);$v_8.handleDeferredAction($v_7,$v_1)}}}</Function>
        <Function>anonymous(){this.$3p_2(null)}</Function>
        <Function>anonymous(){returnb.apply(a,arguments)}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.2; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC EA 2; MS-RTC LM 8)</BrowserUserAgent>
       <BrowserLanguage>en-us</BrowserLanguage>
       <SystemLanguage>en-us</SystemLanguage>
       <UserLanguage>en-us</UserLanguage>
       <ScreenResolution>1680x1050</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2011-12-16T08:29:17</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>1033</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>1033</UserCulture>
        <OrgID>{3CB4B240-E4C4-E011-A477-00155DC82813}</OrgID>
        <UserID>{2D9CF248-E4C4-E011-A477-00155DC82813}</UserID>
        <CRMVersion>5.0.9688.1533</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    This was working fine before Rollup 5.  This also works when the URL uses Entity Type Code (etc) instead of Entity Name (etn).  However, test macros need Entity Name, as etc changes from org to org.  Is this a confirmed bug?  Is there any work-around?

    Friday, December 16, 2011 2:29 PM

Answers

  • Per Chris Brooks, director CRM Development, this is an open bug with Sustained Engineering.  They are working on delivering a fix.

     (edit)1/20/2012 - I am told by Microsoft support the fix for this will be part of Rollup 6 due out this week.

    • Marked as answer by JBlaeske Wednesday, December 28, 2011 7:36 PM
    • Edited by JBlaeske Friday, January 20, 2012 1:43 PM
    Wednesday, December 28, 2011 7:36 PM
  • Correct. There is nothing found in the sdk about a change. But I´ve tested on UR5 System and without etc it is not working as expected. So it might be a bug in UR5
    Carsten Groth http://carstengroth.wordpress.com
    • Marked as answer by JBlaeske Monday, December 19, 2011 1:34 PM
    Friday, December 16, 2011 5:31 PM

All replies

  • http://<crmserver>:<port>/<myorg>/main.aspx?etn=account&extraqs=%3fetc%3d1&pagetype=entityrecord works. Obviously &extraqs=?etc=1 is mandatory now
    Carsten Groth http://carstengroth.wordpress.com

    • Edited by Carsten Groth _MSCRM_ Friday, December 16, 2011 4:16 PM
    • Marked as answer by JBlaeske Friday, December 16, 2011 4:27 PM
    • Unmarked as answer by JBlaeske Friday, December 16, 2011 4:37 PM
    Friday, December 16, 2011 4:14 PM
  • Excellent, this does work, thank you.
    Friday, December 16, 2011 4:27 PM
  • Oops, not so quick.  Having to insert etc is what I was hoping to avoid.
    Friday, December 16, 2011 4:38 PM
  • I know but it only works with etc


    Carsten Groth http://carstengroth.wordpress.com
    Friday, December 16, 2011 5:17 PM
  • If indeed it only works with etc then it's a bug, and a bad one at that.  It prevents application portability and universal testing.  It actually worked with only etn before Rollup 5  :(
    Friday, December 16, 2011 5:20 PM
  • Correct. There is nothing found in the sdk about a change. But I´ve tested on UR5 System and without etc it is not working as expected. So it might be a bug in UR5
    Carsten Groth http://carstengroth.wordpress.com
    • Marked as answer by JBlaeske Monday, December 19, 2011 1:34 PM
    Friday, December 16, 2011 5:31 PM
  • Same here!

    Has anyone raised this with Microsoft?

    Thursday, December 22, 2011 1:23 AM
  • Per Chris Brooks, director CRM Development, this is an open bug with Sustained Engineering.  They are working on delivering a fix.

     (edit)1/20/2012 - I am told by Microsoft support the fix for this will be part of Rollup 6 due out this week.

    • Marked as answer by JBlaeske Wednesday, December 28, 2011 7:36 PM
    • Edited by JBlaeske Friday, January 20, 2012 1:43 PM
    Wednesday, December 28, 2011 7:36 PM
  • Not sure if this is exactly the same issue, but I have a very similar crash also on UR5, and simply adding "&extraqs=" to the end of the querystring resolves the problem. etc is not required. The issue is in this statement in global.ashx:

    var $v_E=$v_C.get_query()["extraqs"];
    // irrelevent line
    $v_D.appendToQuery($v_E); 
    

     

    if the extraqs isn't part of the querystring, $v_E is null, thus you pass null into the appendToQuery function.
    Either you need to check $v_E  for null before you pass it in, or (better yet) check in appendToQuery that you were given valid input before calling .startsWith() on it.

    For the original user, simply edit your URL to include the (newly required) &extraqs parameter. It does no harm for it to be there, it's just for passing additional parameters into the form. You can just add "&extraqs=" to the end of your URL.

    Best,
    Michael Blackburn
    Sonoma Partners 



    Thursday, January 19, 2012 11:20 PM
  • Hey JBlaeske,

    Did you find a way to get it to work without "etc" in the URL?

    I've a similar requirement and am not able to access the form with entity name but it works with "etc" which is not a desirable solution.

    Wednesday, September 19, 2012 5:19 PM
  • As promised, this was fixed in UR6, so for UR6 and later you should be able to use etn= without using etc.
    Wednesday, September 19, 2012 5:22 PM
  • Thanks for the swift response.

    We are on UR7 and am still not able to access with etn=

    Here is the url am using to open a custom entity form for creating a new record. The underscore in the entity name is replaced with its hex value.

    http://<servername>/<orgname>/UserDefined/edit.aspx?etn=<entityname>&extraqs=

    • Edited by crmsurfer Wednesday, September 19, 2012 5:35 PM
    Wednesday, September 19, 2012 5:32 PM
  • Haven't tried this under the /UserDefined/edit.aspx?...  I can verify it works under the <a href="http:///<orgname>/Main.aspx?etn">http://<servername>/<orgname>/Main.aspx?etn=... direct url access.

    -JayB

    Wednesday, September 19, 2012 5:48 PM
  • Here is another URL I've tried. It landed on my homepage and froze up without any ribbon buttons.

    http://<servername>/<orgname>/main.aspx?etn=<entityname>

    Wednesday, September 19, 2012 5:51 PM
  • Hey,

    It finally worked after adding pagetype=entityrecord in the end.

    http://<servername>/<orgname>/main.aspx?etn=<entityname>&pagetype=entityrecord

    Thanks for your assistance.


    • Edited by crmsurfer Wednesday, September 19, 2012 5:59 PM
    • Proposed as answer by crmsurfer Wednesday, December 5, 2012 4:28 PM
    Wednesday, September 19, 2012 5:59 PM