+ Start a Discussion

Help Needed In creating an S-Control To populate values in Case Object based on values in Contact

   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:
var newurl="{!URLFOR($Action.Case.NewCase,null,
                                         [ eid= Contact.Id,
                                          cas15= Contact.Description,
                                           cas4= Account.Name,
                                           cas3= Contact.Name, 
                                           retURL=$Request.retURL ],true)}";
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.
cas3 isn't a custom field, it is a relationship to a contact.

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.
   Thankyou gmc74 for your reply.Actually I was talking about the field after cas3.I also wanted to know how to write custom URL and where to write it.I am overriding the standard New button on the Case object with the s-control.If I write a custom URL is it possible to override the Standard Salesforce button.Any help will be appreciated.
It looks like field 00N700000022TqG is a relationship field that does not have a Child Relationship Name setup for it.

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.


Message Edited by jpizzala on 02-05-2008 10:02 AM
I have the same problem - however, the field I am trying to reference is not a lookup field, it's a number field. Any suggestions?


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}";