Call to undefined method stdClass::save()

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

Parents Reply Children
No Data