var lookupItem = new Array; lookupItem = crmForm.originatingleadid.DataValue; if (lookupItem != null) { crmForm.all.IFRAME_LeadNotes.src="/_controls/notes/notesdata.aspx?id="+ lookupItem[0].id + "&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false"; } else { crmForm.all.IFRAME_LeadNotes.src="about:blank"; }