function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ilayaraja PonnusamyIlayaraja Ponnusamy 

How to Create Activity History using partner.wsdl service

Hi,
i am struggling to create activity history for any of my records in salesforce using partner.wsdl.

Any one could you please give me the solution for this?

Thanks.....
KaranrajKaranraj
Activity History is read-only object is displayed in a related list of closed activities—past events and closed tasks—related to an object. You can't insert/edit/delete records in the object.
Ilayaraja PonnusamyIlayaraja Ponnusamy

Hi Karanraj,
Thanks for your reply,

i can able to insert activity history using enterprise.wsdl service as Task object.but not able to insert using partner.wsdl 

When using enterprise.wsdl i am getting class "SforceService" and it has create method that takes single parameter(sObject type of array), so i create object for Task class and i can able to insert record using salesforce record id  in Task object.

e:g
SforceService sfService = new SforceService();
Task task=new Task();
task.WhatId="record id";
task.description="test";
.
.
.
sObject[] array=new sObject[1];
arra[0]=task;
sfService.Create(array);

it works fine for me.
but,
When using partner.wsdl i am getting "SoapClient" class and its Create methods takes more parameters like,

 soapClient.create(sessionHeader, options, new AssignmentRuleHeader(), new MruHeader(), new AllowFieldTruncationHeader(),
                   new DisableFeedTrackingHeader(), new StreamingEnabledHeader(), new AllOrNoneHeader(), new LocaleOptions(),
                   new DebuggingHeader(), Version, new EmailHeader(),array ,out info, out saveResult);

In this method call "array" is Task object.