function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chirag MehtaChirag Mehta 

How to automatically populate LookUp Object field's into the Entity fields where this lookup is

There's a LookUp field of Contact in Custom Object

so when i select contact , i want the contact address to be populated into Custom Object 's Address field (one time migration)

I think only way possible is use of Integration Stuff

 

Suggestion are invited

 

Also at : - http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=1035

customDevcustomDev
Try this -probably not the best way to do this, but it works. Create a similar SControl and add it as a link to the opportunity.
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Opportunity: {!Opportunity_Name}</title>
<link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<link href="/dCSS/Theme2/default/custom.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<link href="/css/assistive.css" type="text/css" media="aural,braille,embossed" rel="stylesheet" >
<link rel="shortcut icon" href="https://www.salesforce.com/favicon.ico">
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script language="javascript">
var accountId="{!Account_ID}";
//Initiate the script
function initApp()
{
sforceClient.init("{!API_Session_ID}","{!API_Partner_Server_URL_70}"); //login to salesfroce using session Id and Server Url
updateMyField();
}
function updateMyField()
{
try
{
getAccountMyField();//Query Account Information
}
catch(e){}
}
//This method retrieves the information from the account
function getAccountMyField()
{
sforceClient.Query("Select my_field from Account where Id ='" + accountId + "'",insertOpportunityMyField);
}
//This method sets the information on the opportunity
function insertOpportunityMyField(qrAccount)
{
var strMyField;
if(qrAccount!=null && qrAccount.records.length>0)
{
for(i=0;i<qrAccount.records.length;i++)
{
strMyField = qrAccount.records[i].get("my_field");
}
}
else{
strMyField="";
}
var opportunity = new Sforce.Dynabean("opportunity");
opportunity.set("Id","{!Opportunity_ID}");
opportunity.set("my_field",strMyField);
var sr = sforceClient.Update([opportunity])[0];
if (sr.success == true) {
alert("Update was successful...");
} else {
alert("Update failed: " + sr.errors[0].message);
}
top.location.replace("/{!Opportunity_ID}/e?retURL=/{!Opportunity_ID}&save=1");
}
</script>
</head>
<body onLoad="javascript:initApp()";>
</body>
</html>
Chirag MehtaChirag Mehta

Thanx for the above

 

But I too knew to do the same using Scontrol

I want to do it automatically without getting any click to be done or something like

formula field automatic population

I too know that it cant be done,,,,,,,,,,,,,,but if any it would be helpful

customDevcustomDev

You can have a poller at the back end that will continously check for status change and then copy/update given fields. Note that currently, this can not be hosted on Salesforce.com and you will require an external system that access Salesforce.com via webservices.

Also, the winter release supports functionality to overide the default settings so you should be able to do this using an SControl then.

Chirag MehtaChirag Mehta

I think the answer i want is No

 

We cant do the thing using the current release and staying inside SFDC wo using any external source like

web service or Scontrol

 

And i winter release we can do the same ...thanx for that