• ali khan 63
  • NEWBIE
  • -1 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi there,
In the following Apex code. I have created a string "query" in which I selected all the fields of a custom object.
for(String fieldName : fieldMap.keyset() )
        {
         if(strFields == null || strFields == '')
         {
           strFields = fieldName;
          }else{
           strFields = strFields + ' , ' + fieldName;
          }
         }

		query = 'SELECT ' + strFields + ' FROM ' + SobjectApiName + ' WHERE Id IN: buyIds';
        
        for(APTIVN__NBuyer__c buy: Database.query(query)) {
            SelectedBuyerIDs.add(buy);
        }
The problem is that for some fields for one particular row the value of this field is null. Is it possible to replace NULL value in an empty string on a SOQL query?
Best regards,