Get itemlist from salesorder entity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Serge
    Junior Member
    • Oct 2023
    • 5

    Get itemlist from salesorder entity

    Hello,

    Is it correct i dont get the itemList property if i use this line of code?
    So actually in general, the getEntityById doesnt return related entities?

    Code:
     $salesOrder = $this->entityManager->getEntityById('SalesOrder', $salesOrderId);
    Once I ask for itemList it returns me null
    Code:
     $salesOrderItemList =  $salesOrder->get('itemList');
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    PHP Code:
    $items = $this->entityManager
        ->getRDBRepository('SalesOrderItem')
        ->where(['salesOrderId' => $salesOrderId])
        ->order('order')
        ->find(); 
    
    Last edited by yuri; 11-13-2023, 08:06 PM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...