Salesforce的 - 更新/定制的Upsert对象条目
-
19-09-2019 - |
题
更新:它按预期工作只需要通过正确的ID,DUH〜
我在销售人员的自定义对象,种等上例如的情况下的注释部分。当你添加一个新评论它有针对该项目的日期/时间戳记,我想创建一个新的情况下注释时更新前一种情况评论日期/时间戳记。
我想要做这样的更新:
$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()
任何帮助将是巨大的。
解决方案
咄,我计算出来,被传递错误的标识。需要通过commentId但被传递的recordId
不隶属于 StackOverflow