Announcement

Collapse
No announcement yet.

FindOne wrong order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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

    Comment


    • #3
      Opppsss.
      Yes you are right. Sorry

      Comment

      Working...
      X