The following Apex method can be used to add an Event or Task to an existing Activity Plan via custom coding. Please be aware this method requires knowledge of Force.com best practices and as always we suggest testing your code in the Sandbox.
Syntax:
ActionPlansUtilitiesExternal.AddActivity(
@activityId,
@activityPlanId
);
Parameters:
@activityId
The Activity Id to be added to the Activity Plan.
@activityPlanId
The Activity Plan Id to which the activity is to be added.
Result:
The function call will return a JSON formatted string in this format: {success:"",result:""}
success
Will be either TRUE or FALSE
result
Confirmation message of process completion OR Error message if process is hauled with any unexpected error.
Example:
ActionPlansUtilitiesExternal.AddActivity (
'a0A9000000RJhKTEA1',
'a05900000051CpN'
);