You need to sign in to do that
Don't have an account?
sudarsha
pass variable from custom button(onclickjavascript) to visual force page?
Hai friends,
i created a custom button by onclickjavascript,now i want to pass variable from custom button to visual force with out url append.
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Account)};
if (records[0] == null) {
alert("Please select at least one record ");
}
else{
window.open("/apex/SelectedView"+"?selectedrecords="+records);
}
i did like this but ,is there any other way to pass records variable from custom button to visual force page(not url append) .
i created a custom button by onclickjavascript,now i want to pass variable from custom button to visual force with out url append.
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Account)};
if (records[0] == null) {
alert("Please select at least one record ");
}
else{
window.open("/apex/SelectedView"+"?selectedrecords="+records);
}
i did like this but ,is there any other way to pass records variable from custom button to visual force page(not url append) .
https://developer.salesforce.com/forums/?id=906F0000000AaoMIAS
here this is page "/apex/SelectedView"
But you will have to go through a apex class method. I.e call that method from JS and then from method you can go to VF page.
Thanks,
http://www.forcexplore.com/2014/07/wrapper-class-in-salesforce.html
we can pass ids from onclickjavascript custom button to static method in apex class,by using this here pagereference is not working.