AnsweredAssumed Answered

bean not in if condition even logic is correct in logic hook

Question asked by Autchara Chaiprom on Mar 13, 2020
Latest reply on Mar 17, 2020 by Autchara Chaiprom

Hi,

a weird thing in my system

I have logic_hook in opportunities module after_save

but one record always not in a condition, I'm not sure why.

 

could you please suggest how should I investigate a problem?

 

 

 

 

logic: when change assignee from Admin to any user, do orange and green.

but weird not doing orange.

 

This logic for orange.

- is update

- assigned user id before not equal after

- not Admin

if (
        $arguments['isUpdate'] == true &&
        $arguments['dataChanges']['assigned_user_id']['before'] != $arguments['dataChanges']['assigned_user_id']['after'] &&
        $bean->assigned_user_id != 1
){
// do orange and green
}

 

log show:

user 1 (top) normal user

user 2 (bottom) weird user id = 1f99f0d8

 

 

Sugar 9 Pro

Thanks,

M

Outcomes