SugarQuery Suggestion(s)

Idea created by EvilPeri EvilPeri on Oct 29, 2015
    Active
    Score10
    • Francesca Shiekh
    • EvilPeri EvilPeri
    Hi Guys,

    So as most of my dev work is now on Sugar 7 I've become more and more reliant on SugarQuery to get records without going through Bean (since this is pretty heavy sometimes).

    Right now some of the things i notice is that having the lack of ability to use aggregates on the select statement. Sure you can use a $sq->select()->fieldRaw(); but it just doesn't seem right since all my query is built using SugarQuery and here i am adding a raw select statement. Also handling null on the select, i often use the sugar query where "notIn" method and have to pass a sugarquery object as a second parameter which would return a couple of values from fields but sometimes the field is not yet populated and has a value of null this messes up my query and returns null for the main sugar query i used. I have to go and add a $sqNotIn->select()->fieldRaw("IFNULL(field,'')", "alias");.

    I think this needs to be part of the sugarquery methods since as i've said above i hate injecting raw queries into SQ that would beat its purpose. Or maybe this has already been implemented and i just don't know yet, if that's the case can anyone point me in the right direction?