I have a list and a document library (List A and document library B), both opens in dialog.
Document library B has a lookup column targeting list A. On the display form on List A the document webpart from document library B is added (Parent-child relation).
Whenever I drag and drop a file into the document library B webpart, I have a javascript added to the form which ensures the edit/check in form of the document opens in a dialog (on top of the dialog of the item in list A).
Now I need it to auto fill the lookup column with the ID of the item from list A. This works perfectly fine as long as list A does not open in dialog, but i need it to work in dialog as well.
How do I get the ID of the "second dialog" dialog other than the active one?
Edit:
I have tried both window.parent.location and window.top.location both only returns the url from the main page (Eg. list view) which of cause does not contain the ID I'm looking for.