Showing posts with label attachment. Show all posts
Showing posts with label attachment. Show all posts

Tuesday, 11 February 2014

Send email with attachment from Apex class and VF Page in salesforce.





Hi friends,

This post shows how to send Email with Attachment using Apex Controller and VF Page.

I am writing this post because it’s a common requirement to sends emails from salesforce with attachment to clients, contacts etc.

As per my knowledge there are two ways to send email from Apex:-
1.      By using email templates.
2.      By using Messaging class.

Here I am using Messaging class for sending email from apex class:-



Screen shots:-





hope it helps, happy coding...

Monday, 6 January 2014

Genrate Bar Codes from UPC or SKU by REST API.







Hi friends,

By this post I’ll show how to save Bar Code in Salesforce by using UPC code,

I call web service of third party which gives the image of Barcode (by using REST Api’s) and that image is Saved in the Notes and Attachment of Product.

Here the Sample code for same:-

Screen Shots:-







Monday, 23 December 2013

Add PDF VF-Page to Notes and Attachment from custom button and refresh current page.





Hi Friends,


In this post i m writing how to add the attachment to Note & Attachment of Salesforce.com from VF-Page which is rendered as “pdf” from detail page Custom button.

Here the Custom button code its of onclick java script behaviour:-

               window.showModalDialog('/apex/PDF_Page?id={!Lead.Id}','',"
           dialogWidth:800px;dialogHeight:500px; center:yes | no | 1 | 0 | on | off");
           location.reload(true);


Here i used two VF-Pages to avoid recursive calling of VF Page because I am saving Attachment of page to Notes and Attachment of same object.

Note:-
Remember not to call the method from  "PDF_Page_demo".

Happy Coding...:)

here the sceern shots:-