[Vtigercrm-developers] vtws_query_related with ORDER BY clause?

Uma S uma.s at vtiger.com
Mon Jul 13 11:24:49 GMT 2020


Thanks! for the notification Alan. We will review this post release.

On Fri, Jul 10, 2020 at 2:20 PM Alan Lord <alanslists at gmail.com> wrote:

> anyone?
>
> On 07/07/2020 13:30, Alan Lord wrote:
> > I'm looking at the vtws_retrieve_related and the vtws_query_related apis.
> >
> > vtws_retrieve_related is OK - but it is limited in the sense you get
> > back everything.
> >
> > I would like to, maybe, add LIMIT and/or ORDER BY clauses...
> >
> > If I keep the query extremely simple, e.g.
> >
> >> $query = "SELECT * FROM HelpDesk";
> >> $data = vtws_query_related($query, '11x566', 'HelpDesk', $current_user);
> >> print_r($data);
> >
> > Then it works - but I can't add an ORDER BY clause. I couldn't add a
> > simple WHERE clause either. The VTQL_Parser threw an exception no matter
> > what I tried.
> >
> > Is it possible to use an ORDER BY clause? Can you provide some
> > documentation and/or examples? If not - what would a Marketplace module
> > have to do? Would it have to iterate/post process *all* the returned
> > data to effectively introduce ordering and/or limits?
> >
> >
> > Also, I note that in my simple query above, unlike vtws_query, if I
> > include the semi-colon in the query the query fails. This isn't
> > consistent - in vtws_query you MUST terminate the query with a ";".
> > (I expect it is the preg_match test in QueryRelated.php that is causing
> > this.)
> >
> >
> > Cheers
> >
> >
> > Al
> >
> >
> >
> >
> > _______________________________________________
> > http://www.vtiger.com/
> >
>
>
> _______________________________________________
> http://www.vtiger.com/
>


-- 
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20200713/a1445cc5/attachment-0001.html>


More information about the vtigercrm-developers mailing list