gpt4 book ai didi

salesforce - 为什么我不能在 Salesforce 中更新这些自定义字段?

转载 作者:行者123 更新时间:2023-12-03 10:03:13 29 4
gpt4 key购买 nike

你好,
好吧,我很困惑。我的任务是更新一个 PHP 脚本,该脚本使用 BulkAPI 将一些数据 upsert 到 Opportunity 实体中。

这一切都很顺利,只是 Bulk API 为一些明确定义的自定义字段返回此错误:

InvalidBatch : Field name not found : cv__Acknowledged__c

和类似。

当我发现我使用的 WSDL 版本很旧(合作伙伴 WSDL)时,我以为我终于找到了问题。所以我立即重新生成了 WSDL。唯一的问题?企业、合作伙伴等......所有这些......不包括这些字段。它们都来自 Common Ground 包并以 cv_ 开头

我什至试图在 Workbench 的对象资源管理器以及 Force.com IDE 的模式资源管理器中找到它们。

所以,请......把你的经验借给我。如何更新这些值?

提前致谢!

克里夫

截图证明我有正确的访问权限:
alt text
alt text
alt text

编辑——这是我的代码:
require_once 'soapclient/SforcePartnerClient.php';
require_once 'BulkApiClient.php';

$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(APP.'plugins'.DS.'salesforce_bulk_api_client'.DS.'vendors'.DS.'soapclient'.DS.'partner.wsdl.xml');

$mylogin = $mySforceConnection->login('redacted@redacted.com', 'redactedSessionredactedPassword');

$myBulkApiConnection = new BulkApiClient($mylogin->serverUrl, $mylogin->sessionId);

$job = new JobInfo();
$job->setObject('Opportunity');
$job->setOpertion('upsert');
$job->setContentType('CSV');
$job->setConcurrencyMode('Parallel');
$job->setExternalIdFieldName('Id');
$job = $myBulkApiConnection->createJob($job);

$batch = $myBulkApiConnection->createBatch($job, $insert);

$myBulkApiConnection->updateJobState($job->getId(), 'Closed');

$times = 1;
while($batch->getState() == 'Queued' || $batch->getState() == 'InProgress')
{
$batch = $myBulkApiConnection->getBatchInfo($job->getId(), $batch->getId());
sleep(pow(1.5, $times++));
}

$batchResults = $myBulkApiConnection->getBatchResults($job->getId(), $batch->getId());

echo "Number of records processed: " . $batch->getNumberRecordsProcessed() . "\n";
echo "Number of records failed: " . $batch->getNumberRecordsFailed() . "\n";
echo "stateMessage: " . $batch->getStateMessage() . "\n";

if($batch->getNumberRecordsFailed() > 0 || $batch->getNumberRecordsFailed() == $batch->getNumberRecordsProcessed())
{
echo "Failures detected. Batch results:\n".$batchResults."\nEnd batch.\n";
}

最后,发送 CSV 数据的示例:
"Id","AccountId","Amount","CampaignId","CloseDate","Name","OwnerId","RecordTypeId","StageName","Type","cv__Acknowledged__c","cv__Payment_Type__c","ER_Acknowledgment_Type__c"
"#N/A","0018000000nH16fAAC","100.00","70180000000nktJ","2010-10-29","Gary Smith $100.00 Single Donation 10/29/2010","00580000001jWnq","01280000000F7c7AAC","Received","Individual Gift","Not Acknowledged","Credit Card","Email"
"#N/A","0018000000nH1JtAAK","30.00","70180000000nktJ","2010-12-20","Lisa Smith $30.00 Single Donation 12/20/2010","00580000001jWnq","01280000000F7c7AAC","Received","Individual Gift","Not Acknowledged","Credit Card","Email"

最佳答案

经过2周,4个案例,几十封邮件和电话,3个公告栏帖子,1个Stackoverflow问题,我终于得到了解决方案。

问题最终很简单。 (这让所有这些都更加令人沮丧)

如前所述,我试图在 Convio Common Ground 包中实时更新的自定义字段。显然,我们的安装有这个包的 2 个许可证。没有任何许可证分配给我的用户帐户。

目前尚不清楚没有 API 访问以外的许可证真正获得/失去了什么。正如该线程的其余部分所示,我能够以其他方式查看和更新​​字段。

如果遇到这种情况,您可以在“设置”中的“管理包”页面上查看许可证。深入到有问题的包,它应该列出被许可使用它的用户。

alt text

感谢 SimonF 在 Developer Force 公告板上提供的专业及时的帮助:
http://boards.developerforce.com/t5/Perl-PHP-Python-Ruby-Development/Bulk-API-So-frustrated/m-p/232473/highlight/false#M4713

关于salesforce - 为什么我不能在 Salesforce 中更新这些自定义字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4496769/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com