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
LeeCLeeC 

Button Help

Hello, I have two objects called "Jobs" and "Survey". I have a button on the Job's layout that I want to transfer information over to the Survery object when it is clicked.  The first field is a lookup field which shows the account name, the second field is called "Job Number". Does anyone know what formula I need to transfer the information?

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 
Ispita_NavatarIspita_Navatar

You have not specified :-


1. Information of which object you want to transfer , I am presuming it to be job.
2. Next you have not specified the specific information to be transferred.
3. You have asked what formula will work , are you asking about code to be run via URL or you want to use Formula Field.
.
I am presuming you want to transfer information from "Job" to "Survey".


As you are talking about using button to implement this hence, I think simple URL to update this information in the survey object. I think the attached code will explain things in a better way:-


I am also assuming that survey object is linked by a lookup field with the job object
/a09/e?id={!Job__c.Suvey__c}&00N80000004I201={!Job__c.AccountId}&00N80000004I206={!Job__C.JobNumber}

 

Here id is the id of the survey object
00N80000004I201- is the id of the html control storing Accountid
00N80000004I206- is the id of the html control storing JobNumber

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

 

All Answers

EnthEnth

Wouldn't it be easier to just have a Master-Detail or Lookup relationship between your objects and use the NEW button on the Survey Related List? You can then use formula fields on the Survey to view the job info.

 

if you want to take a copy of the data from the Job object (say in case it changes later) then you'll need to use a Workflow with field updates for each field you want to copy). 

 

To do it any other way needs some Apex/VF or s-control knowledge, plenty of examples for that if you really need them. 

Ispita_NavatarIspita_Navatar

You have not specified :-


1. Information of which object you want to transfer , I am presuming it to be job.
2. Next you have not specified the specific information to be transferred.
3. You have asked what formula will work , are you asking about code to be run via URL or you want to use Formula Field.
.
I am presuming you want to transfer information from "Job" to "Survey".


As you are talking about using button to implement this hence, I think simple URL to update this information in the survey object. I think the attached code will explain things in a better way:-


I am also assuming that survey object is linked by a lookup field with the job object
/a09/e?id={!Job__c.Suvey__c}&00N80000004I201={!Job__c.AccountId}&00N80000004I206={!Job__C.JobNumber}

 

Here id is the id of the survey object
00N80000004I201- is the id of the html control storing Accountid
00N80000004I206- is the id of the html control storing JobNumber

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

 

This was selected as the best answer
LeeCLeeC
I followed your guide again   and it worked! many thanks.