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
keerthana chowdharykeerthana chowdhary 

populate Account Billing Address To Related list contact mailing address by using custom button with onclicik javascript

Amit Chaudhary 8Amit Chaudhary 8
You can write your code like below
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

var caseObj = new sforce.SObject("Case"); 
caseObj.Id = '{!Case.Id}'; 

var caseRecords = sforce.connection.query("SELECT Id from User Where Name = '{!Case.Original_Case_Owner__c}'");

var records = caseRecords.getArray("records");

caseObj.OwnerId = records[0].Id;
sforce.connection.update([caseObj]);

window.location.reload();
http://salesforce.stackexchange.com/questions/45124/field-update-on-button-click-using-javascript

 
keerthana chowdharykeerthana chowdhary
thank uuuuuuuuuuuuuuuuuuuu raaa