Microsoft Dynamics CRM 2011 Show Originating Lead Notes After Converting May 1, 2011
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: CRM 2011, crm tips, Dynamics Four, Dynamics4, iframe, jscript, Lead Notes, Microsoft, microsoft crm, Microsoft CRM 4.0
trackback
In a previous post i showed how to display originating leads notes in an iframe after converting. In Microsoft CRM 2011 that code no longer works. Here is the updated code.
function originatingLeadNotes()
{
var Parent = Xrm.Page.data.entity.attributes.get(“originatingleadid”);
var IFrame = Xrm.Page.ui.controls.get(“IFRAME_originatingLeadNotes”);
if (Parent.getValue() != null) {
var GUIDvalue = Parent.getValue()[0].id;
IFrame.setSrc(“/_controls/notes/notesdata.aspx?id=”+ GUIDvalue + ” &ParentEntity=3&EnableInlineEdit=false&EnableInsert=false”);
}
else
{
IFrame.setSrc(“about:blank”);
}
}
Enjoy!
-JC
For more information about Dynamics Four or to contact us please visit http://www.dynamics4.com
Hi Jarrett,
Thanks for the code, i tried this & i am struck some where. The Iframe says “Navigation was cancelled” in one & the other doesn’t display anything. Kindly help.
Thanks,
Surya N
Hi Surya,
Can you reply back with your code and ill take a look.
Regards,
Jarrett
Hi Jarrett,
Please find the code below,
function casenotes()
{
var Parent = Xrm.Page.data.entity.attributes.get(“new_case_investigationid”);
var IFrame = Xrm.Page.ui.controls.get(“IFRAME_case_attachments”);
if (Parent.getValue() != null) {
var GUIDvalue = Parent.getValue()[0].id;
IFrame.setSrc(“/_controls/notes/notesdata.aspx?id=”+ GUIDvalue + ”
&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false”);
}
else
{
IFrame.setSrc(“about:blank”);
}
}
Hi jarrett,
by mistake i added the jscript to the iframe’s event, i have added it to the main form’s onload event now. I get an “object expected” error now.
Where are you getting “amp” from in below?
IFrame.setSrc(“/_controls/notes/notesdata.aspx?id=”+ GUIDvalue + ” &ParentEntity=3&EnableInlineEdit=false&EnableInsert=false”);