You need to sign in to do that
Don't have an account?
murali
update the Task Values using Partner API
hi...
I m using Partner API.
while Updating the Task values into SF. It is Showing "Unable to create/update fields: IsClosed, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp. Please check the security settings of this field and verify that it is read/write for your profile".
I m updating the values are OwnerId,ActivityDate,Priority,Status,Subject,Description,WhoId,WhatId and some custom fields.
i m passing Activity Date in terms of YYYY-MM-DD
Example....
First I m using describeSobject result:
DescribeSObjectResult dsr = oSforceP.describeObjectResult("Task");
string strDataType = CreateSelectList(dsr);/// these are the datafields.
sObject[] objUpdatedTask = oSforceP.getObjectFieldusingID(strDataType,TaskId,"Task");// here i m getting Task Values for particular Id.
Here I m assigning Updated values....
if(objUpdatedTask[0].Any[4].LocalName=="ActivityDate")
objUpdatedTask[0].Any[4].InnerText =strFinalDate;
if(objUpdatedTask[0].Any[7].LocalName=="OwnerId")
objUpdatedTask[0].Any[7].InnerText = ddlAssignTo.SelectedItem.Value;
if(objUpdatedTask[0].Any[6].LocalName=="Priority")
objUpdatedTask[0].Any[6].InnerText = ddlPriority1.SelectedItem.Value;
activityUpdated = oSforceP.updateAllTaskObject(objUpdatedTask[0]);
updateAllTaskObject is another function:
public bool updateAllTaskObject(sObject update_task)
{
bool bRet = false;
try
{
SaveResult[] saveResults = oSforceP.update(new sObject[] {update_task});
if(saveResults != null)
{
bRet = saveResults[0].success;
}
}
catch(Exception e)
{
bRet = false;
throw e;
}
return bRet;
}
I m getting Error Message as "Unable to create/update fields: AccountId, IsClosed, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp. Please check the security settings of this field and verify that it is read/write for your profile."
Please give me a solution for this thing.
thanks and regards,
Murali
I m using Partner API.
while Updating the Task values into SF. It is Showing "Unable to create/update fields: IsClosed, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp. Please check the security settings of this field and verify that it is read/write for your profile".
I m updating the values are OwnerId,ActivityDate,Priority,Status,Subject,Description,WhoId,WhatId and some custom fields.
i m passing Activity Date in terms of YYYY-MM-DD
Example....
First I m using describeSobject result:
DescribeSObjectResult dsr = oSforceP.describeObjectResult("Task");
string strDataType = CreateSelectList(dsr);/// these are the datafields.
sObject[] objUpdatedTask = oSforceP.getObjectFieldusingID(strDataType,TaskId,"Task");// here i m getting Task Values for particular Id.
Here I m assigning Updated values....
if(objUpdatedTask[0].Any[4].LocalName=="ActivityDate")
objUpdatedTask[0].Any[4].InnerText =strFinalDate;
if(objUpdatedTask[0].Any[7].LocalName=="OwnerId")
objUpdatedTask[0].Any[7].InnerText = ddlAssignTo.SelectedItem.Value;
if(objUpdatedTask[0].Any[6].LocalName=="Priority")
objUpdatedTask[0].Any[6].InnerText = ddlPriority1.SelectedItem.Value;
activityUpdated = oSforceP.updateAllTaskObject(objUpdatedTask[0]);
updateAllTaskObject is another function:
public bool updateAllTaskObject(sObject update_task)
{
bool bRet = false;
try
{
SaveResult[] saveResults = oSforceP.update(new sObject[] {update_task});
if(saveResults != null)
{
bRet = saveResults[0].success;
}
}
catch(Exception e)
{
bRet = false;
throw e;
}
return bRet;
}
I m getting Error Message as "Unable to create/update fields: AccountId, IsClosed, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp. Please check the security settings of this field and verify that it is read/write for your profile."
Please give me a solution for this thing.
thanks and regards,
Murali
Message Edited by murali on 01-02-2006 04:33 AM
Message Edited by murali on 01-02-2006 04:38 AM
You should construct a new sObject that just contains the fields you want to change for the update call.
murali
hi
I am not able to update task using APIs ...
Below is the code
SaveResult[] saveResults = binding.update(new Task[] {task, null });
where task is task object having data with updated values
Please guide