on 02-22-2013 7:31 AM
Hi all experts,
What object should i declare to add/update activity (this table: OCLG)?
Thanks
TONY
Hi Tony,
See the sample below.
CompanyService oCompServ = MyCompany.oComp.GetCompanyService();
ActivitiesService oActivityServ = (ActivitiesService)oCompServ.GetBusinessService(ServiceTypes.ActivitiesService);
Activity oAct = (Activity)oActivityServ.GetDataInterface(ActivitiesServiceDataInterfaces.asActivity);
ActivityParams oActParams;
oAct.CardCode="C30000";
oAct.HandledByEmployee = 2;
oAct.ActivityDate = DateTime.Parse("28/11/2012");
oActParams = oActivityServ.AddActivity(oAct);
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ad Kerrenmans,
Thanks for your code. but after i run your code, it display an error like below:
and this is my source code that i added more:
Dim oCompServ As SAPbobsCOM.CompanyService
oCompServ = PublicVariable.oCompany.GetCompanyService
Dim oActivityServ As SAPbobsCOM.ActivitiesService = oCompServ.GetBusinessService(SAPbobsCOM.ServiceTypes.ActivitiesService)
Dim oAct As SAPbobsCOM.Activity = oActivityServ.GetDataInterface(SAPbobsCOM.ActivitiesServiceDataInterfaces.asActivity)
Dim oActParams As SAPbobsCOM.ActivitiesParams
oAct.CardCode = "0020"
oAct.HandledByEmployee = 11
oAct.ActivityDate = Today.Date
oAct.ActivityTime = Today.Date
oAct.EndDuedate = DateTime.Parse("2/24/2013")
oAct.EndTime = Today.Date
oAct.Details = "Test from web"
oAct.Notes = "Note from web"
oAct.UserFields.Item("U_PTC").Value = "PTC from Web"
oActParams = oActivityServ.AddActivity(oAct)
Please advise me.
Thanks
TONY
Hi Ad Kerremans,
Thanks for your second code. your code run well. i can add new activity.
beside of this, i want to update the existing activity by using activity code.but activity code property is read only property so i can't assign activity no to this field. oAct.ActivityCode=7
So do you know how i can do?
Thanks
TONY
User | Count |
---|---|
96 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.