• Sarah Dickinson
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 9
    Replies
Hi,

I am having issues with the rendering of images in a Visualforce PDF.

ll my product images are stored on a server and are accessible at the URL http://images.metropuzzle.com/IMG2/[PRODUCT CODE]_IMG2_L.jpg
E.g. http://images.metropuzzle.com/IMG2/NPZPD1703_IMG2_L.jpg
When I try to use those URL in <apex:image> it does not render the image in the PDF...

User-added image


As I am trying to track down the issue, I found something very odd.
For this simple test I am using one of my product image, and an image I found online, the URL is http://investor.salesforce.com/files/design/newlogo-company.png -- This URL seems to redirect to the URL http://s1.q4cdn.com/454432842/files/design/newlogo-company.png

I am building the PDF with the Visualforce code below: 
<apex:page renderAs="PDF">
    <div class="productGridContainer">
            <div class="productGridItem">
                <div>
                    <apex:image value="http://images.metropuzzle.com/IMG2/NPZPD1703_IMG2_L.jpg"/>
                    <apex:image value="http://investor.salesforce.com/files/design/newlogo-company.png"/>
                    <apex:image value="http://s1.q4cdn.com/454432842/files/design/newlogo-company.png"/> 
                </div>
            </div>
    </div>
</apex:page>

It does not render my product image, and for the image I found online it only renders the first one, not the second one. But it is the same image!
User-added image

Would someone have any idea why this is not working?

Thanks a lot!
Hi,

Today I noticed that my Data Storage had gone way up, and the first object in the list was Email Messages. When I queried all the Email Messages in our instance I noticed that everytime we send an email in APEX, there is an EmailMessage record created.
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setSubject('TEST');
email.setToAddresses(new String[] {'youremail@mail.com'});
email.setPlainTextBody('TEST');
Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email},false);

List<EmailMessage> emailMessage = [SELECT Id, Subject, TextBody FROM EmailMessage WHERE ParentId = null AND RelatedToId = null AND ActivityId = null AND MessageDate = TODAY AND Subject =:email.Subject];
System.assertEquals(1, emailMessage.size());

Is that documented somewhere? I feel like it has not always been the case.
Is there a way to not have those EmailMessage records created?

Thanks!
 
Hi,

I am having issues with the rendering of images in a Visualforce PDF.

ll my product images are stored on a server and are accessible at the URL http://images.metropuzzle.com/IMG2/[PRODUCT CODE]_IMG2_L.jpg
E.g. http://images.metropuzzle.com/IMG2/NPZPD1703_IMG2_L.jpg
When I try to use those URL in <apex:image> it does not render the image in the PDF...

User-added image


As I am trying to track down the issue, I found something very odd.
For this simple test I am using one of my product image, and an image I found online, the URL is http://investor.salesforce.com/files/design/newlogo-company.png -- This URL seems to redirect to the URL http://s1.q4cdn.com/454432842/files/design/newlogo-company.png

I am building the PDF with the Visualforce code below: 
<apex:page renderAs="PDF">
    <div class="productGridContainer">
            <div class="productGridItem">
                <div>
                    <apex:image value="http://images.metropuzzle.com/IMG2/NPZPD1703_IMG2_L.jpg"/>
                    <apex:image value="http://investor.salesforce.com/files/design/newlogo-company.png"/>
                    <apex:image value="http://s1.q4cdn.com/454432842/files/design/newlogo-company.png"/> 
                </div>
            </div>
    </div>
</apex:page>

It does not render my product image, and for the image I found online it only renders the first one, not the second one. But it is the same image!
User-added image

Would someone have any idea why this is not working?

Thanks a lot!
Hi,

I am having issues with the rendering of images in a Visualforce PDF.

ll my product images are stored on a server and are accessible at the URL http://images.metropuzzle.com/IMG2/[PRODUCT CODE]_IMG2_L.jpg
E.g. http://images.metropuzzle.com/IMG2/NPZPD1703_IMG2_L.jpg
When I try to use those URL in <apex:image> it does not render the image in the PDF...

User-added image


As I am trying to track down the issue, I found something very odd.
For this simple test I am using one of my product image, and an image I found online, the URL is http://investor.salesforce.com/files/design/newlogo-company.png -- This URL seems to redirect to the URL http://s1.q4cdn.com/454432842/files/design/newlogo-company.png

