You need to sign in to do that
Don't have an account?

Javascript to call vf page on button click
Hi,
I amcalling vf page on button click through onclickjavascipt for this i am using below scipt
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var x;
if (confirm("If Industry Analysis Records Already Exist Press Cancel If Not Press OK") == true) {
x = "OK";
} else {
x = "Cancel";
}
if(x == 'OK'){
window.location='/apex/Industry_Analysis?id={!Activities__c.Id}';
}
My requirement is whether there is related list record is exist or not ,if not call the vf page . if related records exist there shoud show message like record already exist.
can any one help me out for this,
Regards,
Sarvesh.
I amcalling vf page on button click through onclickjavascipt for this i am using below scipt
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var x;
if (confirm("If Industry Analysis Records Already Exist Press Cancel If Not Press OK") == true) {
x = "OK";
} else {
x = "Cancel";
}
if(x == 'OK'){
window.location='/apex/Industry_Analysis?id={!Activities__c.Id}';
}
My requirement is whether there is related list record is exist or not ,if not call the vf page . if related records exist there shoud show message like record already exist.
can any one help me out for this,
Regards,
Sarvesh.
hope this is what you were expecting.
Thanks
D Naveen Rahul.
All Answers
what i ahve posted that one is working fine but my requirement is whethere is related record are exist or not like
var x;
if ({!Industry_Analysis__c.Id}!= true) {
x = "OK";
} else {
x = "Cancel";
}
if(x == 'OK'){
window.location='/apex/Industry_Analysis?id={!Activities__c.Id}';
But the above one showing error..
regards,
sarvesh.
hope this is what you were expecting.
Thanks
D Naveen Rahul.
yes this apoach is good i will try...