web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Creating Activity using CreateNewActivityEntry of CrmServiceClient

(0) ShareShare
ReportReport
Posted on by 5

This is similar to a previous issue reported here:  https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/279560/unable-to-create-activity-using-createnewactivityentry-of-crmserviceclient

However, that issue was never resolved.

I am calling the CreateNewActivityEntry() method in the CrmServiceClient. The method always returns an empty Guid and does not throw an error.  The activity record is never created.

Example code:

Guid tmpRet = Guid.Empty;
if (contactID != null)
{
	CrmServiceClient tmpSvc = MyCompany.CRM.ServiceReference.Crm.CreateCrmService(ConfigurationManager.AppSettings["CRMServiceURL"], ConfigurationManager.AppSettings["CRMOrganization"]
		, ConfigurationManager.AppSettings["CRMServiceUserName"], ConfigurationManager.AppSettings["CRMServicePassword"], ConfigurationManager.AppSettings["CRMServiceDomainName"], 0, "");

	//this is not creating the record but not throwing an error either
	tmpRet = tmpSvc.CreateNewActivityEntry(activityTypeName, entityTypeName, contactID, subject, description, createdByID.ToString());
}
else
	throw new ApplicationException("ContactID cannot be null");

return tmpRet;

We use other methods on this service so I know the service works.

The parameters all contain values that I believe are correct, but I have not been able to find any examples of implementing this method anywhere.

Does anyone have experience using the CreateNewActivityEntry method and can help?

Here is some relevant version info:

  • Using Microsoft Dynamics CRM 2016 Version: 8.1.0.359
  • Application version: .NET version 4.6.1
  • SDK version from NuGet: Microsoft.CrmSdk.XrmTooling.CoreAssembly package version 8.2.0.1

Thanks,

Eric

I have the same question (0)
  • Suggested answer
    Eric S Profile Picture
    5 on at

    Ok, well I'm going to go ahead and answer my own post.  The solution to this was passing in the "activityTypeName" parameter as all lowercase.  Apparently the CRM API only likes to work with lowercase entity names.  I was passing in "Task" as the activityTypeName, but changed it to "task" and it work.  

    Thanks Microsoft for making an SDK that is so poorly documented.  Would it have been too freaking hard to create ONE example per method in the help documentation?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans