AnsweredAssumed Answered

Call to undefined method stdClass::save()

Question asked by Francesca Shiekh on Feb 23, 2017
Latest reply on Jul 25, 2017 by Francesca Shiekh

I have a simple custom scheduler that reads in data from a different system and syncs the data to Sugar.

Among others, I update a custom module called addlo_Address_Locations

However, when I try to save the updated bean after retrieving it I get an error

 

PHP Fatal error:  Call to undefined method stdClass::save() referencing what is here as line 22

 

Any thoughts on why this is happening? I've used BeanFactory to retrive, update and save all sorts of beans in logic hooks and custom schedulers, so why the problem for this particular one? What am I not seeing from staring at this too long?

 

      if ($found_addr_id) {
        ############################################################
        # update the sugar addr table
        ############################################################
        log_write($fp, "-BEGIN-UPDATE-{$addr_id}");
        $addr = BeanFactory::retrieveBean('addlo_Address_Locations', $found_addr_id, array('disable_row_level_security' => true));
        $addr->assigned_user_id = $primary_salesrep_sugarid;
        $addr->business_region = $staged_record['business_region'];
        $addr->tax_exempt_c = $staged_tax_exempt;
        //other field updates
        $addr->save();
        $addr_id = $addr->id;
        log_write($fp, "-END---UPDATE-{$addr_id}");
      }

 

thanks,

FrancescaS

Outcomes