You need to sign in to do that
Don't have an account?

Task Update Issue
Hi
I am trying to update the task using the API .
I am creating the fields like this
$createFields = array (
'ActivityDate' =>$Task_date,
'Priority' =>'Normal',
'Status' => 'Not Started',
'Description' => $_POST['task_logacall'],
'Subject' => $_POST['task_subject'],
'WhatID' => $_POST['policy_id'],
'OwnerId' => $_SESSION['Id']
'ActivityDate' =>$Task_date,
'Priority' =>'Normal',
'Status' => 'Not Started',
'Description' => $_POST['task_logacall'],
'Subject' => $_POST['task_subject'],
'WhatID' => $_POST['policy_id'],
'OwnerId' => $_SESSION['Id']
Now its creating the new task but when I add the user Id in lastModifiedID its not creating the task and also not throwing any error, The code is
$createFields = array (
'ActivityDate' =>$Task_date,
'Priority' =>'Normal',
'Status' => 'Not Started',
'Description' => $_POST['task_logacall'],
'Subject' => $_POST['task_subject'],
'WhatID' => $_POST['policy_id'],
'OwnerId' => $_SESSION['Id'],
'ActivityDate' =>$Task_date,
'Priority' =>'Normal',
'Status' => 'Not Started',
'Description' => $_POST['task_logacall'],
'Subject' => $_POST['task_subject'],
'WhatID' => $_POST['policy_id'],
'OwnerId' => $_SESSION['Id'],
LastModifiedById=> $_SESSION['Id']
$task_result = $ssuUtility->createTask($createFields);
The createTask Functions looks like this
public function createTask($fields) {
$contactSObject = new SObject();
$contactSObject->type = 'Task';
$contactSObject->fields = $fields;
$createContactResult = $this->mySforceConnection->create(array($contactSObject));
return $createContactResult;
}
$contactSObject = new SObject();
$contactSObject->type = 'Task';
$contactSObject->fields = $fields;
$createContactResult = $this->mySforceConnection->create(array($contactSObject));
return $createContactResult;
}
the $_SESSION['Id'] i am getting by querying the User__c object. Its updating the owner Id but not the lastmodifiedId, which changes the name of the person who last modified it.
Please let me know what is going wrong here. Or is that I cannot change the LastModified Person name by updating LastModifiedById using Session_Id from user__c object
DG
$contactSObject = new SObject();
$contactSObject->type = 'Task';
$contactSObject->LastModifiedById = '005300...';
$contactSObject->fields = $fields;
$createContactResult = $this->mySforceConnection->create(array($contactSObject));
return $createContactResult;
}
You can't change the lastModifiedId, its a read-only field that's managed by the system.
1. If that ID is your own ID (or strictly, the ID of the API login), then don't do anything. sfdc will automatically assign that ID.
2. If that ID is not the API login, then saying it is the last modifier would be incorrect, no?
Its the API one. SFDC does assign it automatically. But the logic of application requires me to update that also.
The person loggin into salesforce is administrator and it allows other people to login and create tasks. so everytime we see the administrator as the last modified person. But I need the last modified person name to be the other one.
All this is happening through phone. Thats the reason we are using administrator login.