You need to sign in to do that
Don't have an account?
Forrest Muldune
Apex If and Then
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);
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);
It is not clear to give you proper solution.
Still trywith below code it may help !
Let m eknow if it help !
Else elabote bit more .
I appreciate the effort but it is still not coming out correctly.
For a more detailed explanation of my request, please view website
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BM7H
Thank you very much.
Try with below code it will help !
Let me know if it helps !
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.
I found a way to make this trigger work with using additional formula fields in Opportunities, thank you. The next question I have is when I delete a Loan Record, the trigger is not activate. When a loan record is deleted, how can this trigger activate?