locked
[CRM 2013] - set email regarding by default to custom entity RRS feed

  • General discussion

  • Hi,

    Since the upgrade to CRM 2013, i can't use the following code that select a custom entity by default in the email regarding.

    document.getElementById('regardingobjectid').setAttribute('defaulttype', '10018'); // 10018 is Custo entity Type Code
    
    Xrm.Page.getControl("regardingobjectid").setDefaultView("FAAF4858-84B6-4FEB-9370-C3A883D81264");

    I know that it's an unsupported development but i don't find another way to show my custo entity by default in the regarding field.

    Is there any way to do that in supported development ?

    Regards,

    Jean-Michel

    Monday, March 17, 2014 1:15 PM

All replies

  • Hi,

    After analysing the html code, i can see on the div that contain the regarding "ms-crm-Inline-Chrome lookup" that the id of the class "ms-crm-InlineLookupEdit" is "regardingobjectid_i".

    By adding "_i" it work !

    So the correct code is below : 

            document.getElementById("regardingobjectid_i").setAttribute("defaulttype", "10018"); /* Entity type code 10018 = Demande EIS */
            document.getElementById("regardingobjectid_i").setAttribute("lookuptypenames", "neos_demande_eis:10018:neos_demande_eis");
            document.getElementById("regardingobjectid_i").setAttribute("lookuptypes", "10018");

    This code is not supported :) but working good. 

    Regards,

    Monday, March 17, 2014 2:06 PM