Skip to main content
In the code below, I am trying to figure out a way If Consumer_Loan__c = TRUE then it will require Consumer_Loan_Hidden__c = FALSE. 

I appreciate your help

deals = [Select Id, Consumer_Loan__c,Consumer_Loan_Hidden__c, Participated_Loan__c from Opportunity where Id in :dealMap.keySet()]; 

            for (Opportunity o : deals){

                if(consumerDeals.contains(o.Id)){

                    o.Consumer_Loan__c = TRUE;

                }else{

                    o.Consumer_Loan__c = FALSE;

                }

                if(consumerDealsYellow.contains(o.Id)){

                    o.Consumer_Loan_Hidden__c = TRUE;

                }else{

                    o.Consumer_Loan_Hidden__c = FALSE;

                }

                if(participatedDeals.contains(o.Id)){

                    o.Participated_Loan__c = TRUE;

                }else{

                    o.Participated_Loan__c = FALSE;

                }

                updatedDeals.add(o);
5 answers
  1. Jun 12, 2015, 5:39 PM
    I appreciate the help, but it did not work out.

    In the Consumer__c picklist field in Loan__c custom object I have the following values below

    Not reviewed

    Consumer

    Non-consumer

    Insufficient information

    Ambiguous

    Example: If one Opportunity (Deal) is connect to 2 loans (loan A and Loan B) . If the the Consumer__c picklist = "Consumer"  in Loan A and the Consumer__c picklist = ​"Ambiguous" or "Insufficient information" or "Not reviewed" or "Null" in Loan B, then the Consumer_Loan__c = TRUE and the Consumer_Loan_Hidden__c = FALSE. the "Consumer" value in the Consumer__c picklist is always superior to other values. However if a user changes the Consumer__c picklist = "Ambiguous" or "Insufficient information" or "Not reviewed" or "Null" in Loan A, then the  Consumer_Loan__c = FALSE and Consumer_Loan_Hidden__c = TRUE. 

    I hope my explanation helps. thank you for your time again.

     
0/9000