Hi guys,
I'm facing a situation where the form automatically scrolls to a iframe that i recently set on the form.
The iframe is displaying share point documents connected to that record. Bellow is the code i used to set the correct URL for the iFrame.
function SetDocumentFrame() { //You can see what the url should be by navigating to the 'Documents' area under related records, viewing the page soure //and looking for 'areaSPDocuments'. The formid appears to be nothing more than a random guid value and not tied to anything //specific in your org. //Use: Make sure Document Management is enabled for the entity (helps to turn on automatic folder creation) // Add a web resource with this code to the form // Execute this function during the form's OnLoad event var url = Xrm.Page.context.getClientUrl() + "/userdefined/areas.aspx?formid=ab44efca-df12-432e-a74a-83de61c3f3e9&inlineEdit=1&navItemName=Documents&oId=%7b" + Xrm.Page.data.entity.getId().replace("{", "").replace("}", "") + "%7d&oType=" + Xrm.Page.context.getQueryStringParameters().etc + "&pagemode=iframe&rof=true&security=852023&tabSet=areaSPDocuments&theme=Outlook15White"; debugger; Xrm.Page.getControl("IFRAME_Documents").setSrc(url); //Replace IFRAME_??? with actual IFRAME name
The code comes from Jason Lattimer's blog and works perfectly but for some reason it makes the form scroll to the iframe.
Any suggestions?
*This post is locked for comments