You need to sign in to do that
Don't have an account?

Display fields only if the values are not null or blank for a dynamic SOQL Query
Hi,
I stored all the editable fields in a variable and calling the variable in a dynamic SOQL query.
My Query:
my requirement is, if any field value is null or blank in the selected records or any field values is same in all the selected records then I should not display that field.
For example, here in the picture, product license number is same for all the selected records and Copy Primary Prod Co License(s) field is null for all the selected records. Now, I should avoid displaying those two in the output. This should happen dynamically for all the fields.
Kindly help me on this
I stored all the editable fields in a variable and calling the variable in a dynamic SOQL query.
My Query:
String fieldApiList = String.join(fieldsApiNames, ','); query = 'SELECT Name,'+ fieldApiList +' from EP_Service_License__c WHERE ID IN:recordIdSet'; SelectedEpserviceRecords=Database.query(query);Now, using a VF page I am displaying the fields and its values like as follows
For example, here in the picture, product license number is same for all the selected records and Copy Primary Prod Co License(s) field is null for all the selected records. Now, I should avoid displaying those two in the output. This should happen dynamically for all the fields.
Kindly help me on this
This appears to be the same ask in https://salesforce.stackexchange.com/questions/311411/display-fields-only-if-the-values-are-not-null-or-blank-for-a-dynamic-soql-query
Can you try the approach mentioned by experts and see if it fixes the issue.Thanks