locked
how to find directioncode of a email activity? RRS feed

  • Question

  • Hi,

    I want to fetch the  field "directioncode" in email entity. please help me to find out the field.

    thanks

    regard

    Sangram


    microsoft blog

    Thursday, September 12, 2013 12:40 PM

All replies

  • Since you didn't specify which language you wanted to use - here is an example using JavaScript:

    var serverUrl = Xrm.Page.context.getClientUrl();
    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/EmailSet(guid'" + emailId + "')?$select=DirectionCode";
    
    var req = new XMLHttpRequest();
    req.open("GET", oDataSelect, false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    req.onreadystatechange = function () {
        if (req.readyState === 4) {
            if (req.status === 200) {
                var retrieved = JSON.parse(req.responseText).d;
                alert(retrieved.DirectionCode);
            }
        }
    };
    req.send();


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Thursday, September 12, 2013 1:01 PM
    Moderator
  • I want through c#.net for plugin .

    microsoft blog

    Thursday, September 12, 2013 1:18 PM
  • How about this:

    Entity email = _serviceProxy.Retrieve("email", new Guid("51CD63E2-AA1B-E311-A538-B4B52F676688"), new ColumnSet("directioncode")); if (email != null) {

    Console.WriteLine(email.Attributes["directioncode"]); }



    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Thursday, September 12, 2013 2:11 PM
    Moderator