Skip to main content

Questions tagged [getcontent]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
82 views

getContent() works in JS Button but not in Quick Action LWC

I am working on converting some JS buttons to Lightning. These buttons invoke an Apex class that calls getContent() on a VisualForce page with a renderas attribute of PDF & then store that output ...
Jack Odell's user avatar
0 votes
0 answers
75 views

Visualforce saving PDF fails because of PageReference and getContent() in Experience Cloud/Community

I created a Visualforce page quick action on Opportunity object. It has an iframe to another visualforce page (renderAs='pdf'). The Visualforce Page action (parent) has a custom button to download the ...
Ozan Soğukpınar's user avatar
1 vote
1 answer
128 views

VF page reference getContent() call returns HTML not PDF blob

I'm having an interesting problem trying to send an email to a Contact with a PDF attachment. I've got a VF page that renders as a PDF, and an page controller apex class that creates the email and ...
Lars's user avatar
  • 11
1 vote
1 answer
130 views

ApexPages.currentPage().getContent() returns different value when called from actionFunction than from commandButton

I have a visualforce page with the code below. I am calling a apex method on page load that gets the pages content to send in an email. The getContent function returns junk information if called ...
Robinson's user avatar
1 vote
0 answers
166 views

How can I send an email while using PageReference getContent() method?

I am trying to send an email while using PageReference and the getContent() method which is, only ocassionally, throwing an error (seems like every couple of emails regardless of the frequency). ...
Max Goldfarb's user avatar
-1 votes
1 answer
65 views

Not able to write test class for this class. Error : testmethods do not support get content call

