Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parentwindow reference not found #10

Open
luqman27180 opened this issue Jul 22, 2019 · 18 comments
Open

Parentwindow reference not found #10

luqman27180 opened this issue Jul 22, 2019 · 18 comments

Comments

@luqman27180
Copy link

ZOHO.CRM.UI.Record.open({Entity:"Leads",RecordID:"1000000036062"})
.then(function(data){
console.log(data)
})

when i try to call this function getting error can help?

ZSDK.js:314 Uncaught Error: Parentwindow reference not found.
at PostMessage (ZSDK.js:314)
at Object.TriggerEvent (ZSDK.js:222)
at Object.TriggerEvent [as Trigger] (ZSDK.js:464)
at newRequestPromise (ZohoCrmHelper.js:39)
at manipulateUI (ZohoCrmHelper.js:289)
at Object.open (ZohoCrmHelper.js:5154)
at primo.php:18175

@wizznet
Copy link

wizznet commented Apr 1, 2020

don't know if this is still a point but: It depends on the Parent window which is opened under the IFrame. Try not to refresh the Iframe only. Always refresh the whole page.

@adityavyas611
Copy link

Is this issue fixed @luqman27180 ?

@paoramati
Copy link

I don't know how to fix this issue, but I am able to get around it somewhat by bundling by widget and deploying it within Zoho. This is pain because I need to recompile every time I want to test changes, but the code at least runs!

@adityakrgpt01
Copy link

I also have the similar issue.
When i tried to Stop reloading of the page on any event click.
Then it started working.

@curtisblanchette
Copy link

Any updates?

@lisandroRocha
Copy link

bruh

@camcodirect
Copy link

this is crazy? any solution other than to enforce dumping of cache client and server side??!?

@bean-dev
Copy link

bean-dev commented Jun 3, 2022

Has anyone figured a solution to this?

@camcodirect
Copy link

Has anyone figured a solution to this?

This only happened when I tried to manually reload a "Related List" widget iframe. Ass soon as I reload the parent, (f5) that error went away.

Seems to only be happening like this for the Related List widget (in my case, I was using it in a canvas)

@clopezICRSoft
Copy link

Yes, I set a timeout before loading de zoho jsdk api. It seems the problem is the CRM is not initialized when we load the js.

@jtjackson
Copy link

@clopezICRSoft how did you set the timeout before loading the Zoho SDK API? Can you provide an example of this? I'm having the same issue as well here.

@clopezICRSoft
Copy link

The workaround should be:

  function loadWithDelay()
  {
    var tagZohoApi = document.createElement("script");
    tagZohoApi.defer = "defer";
    tagZohoApi.src ='https://live.zwidgets.com/js-sdk/1.1/ZohoEmbededAppSDK.min.js';
    tagZohoApi.onload = function  () {
              // TODO: ADD zoho functions like  ZOHO.embeddedApp.on("PageLoad", function (data) {


            //  Init zoho
           ZOHO.embeddedApp.init();
    }
    console.log("Adding Zoho Library file: " + tagZohoApi.src);
    document.getElementsByTagName("head")[0].appendChild(tagZohoApi);
  }

      // delay to avoid problems in zoho accessing to the api before all the crm is loaded
      setTimeout(loadWithDelay, 2000);

@ne0-cz
Copy link

ne0-cz commented Apr 24, 2023

I had a problem with Error: Parentwindow reference not found. and this comes first in Google search so I'll share my findings and how I fixed it (but I'm not really sure if this explains all occurrences of this). I'm working on a Related List widget and the iframe-only refresh was working fine until I introduced a <button> submitting a <form>. My guess is the default form submission page reload causes the Parentwindow reference to break.

Using preventDefault() on the submit event handler fixed this issue for me and I can iframe-only reload again!

I hope this can at least point you in the right direction of the cause of this problem in your code.

@N00nDay
Copy link

N00nDay commented Feb 8, 2024

I am receiving this error with a simple Button Widget. Just trying to run ZOHO.CRM.UI.Record.populate on Create Lead but this error keeps popping up with no support online. I have tried any recommendation I can find and nothing resolves the issue.

@N00nDay
Copy link

N00nDay commented Feb 8, 2024

After digging into the ZohoEmbededAppSDK.min file my issue appears to be that the uniqueID is undefined. Trying to read through min file is making it difficult to figure out why this is not happening. Anyone have an idea why/when uniqueID should be getting set?

@svelayutham-uma
Copy link

facing same issue , settimeout is hit or miss. will this be ever fixed? the angular login page redirects makes the ZOHO.CRM.UI.Dialer.maximize() break with same error. the dialeractive and dial are working.

seeing this issue open for more than 4 years, i understand ZOHO team is not able to fix this?

@svelayutham-uma
Copy link

Failed to maximize the Dialer Error: Parentwindow reference not found.
at v (ZohoEmbededAppSDK.min.js:17:407)
at c.TriggerEvent (ZohoEmbededAppSDK.min.js:20:9)
at Object.n [as Trigger] (ZohoEmbededAppSDK.min.js:22:257)
at b (ZohoEmbededAppSDK.min.js:1:332)
at g (ZohoEmbededAppSDK.min.js:3:228)
at Object.maximize (ZohoEmbededAppSDK.min.js:11:524)
at dialpad.component.ts:44:55
at Generator.next ()
at asyncGeneratorStep (asyncToGenerator.js:3:1)
at _next (asyncToGenerator.js:22:1)

@svelayutham-uma
Copy link

after a week of digging, i found the issue on my side is because the URL does not contain the "serviceOrigin=https://crm.zoho.com&frameorigin=https://crm.zoho.com"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests