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

Help Needed In creating an S-Control To populate values in Case Object based on values in Contact
Hi,
I am new to salesforce and pretty new to s-control.I want to populate some custom fields based on the values that are present in the Contacts.The code that I have written is as below:
<html>
<head>
<title></title>
<script>
var newurl="{!URLFOR($Action.Case.NewCase,null,
[ eid= Contact.Id,
cas15= Contact.Description,
cas4= Account.Name,
cas3= Contact.Name,
<head>
<title></title>
<script>
var newurl="{!URLFOR($Action.Case.NewCase,null,
[ eid= Contact.Id,
cas15= Contact.Description,
cas4= Account.Name,
cas3= Contact.Name,
00N700000022TqG=Contact.User_Name__c,
retURL=$Request.retURL ],true)}";
window.parent.location.replace(newurl);
</script>
</head>
retURL=$Request.retURL ],true)}";
window.parent.location.replace(newurl);
</script>
</head>
I am getting an error on the line after cas3 since that is the id of the custom field.Could somebody help me out on this and tell me how to solve the problem.Or is there any other way this can be accomplished.
Thanks,
Bharathi
I would use cas3_lkid = Contact.Id, that should resolve your issue.
I don't use S-Controls for fields like this, I usually just use a custom URL, so I am not 100% sure of the script you have.
If you use cas3 = Contact.Name there could be multiple correct references, i.e. if there are two Bob Smiths in the database, it won't know which one to attach.
To do this, go to the object where field 00N700000022TqG resides ( as a lookup field ). Open the edit view for the lookup field and put a value in the Child Relationship Name field.
After this is done, you will be able to refer to the field by the name you specified, as opposed to the Salesforce Id.
HTH
Message Edited by jpizzala on 02-05-2008 10:02 AM
Hello,
My standard approach to this is:
var newURL = "{!URLFOR($Action.CPS_Client__c.New)}" +
"&Name=" + CPSName +
"&CF00N70000001xdT6=" + CPSName +
"&00N70000001xOpe=" + [CPSAcctManager] +
"&00N70000001xOpt=" + "{!Contact.FirstName}" +
"&00N70000001xOpo=" + "{!Contact.LastName}";