locked
CRM 2011: Populating email entity form fields with URL parameters RRS feed

Answers

  • Chris -

    I will update the documentation. I thought this had been simplified but it currently works the same way that this worked in CRM 4.

    There are four types of lookups:

    ‘simple’ lookups: Allow a single reference to one type of entity

    customer lookups: Allow a single reference to either an Account or Contact entity

    partylist lookups: Allow multiple references to multiple types of entities

    regarding lookups: Allow single reference to multiple types of entities

     

    Where ‘xx’ = attribute logicalname

    1.       You can set a simple lookup using just the xxid and xxname

    2.       For a customer lookup, you must use xxid, xxname and xxtype

    3.       You cannot set the value of any regarding  or partylist lookup.

     

    Workaround:

    ·         Create one or more custom form parameters and pass your encoded values through that

    ·         Use functions in the onload event to read the custom parameters and set the values.

    For the workarounds you found - those may work but they aren't documented or supported. Future changes could cause them to break and their will be no notification or announcement that they change. Use at your own risk. Using EntityTypeCode is not recommended because for custom entities it can vary from organization to organization, so we don't recommend it.

    Sorry for the inconvenience.


    Jim Daly Technical Writer Microsoft Dynamics CRM
    • Proposed as answer by VinothBalasubramanian Thursday, March 17, 2011 7:33 AM
    • Marked as answer by C Reid Thursday, March 17, 2011 2:25 PM
    Wednesday, March 16, 2011 11:44 PM
    Answerer
  • Hello, 

    Concerning that we can't set value by url to a regarding  field, i have investigate and solve a solution.

    It's necessary to UrlEncode 2 times some elements, javascript function below show how :

    /// <summary>
    /// Open an activity form by an window popup
    /// </summary>
    /// <param name="activityTypeCode">Activity code to open the form</param>
    /// <param name="regardingObjectId">Guid value of the regarding field to set</param>
    /// <param name="regardingObjectType">Entity code of the regarding field to set</param>
    /// <param name="regardingObjectName">Value to show of the regarding field to set</param>
    function CustomAction_OpenActivity(activityTypeCode, regardingObjectId, regardingObjectType, regardingObjectName ) {

        var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";

        //Encode Guid of regardingObject to set
        regardingObjectId = encodeURIComponent(regardingObjectId);

        var extraqs = "pId=" + regardingObjectId;
        extraqs += "&pType=" + regardingObjectType;
        extraqs += "&pName=" + regardingObjectName ;     

        //Encode extraqs query parameter
        extraqs =  encodeURIComponent(extraqs);

        window.open(Xrm.Page.context.getServerUrl() + "/main.aspx?etc=" + activityTypeCode + "&pagetype=entityrecord&extraqs=" + extraqs, "_blank", features, false);

    }

    It's work on an onpremise crm 2011 RU5 version.

     

    • Marked as answer by C Reid Tuesday, January 31, 2012 2:40 PM
    Wednesday, November 30, 2011 1:13 PM

All replies

  • Chris -

    I tested your scenarios and got the same results. It looks like I overlooked some scenarios in the documentation. I will investigate what the proper arguments should be for these types of cases.

    Best regards,


    Jim Daly Technical Writer Microsoft Dynamics CRM
    Monday, March 14, 2011 12:17 AM
    Answerer
  • Chris -

    I will update the documentation. I thought this had been simplified but it currently works the same way that this worked in CRM 4.

    There are four types of lookups:

    ‘simple’ lookups: Allow a single reference to one type of entity

    customer lookups: Allow a single reference to either an Account or Contact entity

    partylist lookups: Allow multiple references to multiple types of entities

    regarding lookups: Allow single reference to multiple types of entities

     

    Where ‘xx’ = attribute logicalname

    1.       You can set a simple lookup using just the xxid and xxname

    2.       For a customer lookup, you must use xxid, xxname and xxtype

    3.       You cannot set the value of any regarding  or partylist lookup.

     

    Workaround:

    ·         Create one or more custom form parameters and pass your encoded values through that

    ·         Use functions in the onload event to read the custom parameters and set the values.

    For the workarounds you found - those may work but they aren't documented or supported. Future changes could cause them to break and their will be no notification or announcement that they change. Use at your own risk. Using EntityTypeCode is not recommended because for custom entities it can vary from organization to organization, so we don't recommend it.

    Sorry for the inconvenience.


    Jim Daly Technical Writer Microsoft Dynamics CRM
    • Proposed as answer by VinothBalasubramanian Thursday, March 17, 2011 7:33 AM
    • Marked as answer by C Reid Thursday, March 17, 2011 2:25 PM
    Wednesday, March 16, 2011 11:44 PM
    Answerer
  • Thanks for investigating Jim.

    I have gone the route of custom parameters and an onload function.


    Chris Reid
    Thursday, March 17, 2011 2:25 PM
  • Hello, 

    Concerning that we can't set value by url to a regarding  field, i have investigate and solve a solution.

    It's necessary to UrlEncode 2 times some elements, javascript function below show how :

    /// <summary>
    /// Open an activity form by an window popup
    /// </summary>
    /// <param name="activityTypeCode">Activity code to open the form</param>
    /// <param name="regardingObjectId">Guid value of the regarding field to set</param>
    /// <param name="regardingObjectType">Entity code of the regarding field to set</param>
    /// <param name="regardingObjectName">Value to show of the regarding field to set</param>
    function CustomAction_OpenActivity(activityTypeCode, regardingObjectId, regardingObjectType, regardingObjectName ) {

        var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";

        //Encode Guid of regardingObject to set
        regardingObjectId = encodeURIComponent(regardingObjectId);

        var extraqs = "pId=" + regardingObjectId;
        extraqs += "&pType=" + regardingObjectType;
        extraqs += "&pName=" + regardingObjectName ;     

        //Encode extraqs query parameter
        extraqs =  encodeURIComponent(extraqs);

        window.open(Xrm.Page.context.getServerUrl() + "/main.aspx?etc=" + activityTypeCode + "&pagetype=entityrecord&extraqs=" + extraqs, "_blank", features, false);

    }

    It's work on an onpremise crm 2011 RU5 version.

     

    • Marked as answer by C Reid Tuesday, January 31, 2012 2:40 PM
    Wednesday, November 30, 2011 1:13 PM
  • Very interesting, thanks Alexandre.

     


    Chris Reid
    Wednesday, November 30, 2011 1:49 PM
  • This is set "Recipient"

    Is there anyone know, how to set the "Sender" of a Phone Call in URL?

    Friday, December 2, 2011 12:59 AM