Hi Aamir,
Check the below link..
http://vikramxrm.blogspot.ae/2012/04/auto-populate-form-fields-with-selected.html
other option :
this example is from sdk.
function LoadEvent()
{
var sLookupValue = new Array();
if (Xrm.Page.getAttribute("new_lookupfield").getValue() == null)
{ return ""; }
sLookupValue = Xrm.Page.getAttribute("new_lookupfield").getValue();
if (sLookupValue[0] != null) {
var vLookid = sLookupValue[0].id;
retrieveAccount(vLookid)
}
}
function retrieveAccount(vLookId) {
SDK.JQuery.retrieveRecord(
vLookId,
"new_customentityname",
null, null,
function (customentitynametogetstate&iso) {
Xrm.Page.getAttribute("new_state/province").setValue((customentityname.new_customeentityField));
},
errorHandler
);
}
function errorHandler(error) {
alert(error.message);
}
You need to add supporting jquery, jquery1.4.1min and json files.
Hope this helps..