getDuplicateWhereClause

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • item
    Active Community Member
    • Mar 2017
    • 1476

    getDuplicateWhereClause

    Hello,

    who can help : i have the code below :
    my request is :
    if niss is duplicate => stop
    or if firstName and lastName is duplicate => maybe continue.

    Regards


    PHP Code:
    protected function getDuplicateWhereClause(Entity $entity, $data)
    {
    
    $data = [
    'OR' => [
    [
    'firstName' => $entity->get('firstName'),
    'lastName' => $entity->get('lastName'),
    ],
    [
    'niss' => $entity->get('niss'),
    ],
    ],
    ];
    
    return $data;
    
    } 
    

    PS : this code result as "Duplicate 409 error" when add "teams" to the record.. :s
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​
Working...