Error in realte function on parent link type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dimyy
    Active Community Member
    • Jun 2018
    • 569

    Error in realte function on parent link type




    Code:
    'id' => $id
    should use entity id, but use entityRel id

    Example of produced sql code:

    Code:
    UPDATE `queue` SET parent_id = '5b83df5fb16eadd74', parent_type = 'Task' WHERE queue.id = '5b83df5fb16eadd74' AND queue.deleted = '0'
    Original ESPO code:
    Code:
    ...->relate($queue,'parent',$task)
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    Hello,
    my two cent :
    parent is not a relation ..
    so i think (not tested) .. you must use parent so. :

    ->set('parentId', id);
    ->set('parentType', 'Task');

    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • dimyy
      Active Community Member
      • Jun 2018
      • 569

      #3
      Parent realtion type have support in ORM and I can use
      Code:
       ->set('parentId', id);
      ->set('parentType', 'Task');
      but not must.

      Comment

      • dimyy
        Active Community Member
        • Jun 2018
        • 569

        #4
        Also, may be relate function should return count of established relations. Now relate function return fact of sql statement correct execution.

        Comment

        Working...