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
Simon BairdSimon Baird 

URL No longer exists on Custom OnClick Javascript button

Hi all,

I am trying to add some text to a field by pulling it from its parent record using a Onclick Javascipt button. Getting the URL no longer exists on refresh. Note the button is a custom button called from a VF page use apex:commandbutton
 
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} 

var c = new sforce.SObject("Patient_Session__c"); 
c.id ="{!Patient_Session__c.Id}";
var pgn = "{!Patient__c.Patient_Progress_Note__c}";
c.Treatment_Notes__c = pgn;

sforce.connection.update([c]); 
window.location= '/{!Patient_Session__c.Id}';

 
doravmondoravmon
you should use: window.location= '/' + {!Patient_Session__c.Id};