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
Sai Shanmukh 15Sai Shanmukh 15 

when ever i click button on opportunity, flow should trigger.

(Create quote, generate pdf, save pdf to opportunity , delete quote)
 
Sai Shanmukh 15Sai Shanmukh 15
Could someone revert on this one pls.
SwethaSwetha (Salesforce Developers) 
HI Sai,

To achieve the desired functionality of triggering a flow whenever a button is clicked on an opportunity,  these are general steps and you need to customize as per your requirement:

1. Create a Flow:
   - First, create a flow using an automation tool like Salesforce's Process Builder or Lightning Flow Builder. This flow will handle the steps you mentioned: Create a quote, generate a PDF, save the PDF to the opportunity, and delete the quote.

2. Create a Custom Button or Action:
   - Next, create a custom button or action on the Opportunity object. This button will be used to trigger the flow. If you're using Lightning Experience, you can create a Lightning Component or Quick Action instead.

3. Associate the Flow with the Button/Action:
   - Link the flow you created in step 1 with the custom button or action you created in step 2. This linkage will ensure that when the button is clicked, the flow is executed.

4. Define the Flow Logic:
   - In the flow, you'll need to define the logic to create a quote related to the opportunity, generate a PDF based on the quote, save the PDF as an attachment to the opportunity, and then delete the quote.

5. Test the Flow: Create an opportunity, click the button, and verify that the quote is generated, the PDF is attached to the opportunity, and the quote is deleted.

If this information helps, please mark the answer as best. Thank you