function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Forrest MulduneForrest Muldune 

Apex trigger - request update

All

I am kind of new to Apex coding and I was wondering if anyone could help me with the updating the apex trigger I have saved as an images.I had to save the coding in images because of the new Text limit feature by SF.

In the Consumer__c picklist field in the Loan__c custom object, contains the values
 
  •  Not reviewed
  •  Consumer
  •  Non-consumer
  •  Insufficient information
  • Ambiguous 
  •  
  • Request 1: When a user selects “Non-consumer” in the Consumer__c picklist field in the Loan__c object , in the Opportunity object, the Consumer_Loan__c checkbox  = TRUE and the Consumer_Loan_Hidden__c = FALSE
 
Request 2: When a user selects “Ambiguous”, “'Insufficient information”, or picklist is blank with no value,  in the Consumer__c picklist field in Loan__c object , in the Opportunity object, the Consumer_Loan_Hidden__c checkbox  = TRUE.

User-added image
User-added image
Andy BoettcherAndy Boettcher
Is the Loan object a child of Opportunity?  If so, why don't you just use Workflow or Process Builder for this?
ManojjenaManojjena
Hi Forrest Muldune,

I have one query here please clarify .

What is the relationship between Loan__c and Oportunity ?

 
Andy BoettcherAndy Boettcher
Heck, you could probably even use a trigger-ready Flow kicked off by Process Builder too.  =)
Forrest MulduneForrest Muldune
I have a lookup relationship from Loan to Opportunity and another lookup relationship from Opportunity to Loan.

User-added image

I hope this helps




 
Forrest MulduneForrest Muldune
I tried using workflow and proccess builder however I could not make it work because I could not view the Consumer_Loan_Hidden__c and Consumer_Loan__c fields in Opportunities when creating the workflow and proccess builder using the Loan__c object.