You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Connect PHP : Error updating multiple Opp

Question
17
Views
0
Comments
edited May 20, 2019 6:16AM in Agent Desktop

Summary

Connect PHP : Error updating multiple Opp

Content

Hi,

 

I have multiple opp to be updated inside a for loop , but it throws an error if the Opp exceeds count 50.

Code : 

if(isset($opp_arr)){
for($i=0;$i<=count($opp_arr);$i++){
$opp_id=$opp_arr[$i]['Opportunity ID'];
//echo "Opp ID :".$opp_id;
if(strlen($opp_id))
{
//echo "here";
 
/*set Assigned */
$opportunity = RNCPHP\Opportunity::fetch($opp_id);
 
$opportunity->AssignedToAccount = RNCPHP\Account::fetch(xxxxxxxx);
/*Set ManualCampaign */
 
/*Set ManualCampaign */
$opportunity->CustomFields->TC->ManualCampaign = RNCPHP\TC\ManualCampaign::fetch(xx); 
/*Set ManualCampaign */
$opportunity->save();
RNCPHP\ConnectAPI::commit();
}
 
}

 

Error cannot retrieve : Opp due to a previous fatal error  : DB API Error 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!