Saturday, 31 May 2014

Adding summary field as footer of pageblock table in vf page.





Hi All,

This post is simply showing how can we add the summary field or total amount or other information in footer of PageBlockTable or DataTable in vf page.

Here, in the following example I am showing sum of all the opportunity line items in footer of PageBlockTable,

i am using the <apex:facet name="footer"> tag to show the value in the footer.

Here the code:


Screen shot:

Thanks
Anurag Jain



Wednesday, 7 May 2014

Insert Records in SF by using JavaScript without Apex classes or controller.





Hi guys,

In this post i am showing how can we use the power of javascript in VF page and inserting record in salesforce without any standard/custom controller or Apex.

By using AJAX Toolkit we can do this task easily.

AJAX Toolkit divides in two type synchronous and asynchronous call.

It works in three simple steps:
  1. Connecting to the AJAX Toolkit(By using login methods or getting Session_ID)
  2. Embedding the API methods in JavaScript.
  3. Processing the results.
in following example i am using synchronous call :-


Screen Shoots:-


 After inserting of record you are having ID of record :-


Happy Coding...:)

Thanks
Anurag Jain

Wednesday, 23 April 2014

hierarchy chart on vf page by using google chart.






Hi Guys,
I am writing this post to show how we can create a beautiful chart showing hierarchy level for Account on detail page, 
all Contacts shows according to their reporting managers for an Account.

here I am using Google chart in VF page and apex class,
for this requirement i am creating a string "ContactData" and using it on VF page that's it.

following is code for extension class and vf page:-

Screen shoot:-



Note:- chart is shows only if you fill the "Reports To" field at contact level.
Happy coding...
Thanks
Anurag Jain.

Monday, 10 March 2014

yes/no confirm pop up dialog box using jquery.





Hi Guys,

I am writing this post because some one comment on my blog and asked me for this requirement, i am happy to help him,

http://anuragsfdc.blogspot.in/p/salesforce-limits.html

his requirement is to show Yes /No buttons in place of Ok/Cancel buttons of javascript confirm function.

so for this i am creating a custom pop up dialog using JQuery.

here the code for same:-

here the screen shot:-


hope it helps, happy coding...

Thanks

Friday, 7 March 2014

SOQL Query on vf page using javascript without any controller.






Hi friends,

Many times you need record value on vf page for validation / viewing or for any other reason,
then you have to write a custom controller for query record.

here the example which show how you can query from vf page without any controller,
simply use JavaScript for query.


you can change the query according to your requirements.

Hope it helps
happy coding...:)
thanks
Anurag Jain

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...