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
kMans2kkMans2k 

Syntax error on code for custom button

Hello all,
 
I have tried the folllowing code to pass some input via the URL to autofill entries. When I click the button, Salesforce complains of a syntax error. The button is placed on the detail page for ObjA.
Being a newbie, I cannot spot anything. I am hoping an experienced eye will do so:
 
<script language="JavaScript">
function redirect() {
parent.frames.location.replace("/006/e?retURL=%2F{!customObjA__c.Id}&opp3={!customObjA__c.Name}" );
}
redirect();
</script>
knicholsknichols
Something like this should work....

<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/8.0/connection.js"></script>
<script language="javascript">
    function nav()
    {        
        var url = "/006/e?retURL=%2F{!customObjA__c.Id}&opp3={!customObjA__c.Name}";
        frames.location.replace(url);        
    }
</script>    
</head>
<body>
<input type='submit' value='submit' onclick='nav()'>
</body>
</html>
kMans2kkMans2k
knichols,
 
Should this be a "URL" custom button, or should it be a "Execute Javascript" custom button
 
Thanks for your help.