Handling Colon in Element ID in JQuery – Visualforce problem

Today i came across very known problem of jQuery and thought of sharing same with everyone. In Salesforce the element id is in the format of “j_id0:j_id3:j_id4:c_txt“. In previous post we have already discussed about getting the elementId in Visualforce.
When i tried to find the element in JQuery like $(‘#j_id0:j_id3:j_id4:c_txt’), i was getting the error on JavaScript console of the browser. After few searches, i got to know that this is known problem and faced by many of the developers.

Live Demo

How to create Immutable Class in Java

We have heard the word “Immutable class” lots of time in Java. The best example is class “String“. Immutable class is the class whose value cannot be changed throughout the life cycle. We cannot change the content of String class, everytime new reference is created when we change the content, that is the basic difference between String and StringBuffer Class.
In this article, i will explain the step by step process to create the custom Immutable class in Java.
Our class should not able to derived and for that we will declare our class as final. The values cannot be change and thats why we will declare all the variables as final and we will provide only the getter methods as we cannot write setters because of final variables.
So to summarize, following steps needs to be taken:

Create SOAP message using Java

In this article, i am going to create the SOAP Message by using core Java Only. SOAP Stands for ” Simple Object Access Protocol”, which is used to exchange the structured information via Webservices.

SOAP Message consist of following three parts:

  1. SOAP-ENV:Envelope
  2. SOAP-ENV:Header
  3. SOAP-ENV:Body
SOAP Message Format for Web Services

SOAP Message Format for Web Services

Salesforce Interview Questions – Part 5

40. What is Master Detail relationship and look up relationship in Salesforce?
Ans:
Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records.
Look up relationship is something like “has-a” (Containership) relationship. Where one record has reference to other records. When one record is deleted then there is no impact on other records.


41. Can we convert the lookup relationship to Master Detail relationship?
Ans:
We can convert the lookup relationship to master detail relationship if and only if all the existing record has valid lookup field.


42. In How many way we can invoke the Apex class?
Ans:

  1. Visualforce page
  2. Trigger
  3. Web Services
  4. Email Services

Create Simple Drag and Drop Widget like iGoogle using JQuery

After reading this post you will come to know that how easy its to create the Drag and Drop functionality using JQuery.

To run this example you will need two javascript libraries as follow:

  1. JQuery
  2. JQueryUI
jQuery Drag and Drop Widgets

jQuery Drag and Drop Widgets

Get DOM ElementID of the Visualforce components

This article will focus on getting generated dom element Id in Visualforce.
Let’s consider below code snap:

<apex:page>
<apex:form id="frm">
Enter Value 1 :
<apex:inputText id="txt1" />
</apex:form>
</apex:page>

If you want to get the id of “apex:inputText” in javascript like belowCode

Var fld =  document.getElementById(‘txt1’);

It will NOT work.
Because its actual id will be something like “j_id0:frm:txt1”.

Getting record from other Salesforce organization OR communication between multiple salesforce organization

In this article, i will explain the code which can be used for connecting and getting the records from different or multiple salesforce organization using Apex and REST Service.

To start first we will need to authorize below two URL which can be accessed from salesforce environment.
This can be done from “Setup | Administration Setup | Security Controls | Remote Site Settings”

  1. https://www.salesforce.com
  2. https://ap1-api.salesforce.com
Salesforce Remote Site Setting

Salesforce Remote Site Setting

What is IaaS, PaaS and SaaS in Cloud computing

This blog entry is too late and the reason of writing this article is, lots of time i got question like “What is Cloud Computing?
So here, every term of cloud computing is explained.

Cloud Computing :

In simple words it is the application on the remote server and to access it you will need the internet access and browser.
Examples : Gmail,Yahoo Mail – Email on remote server not on your local system.

It may be possible that you have virtual server (Server at remote place) or development environment at remote place. This is also included under term “Cloud Computing”.

What is Cloud Computing

What is Cloud Computing


Passing multiple Parameters in ActionFunction in Visualforce

Calling Apex Method from the Visualforce page is the one of the most required functionality in application development in Salesforce. <apex:actionFunction> is one of the method used to achieve this functionality.

Most often we need to supply the arguments in <apex:actionFunction> and in this article I will demonstrate the way in which we can pass one or more than one parameter.
The output of the example will be like below screen.

Passing Parameter in ActionFunction in Visualforce

Passing Parameter in ActionFunction in Visualforce

Create Apex class with following code:

Email Services in Salesforce with simple example

What is an Email service in Salesforce?

Email services are automated processes that use Apex classes to process the contents, headers, and attachments of inbound email.

You can associate each email service with one or more Salesforce-generated email addresses to which users can send messages for processing.
The general template to create the apex class for the email services is:

How Email Services works in Salesforce

How Email Services works in Salesforce