Monday, January 11, 2010

mahipal champawat wants to keep up with you on Twitter

mahipal champawat wants to keep up with you on Twitter

Twitter connects you with everything you want to know, right now. Short bursts of information are readily available from news organizations, corporate entities, politicians, celebrities, local businesses - even your close friends and family. Also, if you have something to share with the world, Twitter makes it super easy. To join for free, click the link below. http://twitter.com/i/f93b994280434a632c982c9949dc26c861e704fc

Thanks,

@twitter

About Twitter, Inc.

Founded in 2007, Twitter Inc believes the open exchange of information can have a positive global impact. Every "Tweet" is limited to 140 characters of text or links which means they are easily written or read on a wide variety of services and devices including any mobile phone, social networks, television, Macs, PCs, and the Web.

This message was sent by a Twitter user who entered your email address. If you'd prefer not to receive emails when other people invite you to Twitter, click here: http://twitter.com/i/o?c=LidbcV9dIh3LIWWTV9xEVle2b%2BlfU0xN7uNrg%2FHkGjXW0Il4OhdBKw%3D%3D

Please do not reply to this message; it was sent from an unmonitored email address. This message is a service email related to your use of Twitter. For general inquiries or to request support with your Twitter account, please visit us at Twitter Support.

Friday, February 20, 2009

Code to clone a opportunity of Contact

Clone a opportunity of cpntact using the Clone Function
Object required is Contact,Opportunity, OpportunityContactRole.

public Void CloneOpportunity() {
try{
//ArrayList to get the Checked opportunityId
String []idsArray= allIds.split(';');
if(idsArray.size()<0){
for(Integer i=0;i
Opportunity opp=[select Id,Name,StageName,CloseDate from opportunity where id =:idsArray[i]];
Opportunity newOpp = opp.clone(false, true);
newOpp.Name=opp.Name+'_Clone';
insert newOpp;
//making a entry in OpportunityContactRole object
OpportunityContactRole opportunityRole = new OpportunityContactRole();
opportunityRole.OpportunityId=newOpp.Id;
opportunityRole.ContactId=System.currentPageReference().getParameters().get('id');
insert opportunityRole;
}
}throw new MyException();
}catch(MyException e){
string Msg = 'plz select a Opportunity';
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,Msg ));
return null;
}
return null;
}

AJAX And SalesForce

The AJAX a JavaScript wrapper around the API:

The AJAX available for any organization that has API access.
The AJAX Mozilla Firefox and Internet Explorer 6 or 7.
The AJAX is based on the partner WSDL. Because there is no type
checking in JavaScript, the type information available in the enterprise WSDL
is not needed.
You can execute any call in the API, and access any API object that you
normally have access to.
You can issue asynchronous calls, and use callback functions to handle the
results. For more information, see API Calls and the AJAX Toolkit.
You can use header options with a different syntax than in the API. For more
information, see Using Headers with the AJAX Toolkit.
You can handle errors with the AJAX Toolkit. For more information


AJAX And SalesForce


This document explains how to use AJAX Toolkit in JavaScript with embedded
API calls in an s-control.
An s-control is an HTML page that is rendered within the Apex platform user
interface layer. This is accomplished by creating a portion of the user interface
using an IFrame and publishing your HTML page in that IFrame. There are
very few restrictions on what can be contained in the HTML that is hosted by
that IFrame. You can run JavaScript, embed ActiveX or Java applets, or even
Flash.Whatever is appropriate for an HTML page is generally acceptable as an
s-control.With the AJAX Toolkit, you can create an s-control page that contains
API calls and processes Salesforce data.


Sample S-Control Using the AJAX
This s-control
queries data and displays it on the same tab where the s-control resides. For more information about creating or editing s-controls



If you create an s-control with the content above, then execute the s-control by either clicking a custom link that activates it
or by placing it on a tab other than the Home tab, you will see a few rows of unformatted data displayed in a new window.

Wednesday, February 18, 2009

Diffrence SAX between DOM

Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation.
SAX parser.................................
1.
Parses node by node.
2.
Doesn’t store the XML in memory.
3.
We cant insert or delete a node.
4.
Top to bottom traversing.
5.
SAX is an event based parser
6.
SAX is a Simple API for XML.
7.Import class

import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;

8.
doesn’t preserve comments
9.
SAX generally runs a little faster than DOM.


whereAS...............................................DOM


1.
Stores the entire XML document into memory before processing
2.
Occupies more memory.
3.
We can insert or delete nodes.
4.
Traverse in any direction.
5.
DOM is a tree model parser.
6.
Document Object Model (DOM) API.
7.Import class
import javax.xml.parsers.*;
import org.w3c.dom.*;

8.preserves comments
9.
SAX generally runs a little faster than DOM.

Wednesday, November 5, 2008

CheckOut The iBATIS

The iBATIS is a persistence framework which automates the mapping between SQL databases and objects in Java,in Java the object are the POJO(Plan Old Java Object).The mappings are decoupled from the application logic by packaging the SQL statements in XML configuration files. By this there will be a big reduction in the amount of effort put by developer to access relational database using APIs like JDBC and ODBC. The Other Presistence framework like hibernate allow the creation of an object model (in Java) by the user, and create and maintain the relational database automatically but iBATIS works in the reverse order ,the developer starts with the Sql database and create the Java Object automatically.iBatis is a better approach when the developer dnt have full control over the SQL db schemas eg. In the case when the application need to acces an existing SQL db or the new DB schemas which is not fully under the control of devloper ( when database design team has created the schemas and to optimized against better performance.)
EXAMPLE:
Assume there is a database table STUDENT(STUD_ID INTEGER, STUD_DESC VARCHAR(64)) and a Java object com.example.Student (id: int, description: String). To read the student record having the key STD_ID into a new Product POJO, the following mapping is added into an iBatis XML mapping file:
select id="Student" parameterClass="java.lang.Long" resultClass="com.example.Student"
select STUD_ID as id,
STUD_DESC as description
from STUDENT
where STUD_ID = #value#
/select

A new java STUDENT object can retrived from db against the valid Key (stundent number 999)
Student student = (Student ) sqlMapClient.queryForObject("getStudent t", 999);
The sqlMapClient object is an instance of class com.ibatis.sqlmap.client.SqlMapClient.
In the iBatis XML mapping file example, #value# is mentioned as the long integer and the value passed into the Select query.

Wednesday, July 9, 2008

Tuesday, May 20, 2008

Java Design pattrans

There are 23 basic types of design pattrans in java which is defined by the GOF(gang of four).The design pattrans is nothing but the "Element of reusablity of software".
The design pattrans are divided into 3 main catagories:
1) GoF creational Patterns.
2)GoF Structural Patterns.
3)GoF Behavorial Patterns.
GoF creational Patterns: define the best possible way in which the object can be instantiated. and also describes the best way to CREATE object instances.As we knows the object instance in Java can be created by a new operator.The types of creational Pattrans are:
1. Factory Pattern
2. Abstract Factory Pattern
3. Builder Pattern
4. Prototype Pattern
5. Singleton Pattern