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
Angela_RSAngela_RS 

Pass Data from One Custom Object to Another

Hello! :smileyvery-happy:
 
I'm trying to pass field data from one Custom Object to another in Spring '07. I've created a "Client" custom object and would like to pass field information to a "Service Agreement" custom object, when  creating a new Service Agreement through a related list. For example when I create a new "Service Agreement" from the Client object I want the Client fields "Sales Manager Name" and "Client Address" to auto-populate in the new Service Agreement record.
 
I've tried the Custom Link but cant get it to work. I don't have that much of a programming background and would greatly greatly appreciate any help or step  by step instructions :smileywink:
 
Thanks and happy Wednesday!
LavadaLavada

This is a tricky issue. You might be able to do a lookup, just depends on what object you are trying to access. It is not necessarily your programming background. I have found this door closing more than it is open.  It is definitely a feature request that I would like in the product.

 

smoodysmoody
You can do this very simply using a custom link but it will only work if your creating the new Service Agreement from within the Client record. Yes, this does take some URL coding.
kevinedelmannkevinedelmann

I posted some reference info on passing data through custom links in another discussion thread that may help you.  You can check it out at:  http://community.salesforce.com/sforce/board/message?board.id=practices&message.id=1956

TCAdminTCAdmin
Angela,
 
Here is some information that I've put on the board that may assist you in this.  If you have any specific questions then please let me know
 
A Custom Link is a hyperlink on a record in Salesforce that, when clicked, will open up a different web page. You can use a Custom Links in Salesforce to trigger the creation of a new Salesforce record from within an existing record. By customizing your Custom Links you can pre-populate the newly created record with information from the existing record.

To create a Custom Link:

1. Create a new record by clicking the "New" when you are in the new record’s tab.

2. Copy the URL from the address bar when in the edit screen, it should end in “retURL=%2F001%2Fo”

3.Click on:

Setup | App Setup | Customize.

4. Click on the type of record on which you want the link to be displayed.

5. Click on "Custom Links". Click on "New".

6. Type in your Link Label and click "Next".

7. Paste the copied URL into the Link URL field.

You can now begin customizing your URL to propagate fields on your new record with the values on your existing record.

8. At the end of your URL type in an ampersand (the & symbol) followed by the name of the standard field you want to propagate.

NOTE: The name of a field is not necessarily the same as the field label displayed on a record.
NOTE: The easiest way to find out the target field name is by using Firefox. Go to the new record using the instructions above and then right-click anywhere on the screen. Click on the form tab and then wait for the third object to populate. Click on it and all the field names will be shown. You will have to do some testing with the link to find out which field label goes with which field.
NOTE: For custom fields, you must use the field ID instead of the field name. A field ID can be found by viewing the source code of a webpage on which that field is displayed. A field ID can also be found at the end of the URL on the Edit page for that field in setup.

9. After the Name of the field, type in an equals (the = symbol) followed by the value you want entered in that field. You can type in the actual value you want propagated, such as a word or number, or you can pull data from your existing record. To pull data from your existing record the value would be the Merge Field Name.

Sample: (will create a new lead from lead object):

https://na1.salesforce.com/00Q/e?retURL=%2F00Q%2Fo&name_firstlea2=[Mail Merge Name]&name_lastlea2=[Mail Merge Name]&lea3=[Mail Merge Name]&lea14=Hot

To propagate more than one field just repeat steps 8 and 9 as needed.
greggatssdgreggatssd
After a small learning curve, this works great! Its actually easy...

My only question is how can I remove the standard New button from the related list view on the related record detail page? So users only have the single (custom) button that populates all the related fields when creating the new record?

I am SO glad this finally clicked for me, now Im a URL creating fool. All of our related records can now easily populate common fields to generate standard forms.


TCAdminTCAdmin

Greg,

You will need to edit the page layout of the object where you are creating the record from.  Go to the related list and there you can remove the New button and replace it with your new custom button.

greggatssdgreggatssd
Im using Professional if that matters. I dont see an option in the Related list section (select related list, click Edit) that lets me remove the New button. I am able to add custom buttons.

Is this due to Professional Edition limitations?


TCAdminTCAdmin

When you create the button you can choose to have it available as a custom link, a detail page button, or a related list button.  If you create it as a related list button it will be available to display there when you edit the page and edit the related list.

greggatssdgreggatssd
I used a related list button. Its on the page and works great, it would be nice to be able to eliminate the standard new button though.

Is Enterprise more relational database like? In that I can display all the customer information fields in all related databases, if the customer informatiuon changes, all of the relevant fields in related records are by default up to date.

With this URL setup, if a customer changes their address for example, all of the records I create this way must be manually updated or another script made to update the fields. Is the default behavior of these URLs to overwrite existing data? Am I missing something simpler that perhaps can be triggered when the edit button is clicked, it always updates all the customer information fields?




TCAdminTCAdmin
Greg,
 
In the PE orgs you can remove the default New button.  I have attached an image with the checkbox highlighted so you can see where to remove the New button.
 
Currently the only way to update existing values in an object from related records is through a custom built sControl.  This can only be done with the Enterprise or above.  This still isn't something that can be done easily but it can be done.
Jon AtchisonJon Atchison
I have a question to add to this, I have been able to pass data from 1 object to another via a S-Control but what I can not figure out how  to do is set the Record Type.  I do not want to set the users default to being the record type I want  as the end user will be using multiple types and  I want multiple s-controls passing data to the same object but onto different record types.

Any suggestions on how to set this in my s-control?
TCAdminTCAdmin
If you click on the New button and then select the record type you can then see the value of RecordTypeId= and then the number for the record type.  By adding this to the URL used in passing the data it should allow you to select the record type when creating the record.
AllezAllez
I have a follow-up question on this. I am passing values to a new object, very similar to what is being done here (via adding parameters onto a URL). I need to populate a field that is not visible on the page layout for the new object. Or, the other option would be to update the field, but have it read-only (pretty sure this isn't possible). Is there any way to update this not-visible field?

Thanks!
NPMNPM
Sure, just take the field off your page layout.  It will still update.  You can test this by running a report that includes the field.