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
sushmaraosushmarao 

Custom button call vf page from javascript

I have a custom button on a visual force page. The Page is a part of the managed package and i am adding a custom button on the page layout for customisation in customer side. Now i want to execute a javascript on the click of the custom button so i can open a vf page. so i used :-

 

window.open('/apex/DuplicateScheduleTemplate?id={!JobSuite__Schedule_Template__c.Id}','_self');

 

The DuplicateScheduleTemplate page is not a part of the package and i have created at the client end.

I receive the following error.

 

 URL No Longer Exists

 

You have attempted to reach a URL that no longer exists on salesforce.com. 

 

Can some one please suggest some ways to resolve this issue?

 

 

Regards,

Sushma.

 

 

Navatar_DbSupNavatar_DbSup

Hi,

I think you are not including the namespace before the page name. You have to add your managed package namespace in your vf page. When you run the vf page.

 

Try the below code snippet as reference:

window.open('/apex/namespace__DuplicateScheduleTemplate?id={!JobSuite__Schedule_Template__c.Id}','_self');

 

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

sushmaraosushmarao

The DuplicateScheduleTemplate is not a part of the managed package. Ok Let me put it here again more clearly: I have an object 'Schedule Template' which is a part of the managed package. I want to implement duplicate 'Schedule template' functionlaity, so i added a custom button on the page layout ao that any user can go to details of the record of the 'Schedule Template' and click the duplicate button to create a duplicate. Now on the click of the duplicate button i want to open a vf page using javascript which i have created on the client end (vf page will handle duplicate creation). 

 

 

sushmaraosushmarao

I am new to salesforce so can some one suggest some way to do this.