Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unable to create activity using CreateNewActivityEntry of CrmServiceClient

Posted on by Microsoft Employee

Hi,

 In one of my project when I want to create a activity  using CreateNewActivityEntry method of  CrmServiceClient. I am unable to create

it but it will not get error and return only empty guid.

The code is 

-------------------------

caseResponseActivity = AppConfigSettings.CaseReponseActivity;

var caseResponseActivityType = CRMServiceHelper.GetOptionSetValueLabel("activitypointer", "activitytypecode", service).Where(c => c.Value == caseResponseActivity).Select(e => (KeyValuePair<int, string>?)e).FirstOrDefault();

if (caseResponseActivityType != null)

{

  crmResponseActivity.ActivityId = service.CreateNewActivityEntry(caseResponseActivityType.Value.Value

, "incident", crmResponseActivity.CRMCaseId, crmResponseActivity.Subject,

crmResponseActivity.Description, "IT.test@tp.eu");

}

 

*This post is locked for comments

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Unable to create activity using CreateNewActivityEntry of CrmServiceClient

    Hi Rajnish ,

    Could you please try to debug the code and also it will be helpful if you share what you did in below method

    CreateNewActivityEntry

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to create activity using CreateNewActivityEntry of CrmServiceClient

    Hi Rawish,

     I am able to create incident(case) .but when I try to create activity using CreateNewActivityEntry it will return null. Is I am wrongly pass any parameter values in it. Kindly provide some example of it.

  • Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: Unable to create activity using CreateNewActivityEntry of CrmServiceClient

    Hi Rajnish,

    Did you debug the code to see what is going wrong.

    Also please check if you are able to retrieve organization service without any issue - because generally this happens if your organization service itself is null.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans