cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Activity and Return Activitycode after add Success use DIAPI Using SDK ?

nitmanet168
Explorer
0 Kudos

How to create Activity and Return Activitycode after add Success use DIAPI Using SDK ?

View Entire Topic
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi nitmanet168,

You can use the following sample code:

 

SAPbobsCOM.ActivitiesService ActivitiesService = (SAPbobsCOM.ActivitiesService)oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ActivitiesService);
SAPbobsCOM.Activity activity = (SAPbobsCOM.Activity)ActivitiesService.GetDataInterface(SAPbobsCOM.ActivitiesServiceDataInterfaces.asActivity);
SAPbobsCOM.ActivityParams oActParams;
activity.CardCode = "C20000";
activity.Details = "Test DI";
oActParams = ActivitiesService.AddActivity(activity);
var ActCode = oActParams.ActivityCode;

 

Variable ActCode will contain the newly added Activity Code.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support