FindOne wrong order

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • esendino
    Senior Member
    • May 2019
    • 158

    FindOne wrong order

    Hi.

    I defined the table LGOrdenLinea with the default order: CreatedAt, descendent.

    I used these three instructions.

    $prOrdenLineaId = record\findOne('LGOrdenLinea',,, 'name=', $prSuscripcion);
    $prOrdenLineaId1 = record\findOne('LGOrdenLinea', 'createdAt', 'desc', 'name=', $prSuscripcion);
    $prOrdenLineaId2 = record\findOne('LGOrdenLinea', 'createdAt', 'asc', 'name=', $prSuscripcion);

    Theoretically $prOrdenLineaId should be equal to $prOrdenLineaId1.
    It wasn't. It was equal to $prOrdenLineaId2

    Not sure if the first instruction readed unordered (and randomly matched with ascendent) or it was ascendent.
  • yuri
    Member
    • Mar 2014
    • 8501

    #2
    Hi,

    > record\findOne('LGOrdenLinea',,, 'name=', $prSuscripcion);

    Such a call is not supported. ORDER is a mandatory parameter: https://forum.espocrm.com/forum/gene...ne-wrong-order
    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

    • esendino
      Senior Member
      • May 2019
      • 158

      #3
      Opppsss.
      Yes you are right. Sorry

      Comment

      Working...