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
l00p3yl00p3y 

S-Control and Custom Fields

I have created an S-Control to create a Case from an Opportunity.  The S-Control captures fields from the Opp and autopopulates fields I have mapped within Case via URL FOR.  I have a custom field named Case.Implementation_Name that I want to map to the Opportunity.Name field.  The Form name of the Case is "00NS0000000FtGi".  I am unable to get the Case.Implementation_Name field to populate.  I am using the Ajax Eclipse plugin and when I attempt to use the <label for="00NS0000000FtGi"> the error states "Field integrity exception occured, check your merge field definitions." when I attempt to use the merge field name I dont receive an error but the field still isnt populated.  Has anyone else had to overcome this problem, and how was it accomplished?

l00p3yl00p3y
Has no one else encountered this problem?

Greg HGreg H
Pass the Opportunity Id in the request for the sControl as "&eid={!Id}" in your URL FOR function.  If you pass the Id for the Opportunity in this manner you'll be able to make references within your sControl for any field on the Opportunity using the standard merge functionality like {!Opportunity.Name}.
-greg
l00p3yl00p3y
Greg,

I am not sure I understand.  I have attached my code below:Code:
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script language="JavaScript">
//build url
var newUrl = "{!URLFOR($Action.Case.NewCase,null,
[p3 = "012600000004vac",    //Imp Vendor Case Record Type
save = true, //Saves the record type choice
cas4 = Opportunity.Account, 
Case.Implementation_Name__c  =  Case.Subject ,
cas14 = Opportunity.Name,
cas3 = Opportunity.Contact__c,
cas11 = "Web",
retURL = $Request.retURL] ,true)}";

//redirect to url holding variables
window.parent.location.replace(newUrl);

 

Greg HGreg H
Thanks for posting your code.  I think there might be some issues with the various merge fields you are using in the sControl.  However, the issue for this post is that the "Case.Implementation_Name__c = Case.Subject" piece of your code is not working - correct?
 
If that is the problem, then the solution could be to replace the "Case.Implementation_Name__c" text with the actual field name.
 
From your first post, it seems that the field name from the source code of your edit page is "00NS0000000FtGi".  So replace "Case.Implementation_Name__c = Case.Subject" with "00NS0000000FtGi = Case.Subject".
 
Let me know if that gets you closer to a fix,
-greg
l00p3yl00p3y
Greg,

I apologize but I copied the wrong code earlier. The code listed here is the current code as well as the Case "label for" field I am attempting to map.Code:
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script language="JavaScript">
//build url
var newUrl = "{!URLFOR($Action.Case.NewCase,null,
[p3 = "012600000004vac",  //IM Vendor Case Record Type
save = true, //Saves the record type choice
"00NS0000000FtGi" = Opportunity.Name,    //Case "label for"  field name mapped to Opp Name
cas4 = Opportunity.Account,
cas14 = Opportunity.Name,  // Case Subject mapped to Opp Name
cas3 = Opportunity.Contact__c, // Opportunity Contact mapped to Case Contact
cas11 = "Web", // Case Origin
retURL = $Request.retURL] ,true)}";

//redirect to url holding variables
window.parent.location.replace(newUrl);
</script>

 

Greg HGreg H
I think the URL FOR function is looking for the Field Name from when you setup the custom field in salesforce.  So try replacing the text reading "00NS0000000FtGi" with the actual field name from the salesforce setup screen from your custom field instead.  I think it would be something like Implementation_Name.
Code:
var newUrl = "{!URLFOR($Action.Case.NewCase,null,
[p3 = "012600000004vac",
save = true,
Implementation_Name = Opportunity.Name,
cas4 = Opportunity.Account,
cas14 = Opportunity.Name,
cas3 = Opportunity.Contact__c,
cas11 = "Web",
retURL = $Request.retURL] ,true)}";

Let me know how far that gets you,
-greg
l00p3yl00p3y
Greg,

Still no good.  I exported the field name from the Data Loader and attempted to use that but it still did not work.

I atttempted to following changes:

IMPLEMENTATION_NAME__C = Opportunity.Name,