You need to sign in to do that
Don't have an account?

Copy Field value from one object to another
Hi,
I am trying to copy one field value to another field through one button click.I have created one custom button and in java script is below.
{!requireScript("/soap/ajax/26.0/connection.js")}
var emp=sforce.connection.query("Select Branch_Code__r.Name from Employee_Master__c where User__c='{!User.Id}' limit 1");
var recs = emp.getArray("records");
window.open("https://pfpdl--pdlpcsb.cs31.my.salesforce.com/a0v/e?ent=BDC-Transaction-Detail Edit&save_new_url=%2Fa0v%2Fo&retURL=&00Np0000000mvq0="+recs[0].Branch_Code__r.Name,"_self");
This script is copying the value in the url but not in that field.Anyone please help.
I am trying to copy one field value to another field through one button click.I have created one custom button and in java script is below.
{!requireScript("/soap/ajax/26.0/connection.js")}
var emp=sforce.connection.query("Select Branch_Code__r.Name from Employee_Master__c where User__c='{!User.Id}' limit 1");
var recs = emp.getArray("records");
window.open("https://pfpdl--pdlpcsb.cs31.my.salesforce.com/a0v/e?ent=BDC-Transaction-Detail Edit&save_new_url=%2Fa0v%2Fo&retURL=&00Np0000000mvq0="+recs[0].Branch_Code__r.Name,"_self");
This script is copying the value in the url but not in that field.Anyone please help.
instead of using "recs[0].Branch_Code__r.Name" use emp.records.Branch_Code__r.Name it'll work.
All Answers
instead of using "recs[0].Branch_Code__r.Name" use emp.records.Branch_Code__r.Name it'll work.
Still it is not working.In the url values are coming
https://pfpdl--pdlpcsb.cs31.my.salesforce.com/a0v/e?ent=BDC-Transaction-Detail%20Edit&save_new_url=%2Fa0v%2Fo&retURL=&00Np0000000mvq0=CITY-1
but I want to put this City-1 value in a custom field.