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
autochicautochic 

Simple S-Control

I would like to have an s-control that passes the CASE subject field to a CUSTOM OBJECT Name field. Could someone point me in the right direction? I know that this must be fairly simple but I'm new to this part of SFDC.
Thank for any help!
TCAdminTCAdmin

autochic,

I don't think that you need to have the complexity of an sControl for this.  You would be able to use a custom link as long as you are creating the custom object from the case.  Below is some instructions for creating something like this.  Please let me know if you have any questions or need help.


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.

autochicautochic

Thanks much for the direction! I was thinking that I needed the s-control to link to a custom button. I think I'm pretty close to getting this right - my issue still seems to be getting the fields to populate. The following shows what I did:

In the field edit ( for a custom object NAME field), according to step 8 (NOTE) the field id is 01I500000009fIs

 

I pulled this from:

https://na3.salesforce.com/p/setup/custent/CustomEntityNameFieldEdit?id=01I500000009fIs&retURL=%2F01I500000009fIs%3Fsetupid%3DCustomObjects&setupid=CustomObjects

 

 

I wrote my link :

https://na3.salesforce.com/a01/e?retURL=%2Fa01%2Fo&01I500000009fIs={!Case.Subject}

 

I also tried:

https://na3.salesforce.com/a01/e?retURL=%2Fa01%2Fo& production_schedule_ name={!Case.Subject}

 

https://na3.salesforce.com/a01/e?retURL=%2Fa01%2Fo&production schedule name={!Case.Subject}

 

https://na3.salesforce.com/a01/e?retURL=%2Fa01%2Fo& name={!Case.Subject}

I must have something wrong, as I still cannot get the case field to populate the custom object name field???

Again, thanks for the help!

 

TCAdminTCAdmin

Autochic,

 

You can take out the retURL portion of your custom link for simplicity, I haven’t seen the need of using this portion.  Your URL should look something like this:

 

https://na3.salesforce.com/a01/e?01I500000009fIs={!Case.Subject}

 

You can also simplify it by leaving out the server portion of the URL since you are calling it from Salesforce and leave only the following:

 

/a01/e?01I500000009fIs={!Case.Subject}

 

If this doesn’t populate the field as you want then it is probably the ID of the field that is an error.  The easiest way that I’ve found to show the field labels is by using Firefox and the Web Developer add-on.  This will put a forms button in your tool bar.  Click on the forms button and choose the Populate Form Fields.  This will put the field ID into the text area of the field on the page.  This works for all fields except for checkboxes and pick lists.

 

I hope this helps.

autochicautochic

Chris,

Thanks for the reply - everything is working great now - I found the error on the field ID. You are 100% right about that Foxfire web tool - much easier than sifting through the source code!

Karen