2

VF page is opening as modal in Salesforce lightning experience on an action button click. When I look at the generated code,my code is there in an iframe which the salesforce generated modal contains.

I need to perform the same operation on the cancel button(which is on my vf page) as of the cross icon (of the generated modal). I tried getting the modal element by class name and calling the same click event on cancel button,which is getting called on cross icon.

The problem here is, I am not able to access any element outside the iframe. It throws

'Blocked a frame with origin "https://c.na34.visual.force.com" from accessing a cross-origin frame.'

error. window.parent does not help either. Please provide suggestion to solve this.

Thanks in advance.

0

Please have a look at This example. It'll work for you.

| improve this answer | |
  • put this as comment, if you are allowed to – Santanu Boral Nov 14 '16 at 4:53
  • Just got the allowance at 50. Will do next time. Thanks. – Pasan Eeriyagama Nov 14 '16 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.