Featured post
Why can't I update these custom fields in Salesforce? -
greetings, bewildered. have been tasked updating php script uses bulkapi upsert data opportunity entity.
this going except bulk api returning error defined custom fields:
invalidbatch : field name not found : cv__acknowledged__c
and similar.
i thought found problem when discovered wsdl version using quite old (partner wsdl). promptly regenerated wsdl. problem? enterprise, partner, etc....all of them...do not include these fields. they're coming common ground package , start cv_
i tried find them in object explorer in workbench schema explorer in force.com ide.
so, please...lend me experience. how can update these values?
thanks in advance!
clif
screenshots prove have correct access:
edit -- here code:
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"; }
and lastly, example of csv data being sent:
"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"
after 2 weeks, 4 cases, dozens of e-mails , phone calls, 3 bulletin board posts, , 1 stackoverflow question, got solution.
the problem quite simple in end. (which makes of more frustrating)
as stated, custom fields trying update live in convio common ground package. apparently our install has 2 licenses package. none of licenses assigned user account.
it isn't clear gained/lost not having license other api access. rest of thread demonstrates, able see , update fields in every other way.
if run this, can view licenses on manage packages page in setup. drill through package in question , should list users licensed use it.
thanks simonf's professional , timely assistance on developer force bulletin boards: http://boards.developerforce.com/t5/perl-php-python-ruby-development/bulk-api-so-frustrated/m-p/232473/highlight/false#m4713
- Get link
- X
- Other Apps
Comments
Post a Comment