📚 SAP Business One SDK Help

UpdateActivity Method
See Also  Example
pIActivity

The data for the activity to be updated. The Activity object must contain the key of the object to be updated.

Description

Updates an existing activity.

The data for the activity, including the key of the activity to be updated, is contained in the Activity object passed to the method. To update an activity, you must first retrieve it using the GetActivity method.

Syntax

Visual Basic
Public Sub UpdateActivity( _
   ByVal pIActivity As Activity _
) 

Parameters

pIActivity

The data for the activity to be updated. The Activity object must contain the key of the object to be updated.

Example

Updating a Single Activity or a Modified Activity from a Series (C#)Copy Code
//Get a single activity or a modified activity from a series 
oParams = (ActivityParams)oActSrv.GetDataInterface(ActivitiesServiceDataInterfaces.asActivityParams); 
oParams.ActivityCode = singleActCode; 
Activity oGet = oActSrv.GetActivity(oParams); 
oGet.Notes = "Discuss next year's financial plan and training plan"; 
 
//update a single activity, or an already modified activity from a series 
oActSrv.UpdateActivity(oGet);
Updating a Recurring Activity Series (C#)Copy Code
//Get an activity series 
oParams = (ActivityParams)oActSrv.GetDataInterface(ActivitiesServiceDataInterfaces.asActivityParams); 
oParams.ActivityCode = seriesActCode; 
oGet = oActSrv.GetActivity(oParams); 
oGet.StartTime = DateTime.Parse("16:00:00"); 
 
//Update the whole series 
oActSrv.UpdateActivity(oGet); 

See Also