I am building the PDF with the Visualforce code below: 
<apex:page renderAs="PDF">
    <div class="productGridContainer">
            <div class="productGridItem">
                <div>
                    <apex:image value="http://images.metropuzzle.com/IMG2/NPZPD1703_IMG2_L.jpg"/>
                    <apex:image value="http://investor.salesforce.com/files/design/newlogo-company.png"/>
                    <apex:image value="http://s1.q4cdn.com/454432842/files/design/newlogo-company.png"/> 
                </div>
            </div>
    </div>
</apex:page>

It does not render my product image, and for the image I found online it only renders the first one, not the second one. But it is the same image!
User-added image

Would someone have any idea why this is not working?

Thanks a lot!
Hi,

Today I noticed that my Data Storage had gone way up, and the first object in the list was Email Messages. When I queried all the Email Messages in our instance I noticed that everytime we send an email in APEX, there is an EmailMessage record created.
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setSubject('TEST');
email.setToAddresses(new String[] {'youremail@mail.com'});
email.setPlainTextBody('TEST');
Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email},false);

List<EmailMessage> emailMessage = [SELECT Id, Subject, TextBody FROM EmailMessage WHERE ParentId = null AND RelatedToId = null AND ActivityId = null AND MessageDate = TODAY AND Subject =:email.Subject];
System.assertEquals(1, emailMessage.size());

Is that documented somewhere? I feel like it has not always been the case.
Is there a way to not have those EmailMessage records created?

Thanks!
 
Hi,

In my lightning component, I want a button to download email template in PDF format. we have renderAs PDF option in VF page. Do we have similar option to download page/ template in PDF?

Thanks in Advance!! :)

Regards,
Ganesh.
 
I can't show opportunity tab to customer community and customer community licenses users. And on the profile level there is no any option for this.

I read the documents and type of licenses and according to them opportunity is not available for user which these type of licenses.

But here I've two doubts

1) Here I have a controller and apex page. In controller I can get all the opportunities and all fetched opportunities are saved in wrapper class and then using a this wrapper class I can show opportunity and it is running successfully.

2) Here I have a controller and apex page. In controller I can get all the opportunities and saved in list and this list is a type of opportunity eg List<Opportunity> x. When I try to display oppty (using X) I got exception.

I am access my apex page from community portal.

My question if opportunity is not accessible to Customer portal and C Portal Licenses user the how can controller fetch the opportunities data ans show through the wrapper class and not opportunity type list

I must make a http request to Shopify in Salesforce. I used following url format as endpoint url for setEndpoint method

HttpRequest req= new HttpRequest(); 
req.setEndpoint('https://apikey:password@hostname/admin/resource.xml'); 
req.setMethod('GET'); 

I get following log:

CALLOUT_RESPONSE|[18]|System.HttpResponse[Status=Unauthorized, StatusCode=401]

And I get return value from body of HttpResponse:

<?xml version="1.0" encoding="UTF-8"?> <hash> <errors>[API] Invalid API key or access token (unrecognized login or wrong password)</errors> </hash>

Also I have tried to following structure but I haven't been succesful.

Blob headerValue = Blob.valueOf(apikey+ ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);

And also following url works properly in any browser

apikey:password@hostname/admin/resource.xml

What should I do for HttpResponse status code be 200.

Hi,

 

I've created a simple Visualforce page and a simple controller.  I've created a Web tab and pointed it at the page's url.  Clicking on the tab simply gives a list of our org's unread emails related to Cases.   Most times it takes over 30 seconds to load and render, even though it's only returning 20 or so rows at any given time.

 

 

The page:

 

<apex:page controller="emailController" tabstyle="emailmessage" sidebar="true"> <apex:pageBlock > <apex:pageBlockTable value="{!emails}" var="m"> <apex:column headerValue="Case" value="{!m.ParentId}"/> <apex:column headerValue="Closed" value="{!m.Parent.IsClosed}"/> <apex:column headerValue="Received" value="{!m.messagedate}"/> <apex:column headerValue="Owner" value="{!m.Parent.Owner.Name}"/> <apex:column value="{!m.fromaddress}"/> <apex:column value="{!m.toaddress}"/> <apex:column value="{!m.subject}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

 

The controller:

 

 

public class emailController { List<EmailMessage> emails = [select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0' order by Parent.IsClosed asc, messagedate desc ]; public List<EmailMessage> getEmails() { return emails; } }

 

What could possibly be causing a 30-second delay on this?  I'm not saying that Salesforce.com performs that fantastically in the best of times for those of us on European instances, but 30 seconds for such a simple page is a little bit absurd. 

 

Any input is greatly appreciated!!