Skip to Content
0

Delete Activity using ActivitiesService.

May 19, 2017 at 07:52 AM

88

avatar image

I'm trying to delete activity using the service.

CompanyService companyService = null;
ActivitiesService activitiesService = null;
ActivityParams activityParams = null;
try
    {
	companyService = company.GetCompanyService();
	activitiesService = companyService.GetBusinessService( ServiceTypes.ActivitiesService ) as ActivitiesService;
	activityParams = activitiesService.GetDataInterface( ActivitiesServiceDataInterfaces.asActivityParams ) as ActivityParams;
	activityParams.ActivityCode = activityID;
	activitiesService.DeleteActivity( activityParams );	
    }
finally
    {
	//Release
    }

This code thrown Exception: "[-10] Internal Error" on DeleteActivity() line. At the same time functions Add() and Update() works fine.

c# | diapi
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Roman Savelyev May 19, 2017 at 09:24 AM
0

I found solution: you should delete reference to activity from parent object (service call in my case).

Share
10 |10000 characters needed characters left characters exceeded