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
Julien CapestanJulien Capestan 

Submit function generates Opportunity and save a PDF as attachment

Hi.

I have a VF Page + Controller that generate an Opportunity and several objects.

During the "Submit" function that creates the opportunity, I want to create a PDF.
I created a second VFPage that uses the same controller and render it as a pdf.
In the "Submit" function I:
-Create the opportunity
-Save the VFPage output as an attachment.

The PDF saved is
1st submission - empty
2nd submission - Contains the data captured during 1st submission
3rd submission - Contains the data captured during 2nd submission
.. and so on

Any idea on how to prevent that?
viruSviruS
Can you please share your code to fix the issues