5 réponses
Hi Meta,1-If you have value of this field Some_Field__c and comparing to null value with ID then return nothing. Becoz query does not have this type of data, therefore, doesnt return anything.2-If you have empty value of this field and comparing to null empty string or null value with Id the query return nothing. query does not have this type of data therefore doesn't return anything. 3-If you want to return Id, and some other field value whenever Some_Field__c field value is empty or null. then it returns the row. String s ='';String query = ('Select Id,Some_Field__c from account where Some_Field__c=\'' + s+'\'');List<sObject> obj = database.query(query);System.debug('Your object field list--->'+obj);You can also use this.String query = ('Select Id, Some_Field__c from account where Some_Field__c = Null');List<sObject> obj = database.query(query);System.debug('Your object field list--->'+obj);ORstring query='Select Id, Some_Field__c from account where Some_Field__c = ' '\';List<sObject> obj = database.query(query);System.debug('Your object field list--->'+obj);Please let me know if you have any query.Please mark it as best Answer if you find it helpful.Thank YouAjay Dubedi