locked
what is regardingobjectid in email RRS feed

  • Question

  • hello experts,

     what is regardingobjectid in email,can you provide some stuff.

    Thanks and Regards

    Murali

    Wednesday, May 1, 2013 12:12 PM

Answers

  • This is the CRM record that the email message is related to. Emails have a sender and recipient but could have the regard object set to another record like a service case, opportunity, etc...

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Wednesday, May 1, 2013 1:24 PM
    Moderator
  • See the below code, regardingobjectid used to have reference with entity.

    Console.WriteLine("One-to-many Query using RetrieveMultiple");
        Console.WriteLine();
    //Create an account and three related tasks
        Account account = new Account();
        account.Name = "SDK Test Account";
        Guid acctId = _serviceProxy.Create(account);
        Console.WriteLine("New account created.");
        Console.WriteLine();

        Task task1 = new Task();
        task1.Subject = "Test Task1";
        task1.RegardingObjectId = new EntityReference("account", acctId);
        Guid task1Id = _serviceProxy.Create(task1);

        Task task2 = new Task();
        task2.Subject = "Test Task2";
        task2.RegardingObjectId = new EntityReference("account", acctId);
        Guid task2Id = _serviceProxy.Create(task2);

        Task task3 = new Task();
        task3.Subject = "Test Task3";
        task3.RegardingObjectId = new EntityReference("account", acctId);
        Guid task3Id = _serviceProxy.Create(task2);

        Console.WriteLine("Three tasks created.");
        Console.WriteLine();

    // Construct query
        // Condition where task attribute equals account id.
        ConditionExpression condition = new ConditionExpression();
        condition.AttributeName = "regardingobjectid";
        condition.Operator = ConditionOperator.Equal;
        condition.Values.Add(acctId.ToString());

        //Create a column set.
        ColumnSet columns = new ColumnSet("subject");

        // Create query expression.
        QueryExpression query1 = new QueryExpression();
        query1.ColumnSet = columns;
        query1.EntityName = "task";
        query1.Criteria.AddCondition(condition);

        EntityCollection result1 = _serviceProxy.RetrieveMultiple(query1);

        foreach (var r in result1.Entities)
        {
            Console.WriteLine(r.Attributes["subject"]);
        };
        Console.WriteLine("-------------------------------");
        Console.WriteLine();


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Yogesh Vijay Mulay

    Thursday, May 2, 2013 6:47 AM

All replies

  • This is the CRM record that the email message is related to. Emails have a sender and recipient but could have the regard object set to another record like a service case, opportunity, etc...

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Wednesday, May 1, 2013 1:24 PM
    Moderator
  • Regarding object id in email is the same as in the task. That describe that the email or task is regarding to this record that may be account, case, contact etc...


    Gopinath.

    Wednesday, May 1, 2013 5:06 PM
  • See the below code, regardingobjectid used to have reference with entity.

    Console.WriteLine("One-to-many Query using RetrieveMultiple");
        Console.WriteLine();
    //Create an account and three related tasks
        Account account = new Account();
        account.Name = "SDK Test Account";
        Guid acctId = _serviceProxy.Create(account);
        Console.WriteLine("New account created.");
        Console.WriteLine();

        Task task1 = new Task();
        task1.Subject = "Test Task1";
        task1.RegardingObjectId = new EntityReference("account", acctId);
        Guid task1Id = _serviceProxy.Create(task1);

        Task task2 = new Task();
        task2.Subject = "Test Task2";
        task2.RegardingObjectId = new EntityReference("account", acctId);
        Guid task2Id = _serviceProxy.Create(task2);

        Task task3 = new Task();
        task3.Subject = "Test Task3";
        task3.RegardingObjectId = new EntityReference("account", acctId);
        Guid task3Id = _serviceProxy.Create(task2);

        Console.WriteLine("Three tasks created.");
        Console.WriteLine();

    // Construct query
        // Condition where task attribute equals account id.
        ConditionExpression condition = new ConditionExpression();
        condition.AttributeName = "regardingobjectid";
        condition.Operator = ConditionOperator.Equal;
        condition.Values.Add(acctId.ToString());

        //Create a column set.
        ColumnSet columns = new ColumnSet("subject");

        // Create query expression.
        QueryExpression query1 = new QueryExpression();
        query1.ColumnSet = columns;
        query1.EntityName = "task";
        query1.Criteria.AddCondition(condition);

        EntityCollection result1 = _serviceProxy.RetrieveMultiple(query1);

        foreach (var r in result1.Entities)
        {
            Console.WriteLine(r.Attributes["subject"]);
        };
        Console.WriteLine("-------------------------------");
        Console.WriteLine();


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Yogesh Vijay Mulay

    Thursday, May 2, 2013 6:47 AM
  • Gets or sets the ID of the entity instance with which the e-mail is associated.

    puja jain

    • Proposed as answer by Puja Jain Thursday, May 2, 2013 11:13 AM
    Thursday, May 2, 2013 11:13 AM
  • regardingobjectid is the field  which relates to another entity record for which email has  been generated.
    Thursday, May 2, 2013 1:31 PM