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
tejateja 

If a checkbox field on quote is checked can i reflect the change on all quote line items in salesforce

If a checkbox field on quote is checked can i reflect the change on all quote line items in salesforce?

Consider  a checkbox field as "abc" is checked on quote, I want to apply the change to all quote line items attached to it with the same change(I have the same checkbox field on both quote and quote line items). And similarly when the checkbox is unchecked and saved, It should do the same. I observed that I can't achieve this using field updates. Can Someone help me With how I can achieve this using apex trigger.

Thank you in advance for your insights. :)
Subramani_SFDCSubramani_SFDC
try like this...its for update status of quote when opportunity checkbox is true.



trigger updateQuoteStatus on Opportunity (after insert, after update){

    Quote q = [select status from Quote where Opportunity = :trigger.new[0].id and IsSyncing = true];

    for(Opportunity opp : trigger.new){

        if(opp.Opportunity.Checkbox__c == true){

            q.status = 'Pending RFP';
        }
    }

    update q;
}



Regards,
Subramani
Trinay technology solutions