You need to sign in to do that
Don't have an account?
![sushmarao sushmarao](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
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.
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.
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).
I am new to salesforce so can some one suggest some way to do this.