Opppsss.
Yes you are right. Sorry
FindOne wrong order
Collapse
X
-
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-orderLeave a comment:
-
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.Tags: None
Leave a comment: