更新:它按预期工作,只需要传递正确的 ID,DUH!~
我在 salesforce 中有一个自定义对象,有点像案例的评论部分。当您添加新评论时,它具有该条目的日期/时间戳,我想在创建新案例评论时更新以前的案例评论日期/时间戳。
我想做这样的更新:
$updateFields = array(
                'Id'=>$comment_id, // This is the Id for each comment
                'End_Date__c'=>$record_last_modified_date
            );
function sfUpdateLastCommentDate($sfConnection, $updateFields) {
    try {        
        $sObjectCustom = new SObject();
        $sObjectCustom->type = 'Case_Custom__c';
        $sObjectCustom->fields = $updateFields;
        $createResponse = $sfConnection->update(array($sObjectCustom));              
    } catch(Exception $e) {
        $error_msg  = SALESFORCE_ERROR." \n";
        $error_msg .= $e->faultstring;
        $error_msg .= $sfConnection->getLastRequest();
        $error_msg .= SALESFORCE_MESSAGE_BUFFER_NEWLINE;
        // Send error message
        mail(ERROR_TO_EMAIL, ERROR_EMAIL_SUBJECT, $error_msg, ERROR_EMAIL_HEADER_WITH_CC);
        exit;
    }
}
我也尝试过 UPSERT 但我得到了错误:
Missing argument 2 for SforcePartnerClient::upsert()
任何帮助都会很棒