+ Start a Discussion
nagalakshminagalakshmi 

How to display the alert box when click on button of detail page section

Hi,

 

I have two object names as emp and emp1. In emp i have a loop up with emp1. I am created a visual force page with button and i am placing that visual force page in detail page section of emp object. If i click on the button,The new record is created in emp1 object when the look up of emp is null. If the lookup field is not null want to update the record of emp1. This is worked fine for me. Now My Requirement is displayed thepop up with 'Yes' and Cancel Buttons. I we click on the Yes want to update Other wise not. It is worked fine for me when i am run the vf page individually. But in the detail page section the pop up is not displayed when the button click.Please help me. How to solve this.

 

 

Thanks,

Lakshmi

magandrezmagandrez

Hi,

 

Did you try to do this with Javascript?

 

Greetings,

 

MGA.

nagalakshminagalakshmi

Hi MGA,

 

Yes i am tried with javascript. It is worked perfectly when i am run the page indivisually. But i am placing the vf page in a section of pagelayout. I want to display the pop up on detail page. Please help me.

 

I am using the tag as onclick="window.parent.location.href='/apex/FsvStub_popup?id='+storeid;"

 

 

Thanks,

Lakshmi.

magandrezmagandrez

Hi,

 

I cannot understand your requirements pretty well, but try with this:

 

http://www.w3schools.com/jsref/met_win_confirm.asp

 

Greetings,

 

MGA.

shravanshravan

Hi, I am not shure about u r requirement but try this for alert in javascript in customize--->Home-->Home page components.

 

<?xml:namespace prefix = html /><html:hidden value="USERNAME" property="username"></html:hidden>
<SCRIPT>
var v = window.location+'';
alert(v);
if(v.search("OppSharingEdit")>=0)
{
 window.onload = func;
}
if(v.search("AccSharingEdit")>=0)
{
 window.onload = func;
}

function func()
{
  var node = document.getElementById('sharing_search');
 //node.options[3].selected = true;
 while(node.options.length>1)
 {
   if(node.options[0].text!='Users')
     node.removeChild(node.options[0]);
 }

 if (this.bodyOnLoad)
   bodyOnLoad();
}
</SCRIPT>

 

 

 

for Current URL

VinuVinu

Hi,

This may help you,

 

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" OnClick="show_alert()" />
</apex:pageBlockButtons>

 

<script> 
function show_alert()
{
var msg = "The Record's will get Changed? ";
alert(msg);
}
</script>