global class sendPDFEmailClass { @AuraEnabled WebService static void emailPdf(ID opportunityId) { PageReference pdfPage= Page.QuotationPDF; pdfPage.getParameters().put('id',...
Vishu Garg's user avatar
0 votes
1 answer
1k views

How do we convert pdf in html format in visualforce page?

Following code takes me with pdf but i wanted to view this pdf as html because in my pdf some buttons are clickable and i wanted to capture that click event from pdf so it is not possible in pdf and ...
Nail David's user avatar
3 votes
1 answer
4k views

Page getContent / getContentAsPDF not retrieving the updated data

I'm able to get all the data by calling the Page.getContentAsPDF() function by selecting all the record from Account object. Basically, I'm loading the pdf content based on query from page ...
Rival's user avatar
  • 601
0 votes
3 answers
2k views

Load a visualforce page in apex controller

Is there a way to load a visual force page in apex controller without viewing the page. The scenario is this I have a visualforcepage with apex:chart embedded. This page will save the chart as an ...
hpmacugay's user avatar
0 votes
1 answer
844 views

How can I get slot in Demandware Script?

There is one method by which we can access content slot in demandware, that is by using <isslot> tag in the template, but is there any other way by which we can do that? I mean by using ...
Code_Ninja's user avatar
0 votes
1 answer
2k views

Pagereference.getContent() is not bringing in the values from the record

Im trying to save a Vf page as an Attachment but the blob does not contain the values from the record. Im trying to understand if i need to pass in the record ID or not.. or what am i missing. Code ...
ridwan's user avatar
  • 67
2 votes
1 answer
2k views

Create a pdf attachment when you are a guest user

Good day Everyone. I am trying to create a functionality that will create a pdf and make it as an attachment. It is working fine when you are an authenticated user however when I try to create a ...
Hope's user avatar
  • 1,273
1 vote
0 answers
654 views

PDF generation failed. Check the page markup is valid.- Occurred when using getContentasPDF

I have a VF page, where I am not using renderas "PDF". In the single email messaging method of Controller, I am using the Attachment as pdf of the VF page. I used getContent() function which ...
user5432's user avatar
2 votes
1 answer
236 views

Call getContent() from Workflow Email Alert

I try to call the PageReference's getContent() method from a component that is nested in a visualforce email template. If the template is send via the test button, all looks great. However if I fire ...
sric's user avatar
  • 21
3 votes
2 answers
5k views

Asynchronous getContent hit org.apache.commons.httpclient.RedirectException: Maximum redirects (100) exceeded

we're having an issue with getContent() in asynchronous context, and I just can't find any way to work around it... We're exposing invocable Apex in our managed package, and one of them allow our ...
Cissou's user avatar
  • 83
2 votes
1 answer
3k views

Ampscript for Footer Content

I have about four footer variations that we use at the bottom of our email templates. I've been trying to place the various footers in: MyContents\Company_Footers\FooterNameHere An example footer ...
Pasquale's user avatar
2 votes
0 answers
285 views

How to test getContent() calls in Spring '17?

Now that the Apex Mocks API and its Stub API complement are available is it possible to properly test for a getContent() call? In the past I would just branch out if unit test was running and returned ...
Mossi's user avatar
  • 3,966
0 votes
1 answer
401 views

Why error on getContent() You have uncommitted work pending. Please commit or rollback before calling out

I am getting a log error when running this code. It is launched from the report schedule. You have uncommitted work pending. Please commit or rollback before calling out The part of the code ...
Daniel Howell's user avatar
1 vote
0 answers
41 views

getContent Issue on Scheduled Apex [duplicate]

Recently, I've been developing a scheduled apex class to send a csv file to an email. I was using the getContent method from a report page to achieve this. I was doing fine when executing it in ...
george's user avatar
  • 13
1 vote
2 answers
2k views

Apex rest resource and Pagereference.GetContent

we are using community and site.com in our project. we want to embed VF pages(for allowing Video chatting between Guest user and console users is one of the examples) in our static site.com pages. so ...
shubham jain's user avatar
0 votes
1 answer
1k views

Get multiselect field values (selected) values from one vf page to another

The case is next. On Custom vf page with a standard controller user might to select Users, He hit the Add users button and opens the second vf page (custom controller) with multiselect field. After ...
Viktor's user avatar
  • 360
6 votes
2 answers
664 views

How to mix getContentAsPDF calls with DML?

This critical update: PageReference getContent() and getContentAsPDF() Methods Treated as Callouts will be auto-activated in January 2016. We have some code that uses a queue of custom event ...
Keith C's user avatar
  • 136k
5 votes
2 answers
12k views

IN operator must be used with an iterable expression : For loop

I am getting Subject header error at below line. Can someone let me know what is the issue? Line: for (Compliance_Incident_abv__c myContact : [select ID,ManagerEmail_abv__c,RepEmail_abv__c,...
Testing_SFDC's user avatar
  • 2,950
4 votes
1 answer
849 views

PDF Generation Salesforce

I'm kinda stuck in the middle of all the limitations Salesforce has for creating a pdf out of a Visualforce page. What I have is a Visualforce page that takes some parameters and I use to rerender as ...
raym0nd's user avatar
  • 886
8 votes
3 answers
5k views

too many nested getContent calls?

I have a Visualforce page that renders perfectly as a PDF that I'd like to attach to an opportunity record and to attach to an email. Whenever the code gets to getContent(), I keep getting an error ...
sberley's user avatar
  • 554
1 vote
2 answers
432 views

Custom settings field error

Although I am having this field in my custom settings it shows Error : Variable does not exist. Please find below code snippet. Can someone let me know what could be the reason? Code Snippet: ...
Testing_SFDC's user avatar
  • 2,950
2 votes
2 answers
2k views

How to get the text only from the getcontent method

I have used the following code to get the content of the page but it shows the content along with style, HTML code so how to get content only from the webpage. My Code is : PageReference page = new ...
Lemon's user avatar
  • 895
11 votes
1 answer
7k views

generating PDF of a record's printable view in batch apex

Some of my users cannot view the Case object owing to restricted licenses. To avoid paying for service cloud licenses, I need to generate PDF snapshots of all Case records using a batch (the are many ...
max's user avatar
  • 2,419
6 votes
2 answers
3k views

VF PDF(getContent) generates corrupted PDF while using standard controller

Well lately I noticed a weird behaviour of Pagereference getContent() method while using it with a standard controller along with an extension. So here is bit of code to demonstrate the issue. PAGE ...
Avidev9's user avatar
  • 5,659
4 votes
2 answers
3k views

getContent() returns Blob PDF-body in console, but HTML page (rendered like PDF) in Email service code

First at all: Happy New Year to you and your family. I wish you all the best in new 2014 year. And about my case: I use 'MyPdfRenderingPage.getContent();' method to get Blob PDF-body, create PDF ...
Denis Brown's user avatar
4 votes
2 answers
377 views

Salesforce Timing/Cache issue ?? Update record before generating a VF PDF

I have a custom button which generates and sends an invoice pdf. Just before to generate the pdf, if the issue date of the invoice is null, I set the date to today, then I generate the PDF. The code ...
brovasi's user avatar
  • 5,675