Sugar Query - Ifnull

Hi everyone.

I am attempting to convert all of my Raw SQL into Sugar Query, having mostly success following the guide @ https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_9.2/Data_Framework/Database/SugarQuery/

However something I'm not able to replace yet is the ifnull(field,'') that I use. So for instance I use:

and ifnull(pp_id_c,'') = ''

For my raw SQL, I can see I can use:

$SugarQuery->where()->isNull('industry');
or
$SugarQuery->where()->contains('name','Test');

But neither do the ifnull function as far as I can tell. Basically I have a checkbox, and with sugar if they save but do not touch the field it returns "Null" but if it's null. And the above is if the field is null make it blank.

Can anyone help?

Thank you!

Daniel

Parents Reply Children
No Data