0

I have below code snippet here where I am not getting if clause work properly. Can someone please help? Outcome_abv__c is a picklist value. I can't find any picklist value as '--None--' it comes up during scroll for null.

       For(Compliance_Incident_Transaction_abv__c  o : citlist)
      {if(o.Outcome_abv__c=='--None--') // Not working
          {ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Please select outcome before Coach!');

        ApexPages.addMessage(msg);
        Outcomecheck=true;
        o.Control_R_C_abv__c=false;
          }
      }
2

It is behaving as expected. --None-- is only displayed on the UI, and it comes over as a blank string. if(o.Outcome_abv__c=='')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.