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
jisaacjisaac 

need help with an sControl that has intermittent failures

 

I built an sControl that operates my New Sales Opp button to create new opportunities and prepopulate fields from the Account Table into the Opportunity. It works great except when the name of the Account has an apostrophe in the name, such as People's Credit Union. Then it just goes to a blank page.

My workaround has been to take out the apostrophe in the account name.

 

However, there are a few other accounts where I cannot figure out why it does not work - all I get is a blank page. There is no punctuation in the name or anything I can see that would cause it not to work.

Please help!

 

Here is my code:

 

<script language="javascript">
<!--

function redirect()
{
{
var redirectString = '/006/e?retURL=%2F001%2Fo
&00N60000001NLgS={!Account.OSI_Client__c}
&00N60000001cIWR={!Account.RFG_Strategic_Advisor__c}
&00N30000000vIfp={!Account.Core_Data_System_Install_Type__c}
&00N60000001NvR4={!Account.FMS_Integration__c}
&00N60000001dIdw={!Account.SSG_Client__c}
&00N60000001MG9v={!Account.Raddon_Client_ID__c}
&00N30000001APP5={!Account.Core_Contract_Exp_Date__c}
&00N30000001APbW={!Account.Regional_Account_Manager__c}
&00N30000001AaDU={!Account.Client_Agreement_Numb__c}
&00N30000001Bldu={!Account.Peoplesoft_Acctg_No__c}
&00N3000000091y9={!Account.Assets__c}
&opp4={!Account.Name}
&00N30000000k5v2={!Account.Number_of_MembersCustomers__c}
&00N3000000091y8={!Account.CoreSystem__c}
&00N30000000sHGJ={!Account.Core_Account_Manager__c}
&00N60000001MS1j={!Account.Digital_Insight_Rep__c}
&00N60000001eUvJ={!Account.OSI_ACH_Invoicing_Information__c}
&RecordType=012600000004v9b';
}
parent.frames.location.replace(redirectString);
}

redirect();

//-->
</script>

Best Answer chosen by Admin (Salesforce Developers) 
jisaacjisaac
actually, we found out that when any of the picklist selections on the account had an apostrophe in the selected item - such as a last name O'Connor - the s-control failed. So once we cleaned those up, we are good to go again. At least until SFDC does away with scontrols.

All Answers

JakesterJakester
You should post this in the developer.salesforce.com forums - hopefully they will be able to help!
jisaacjisaac

I did.

 

However, I am not a programmer and the suggestion that has come through is over my head so I thought I would see if any wizards here might help.

 

BTW, I was tickled when I saw you had responded because you have helped me many times before and I got my hopes up. So sad...

 

 

jisaacjisaac
actually, we found out that when any of the picklist selections on the account had an apostrophe in the selected item - such as a last name O'Connor - the s-control failed. So once we cleaned those up, we are good to go again. At least until SFDC does away with scontrols.
This was selected as the best answer