• supriya jain 27
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
I have a simple requirement to override standard create pdf button on quotes using custom vf page.

i have created a main vf page on   which  I am calling my vf page rendered as pdf.
Now if I am using iframe to call my pdf page:
It shows the pdf page along with Save button, but no actual backend data just the structure.

User-added imageAnd If I use apex:include tag to call my pdf page, it doesnot show my command button that is custom "Save pdf"..

User-added image
Request you to kindly help or provide suggestion.

I have seen multiple blogs.Is it necessary to uncheck "Enable clickjack protection for non-Setup Salesforce pages " to get rid off i frame issue.
I want to display Products records with some filter conditon, when I click on Add product on Opportunities.
I have achieved it using custom vf page and URL parameters,it is working fine in Classic but this is not working in Lightning.It redirects to Classic Add product page and again after adding it navigates back to lighning. Do anyone know the work around for this So that it remains in lighning environment even at the time of adding products?
I have created a tab for offline Dataload, where we can download the Salesforce Report (Opportunity Product), modify the downloaded csv file and click on Import button to upload the file, we are validating the csv using Apex class and display all the records below and give option to Upload/Update data in Salesforce for success Records.

Error : If we update the csv file with more than 1300 records or sometimes 1200, it fails as show Time limit exceeded error.
Is it due to csv file limit or or the record size? If Yes,Please provide us the valid limits for csv file import.

When I reduced the columns from csv file and modified the code,
Again uploaded file with 1872 -1862 records, I got error "Maximum view state size limit (170KB) exceeded. Actual view state size for this page was 170.577KB"

With 1861,1860 rows, I got
Time limit exceeded
Your request exceeded the time limit for processing.

There are two things , one is Viewstate for Visual force page and another is Time limit exception.
Another issue is that the behavior is also not stable , Sometimes it shows View state error and sometimes it works with the same number of records 
I want to display Products records with some filter conditon, when I click on Add product on Opportunities.
I have achieved it using custom vf page and URL parameters,it is working fine in Classic but this is not working in Lightning.It redirects to Classic Add product page and again after adding it navigates back to lighning. Do anyone know the work around for this So that it remains in lighning environment even at the time of adding products?
I have created a tab for offline Dataload, where we can download the Salesforce Report (Opportunity Product), modify the downloaded csv file and click on Import button to upload the file, we are validating the csv using Apex class and display all the records below and give option to Upload/Update data in Salesforce for success Records.

Error : If we update the csv file with more than 1300 records or sometimes 1200, it fails as show Time limit exceeded error.
Is it due to csv file limit or or the record size? If Yes,Please provide us the valid limits for csv file import.

When I reduced the columns from csv file and modified the code,
Again uploaded file with 1872 -1862 records, I got error "Maximum view state size limit (170KB) exceeded. Actual view state size for this page was 170.577KB"

With 1861,1860 rows, I got
Time limit exceeded
Your request exceeded the time limit for processing.

There are two things , one is Viewstate for Visual force page and another is Time limit exception.
Another issue is that the behavior is also not stable , Sometimes it shows View state error and sometimes it works with the same number of records 
hai 
 please tell me the code to insert records related to multiple objects with the data from csv file using custom visualforce upload page, you can see preview of my page attached hereUser-added image

Thanks in advance
Hi,

I have a Visualforce page that creates a PDF contract of an opportunity, and I'm trying to save the PDF as an attachment on the opportunity.  I think I'm almost there, but I'm getting an error 

"DML currently not allowed 
An unexpected error has occurred. Your development organization has been notified."


here is my controller extension
public class savePDF {

        // The extension constructor initializes the private member
    // variable pageOpp by using the getRecord method from the standard
    // controller.
    Private Opportunity pageOpp;
    public savePDF(ApexPages.StandardController stdController) {
        this.pageOpp = (Opportunity)stdController.getRecord();
        system.debug('id = ' + pageOpp.id);
        
         PageReference pdf = Page.TWC_Contract;
    // create the new attachment
    Attachment attach = new Attachment();

    // the contents of the attachment from the pdf
    Blob body;

    try {

        // returns the output of the page as a PDF
        body = pdf.getContent();

    // need to pass unit test -- current bug    
    } catch (VisualforceException e) {
        body = Blob.valueOf('Some Text');
    }

    attach.Body = body;
    // add the user entered name
    attach.Name = 'test';
    attach.IsPrivate = false;
    // attach the pdf to the account
    attach.ParentId = pageOpp.Id;
    insert attach;

    }
  
}
I kind of hypridized the code based on the post here
http://blog.jeffdouglas.com/2010/07/14/attach-a-pdf-to-a-record-in-salesforce/


Thanks,

 

Hi ,

 

I want to display the records with some filter condition  when i click Add Products button on Opportunity . How can i implement this ?

 

 

Thanks 

Prakash