After Retrieve Logic Hook is running multiple times in a loop

Hi,

How to prevent after retrieve logic hook from executing more than once.
I tried session variables, static variable for locking but of nothing happened.

Thanks.
Parents
  • Hi Harron,

    To prevent loop you have to let sugar bean know that bean is processed. 


    There are some flag with this object which prevent looping.

    for hook version - 1

    $this->processed = TRUE. 

    $this->logicHookDepth[$event] = 11  [ as max depth is this->max_logic_depth = 10 ]

    will prevent loop.


    You can see method - call_custom_logic of SugarBean class.





Reply
  • Hi Harron,

    To prevent loop you have to let sugar bean know that bean is processed. 


    There are some flag with this object which prevent looping.

    for hook version - 1

    $this->processed = TRUE. 

    $this->logicHookDepth[$event] = 11  [ as max depth is this->max_logic_depth = 10 ]

    will prevent loop.


    You can see method - call_custom_logic of SugarBean class.





Children