Process Definition not Triggered from $bean->save()

Hi everyone.

I am struggling to figure out why, but a process definition that uses the "Changes" method is not firing when a logic hook is using $bean->save(). The changes is a simple "No to Yes" but when saving the record it doesn't go into the processes.

I tried doing:


$dataChanges = $bean->dataChanges;
$bean->save();
$bean->dataChanges = $dataChanges;

But seemingly had no luck. Has anyone seen this before?

Thanks

Dan

Parents
  • Hi Daniel,

    You are using which version of SugarCRM?

    As from version 10.2 $bean->dataChanges is no longer supported. You need to use $bean->stateChanges instead.

    Hope it will work fine. Have a good day!

  • Hi Maryam. 

    I am on 10.0.3 but I did try $statechanges but same issue I'm afraid. Any other suggestions would be really appreciated! 

    Thank you,

  • You are using which logic hook?

    Also, are you trying to call some function in your logic hook, and it is not calling? Is it the real problem? 

  • Hi Maryam, I am using before and after save. The issue is when doing $bean->save() in after save it doesn't seem to fire the process.

    I can see $bean->dataChanges is seeing the change which is the odd part.

  • Also slight note on this, if i comment out $bean->save() the process works just fine... So something with save function is causing the issue. 

Reply Children
No Data