+ Start a Discussion
SAHG-SFDCSAHG-SFDC 

Check or uncheck the checkbox

HI,

I am working on a requirement where below are the two criterias , I created two checkboxes on opportunity , Proposals and opportunity do not share master detail relationship,

So workflows might not work, Any suggestions?

field on Opportunity (checkbox): "Has Primary Accepted Proposal"
Logic:  If Proposal that is Primary is changed to Approval Stage = "Accepted", then check this box.  If the Primary proposal is deleted from the opportunity or the status of the primary is changed from Accepted to something else, uncheck this box.

Field on Opportunity (checkbox):   "Has Proposal"
Logic:  If Opportunity has at least one Proposal attached, the box should be checked.  If all Proposals attached to Opp are deleted, this box should be unchecked.  
Mathew Andresen 5Mathew Andresen 5
A simple trigger could do this.
SAHG-SFDCSAHG-SFDC
Hi Matthew, Thanks for the reply, Could you please assist me how or point the direction?
Mathew Andresen 5Mathew Andresen 5
Sure, I would start with the Trail heads

https://trailhead.salesforce.com/module/apex_triggers