So, i was trying to fetch all accounts and display them in next table based on selection. Each selected Account record will have a 'New Contact' button next to it, and user can add a contact and should get associated with the account where he has navigated from. I used two components for Accounts and another one for new Contact popup. But, button click gives me an error as shown in the attachment. Here is two lines of code i have added in first component that was expected to communicate with second component to bring the popup. Any help is greatly appreciated.

showModal : function(cmp, ev) {
        document.getElementById("backGroundSectionId").style.display = "block";
        document.getElementById("newContactSectionId").style.display = "block";

enter image description here

  • document.getElementById this returning null
    – Ratan Paul
    Apr 28 '17 at 5:59
  • If it's returning null then make sure that the elements exist with the Ids you are using in the method(document.getElementById('Id goes here')). Apr 28 '17 at 6:59
  • I have made sure that IDs were referred correctly. I took a different approach as below for now but will try with two different components again after going through documentation thoroughly. sfdcmonkey.com/2017/04/15/… May 1 '17 at 22:02

Your Answer

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

Browse other questions tagged or ask your own question.