The 1:N relationship needs these parameters in the request URL: oId, oType, security, tabSet
The N:N relationship needs an extra parameter: roleOrd in the request URL, which has been involved in the code.
var navId = "nav_new_new_myentity_account";
if(document.getElementById(navId) != null)
{
var tmp = document.getElementById(navId).onclick.toString();
tmp = tmp.substring(tmp.indexOf("'")+1, tmp.indexOf(";"));
var loadArea = tmp.substring(0, tmp.indexOf("'"));
var roleOrd = (tmp.indexOf("roleOrd") == -1) ? -1 : tmp.substring( tmp.indexOf("roleOrd"), tmp.lastIndexOf("'")).replace("\\x3d", "=");
crmForm.all.IFRAME_view.src = (roleOrd == -1) ? GetFrameSrc(loadArea) : GetFrameSrc(loadArea) + "&" + roleOrd;
}
function GetFrameSrc(tabSet)
{
if (crmForm.ObjectId != null)
{
var id = crmForm.ObjectId;
var type = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
var path = document.location.pathname.substring(0, document.location.pathname.indexOf("edit.aspx")) + "areas.aspx?";
return (path + "oId=" + id + "&oType=" + type + "&security=" + security + "&tabSet=" + tabSet);
}
else
{
return "about:blank";
}
}
Enjoy it! ;-)
31 comments:
Hi Jim
Good post - just wondered is there a way to remove the white border that surrounds the view, to make the form look a bit more seamless. Or resize the view to fill the entire IFRAME?
Thanks SB
Hi SB,
After much trial and error I have managed to remove the white border from my associated view. I added the following code to the onLoad() function. Obviously replace 'training_package_notes' with your iFrame name:
//Remove the white border from the iFrame
var frameName = 'IFRAME_training_package_notes';
var objFrame = document.getElementById(frameName);
objFrame.allowTransparency=true;
Hi Leigh
Thanks for your help. I managed to hack and slash a solution for my immediate needs using the following code.
//Hide borders of IFRAMES
var frameName = 'IFRAME_XXX';
var objFrame = document.getElementById(frameName);
var objWindow = document.frames[frameName];
objFrame.allowTransparency=true;
objFrame.onreadystatechange = function ()
{
if (objWindow.document.readyState=='complete')
{
objWindow.document.body.style.backgroundColor='transparent';
if (objWindow.document.getElementsByTagName('BODY')[0]!=null)
{
objWindow.document.getElementsByTagName('BODY')[0].style.padding='0px';
}
if (objWindow.document.getElementsByTagName('TABLE')[0]!=null)
{
objWindow.document.getElementsByTagName('TABLE')[0].cellPadding='0';
objWindow.document.getElementsByTagName('TABLE')[0].style.border='0px';
}
}
}
Thanks SB
Why do you need the additional onreadystatechange stuff?
Hi Leigh
Credit here goes to:
http://crm.atechnisch.nl/2008/01/related-entity-in-iframe/
I'm not sure what the code is doing in its entirety.
Cheers
To Stringer: nice to know it works for you! ;-)
To Leigh and Inderpal: Without using onreadystatechange event, you won't know when the document has been loaded in the iframe, so it's not possible to control the element inside the iframe.
Onclick event is causing an error. What am I supposed to be entering for what the navId equals?
all i changed was navId
Iframe_name.src, id and type
Hi Jim,
I used your coding. But i cannot get the result. the IF loop cannot be executed. What can i do now?
Thanks and Regards,
Venkatesh.S
You maked clear points about online business ideas through your blog and it is very useful to make money from online at home in part time jobs Thanks.
How to create Blog
How to Make Money Online
Affiliate Programs
喝花酒
酒店喝酒
暑假打工
寒假打工
酒店小姐
酒店兼職
禮服店
酒店經紀
酒店兼差
酒店
酒店經紀人
酒店現領
酒店經紀爆米花
酒店經紀
酒店打工
酒店上班
假日打工
台北酒店經紀
酒店pt
酒店pt
酒店應酬
粉味
酒店經紀PRETTY GIRL
酒店經濟
酒店經濟
晚上兼差
Thanks for posting this. My apologies but I am not understanding one thing about the code. Where in your sample do you point to the specific iframe? I'm assuming that somewhere in your code I need to rename the iframe.
Thanks!
艾葳酒店經紀公司提供專業的酒店經紀, 酒店上班小姐,八大行業,酒店兼職,傳播妹,或者想要打工兼差、打工,兼差,八大行業,酒店兼職,想去酒店上班, 日式酒店,制服酒店,ktv酒店,禮服店,整天穿得水水漂漂的,還是想去制服店當日領上班小姐,水水們如果想要擁有打工工作、晚上兼差工作、兼差打工、假日兼職、兼職工作、酒店兼差、兼差、打工兼差、日領工作、晚上兼差工作、酒店工作、酒店上班、酒店打工、兼職、兼差、兼差工作、酒店上班等,想了解酒店相關工作和特種行業內容,想兼職工作日領、假日兼職、兼差打工、或晚班兼職想擁有鋼琴酒吧又有保障的工作嗎???又可以現領請找專業又有保障的艾葳酒店經紀公司!
艾葳酒店經紀是合法的公司工作環境高雅時尚,無業績壓力,無脫秀無喝酒壓力,高層次會員制客源,工作輕鬆,可日領、現領。
一般的酒店經紀只會在水水們第一次上班和領薪水時出現而已,對水水們的上班安全一點保障都沒有!艾葳酒店經紀公司的水水們上班時全程媽咪作陪,不需擔心!只提供最優質的酒店上班,酒店上班,酒店打工環境、上班條件給水水們。心動嗎!? 趕快來填寫你的酒店上班履歷表
水水們妳有缺現領、有兼職、缺錢便服店的煩腦嗎?想到日本留學缺錢嗎?妳是傳播妹??想要擁有高時薪又輕鬆的賺錢,酒店和,假日打工,假日兼職賺錢的機會嗎??想實現夢想卻又缺錢沒錢嗎!??
艾葳酒店台北酒店經紀招兵買馬!!徵專業的酒店打工,想要去酒店的水水,想要短期日領,酒店日領,禮服酒店,制服店,酒店經紀,ktv酒店,便服店,酒店工作,禮服店,酒店小姐,酒店經紀人,
等相關服務 幫您快速的實現您的夢想~!!
Jim,
Can you please tell me how to get the id from the selected row in the grid that is displayed in an Iframe? I got this far:
var frameDoc = document.getElementById("IFRAME_Saw").contentWindow.document;
var a = frameDoc.all['crmGrid'].InnerGrid.SelectedRecords;
var selectedItems = new Array(a.length);
for (var i=0; i < a.length; i++)
{
selectedItems[i] = a[i][0];
}
That gets me the selected item, but I need the guid id of the entity to pass to reporting services
thanks
Hi Jim,
what if i wanna show the associated view of N:1 relationship? is it possible to do it?
Thanks,
DD
Adi, I am having issues with this working, here is what I have? Am I setting the field correctly.
How do I use this for multiple related entities?
var navId = "nav_new_contact_priorityissues";
if(document.getElementById(navId) != null)
{
var tmp = document.getElementById(navId).onclick.toString();
tmp = tmp.substring(tmp.indexOf("'")+1, tmp.indexOf(";"));
var loadArea = tmp.substring(0, tmp.indexOf("'"));
var roleOrd = (tmp.indexOf("roleOrd") == -1) ? -1 : tmp.substring( tmp.indexOf("roleOrd"), tmp.lastIndexOf("'")).replace("\\x3d", "=");
crmForm.all.IFRAME_priorityissues.src = (roleOrd == -1) ? GetFrameSrc(loadArea) : GetFrameSrc(loadArea) + "&" + roleOrd;
}
function GetFrameSrc(tabSet)
{
if (crmForm.ObjectId != null)
{
var id = crmForm.ObjectId;
var type = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
var path = document.location.pathname.substring(0, document.location.pathname.indexOf("edit.aspx")) + "areas.aspx?";
return (path + "oId=" + id + "&oType=" + type + "&security=" + security + "&tabSet=" + tabSet);
}
else
{
return "about:blank";
}
}
Hi Jim,
First off, Great posts! I used your code for the Associated views in an Iframe with great success! (until recently)
Everything was working great for about 99% of our users until about 3 weeks ago. Now every page that has this code running on it, freezes IE for about 20-30 seconds between clicks (sometimes more). The CPU spikes to about 50% while its frozen, nothing shows in a fiddler trace... really odd. Any thoughts? I've tried turning everything I can think of off, with no luck. Will have to look for another alternative if I can't get this corrected soon.
Any assistance would be greatly appreciated! Thanks!
Keith
Hi Jim,
Thank's for the code it works great. However, when I access the parent record using IFD, the iFrame has an error: "Navigation to the webpage was cancelled." Do you know what may be going on?
Hello,
What would be the link (IE Developer Toolbar) identification of the link?
este código é um javascript, você adiciona ele como um recurso web?
thanks
I beleive we are missing "}".
Hi Jim,
I have created a custom entity called 'Stakeholder' which is related to company. I want to show the associated view of stakeholder in a tab on the company form.
I have looked at countless websites but it doesnt see to work, is there a problem with the code I have? or is it not possible with custom entities?
This is the code that doesnt appear to work:
function GetFrameSource(tabSet) {
if (crmForm.ObjectId != null) {
var oId = crmForm.ObjectId;
var oType = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
return "areas.aspx?oId=" + oId + "&oType=" + oType + "&security=" + security + "&tabSet=" + tabSet;
}
else {
return "about:blank";
}
}
crmForm.all.IFRAME_Stakeholder.src = GetFrameSource("areaStakeholder");
If i were to use you code, and do not have the developer toolbar, how else could i find associated link, is that the ID line at the very top?
Keep up the fantastic piece of work, I read few blog posts on this web site and I believe that your site is real interesting and has lots of great information. ERP Software in Mumbai || System Software || CRM Software in Mumbai || MLM Software
I really appreciate spending some time to talk about that, I believe firmly regarding this and so really enjoy understanding more about this kind of subject.This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this. CRM Software || MLM Software in Mumbai || ERP Software || System Software in Mumbai
dich vu ke toan dích vu lam bao cao tai chinh tín
khóa học kế toán thực hành re
công ty dịch vụ kế toán
dich vu ke toan thue tai bac ninh
dịch vụ kế toán trọn gói tại hà nội
dịch vụ kế toán tại tp.hcm
dịch vụ báo cáo thuế
dịch vụ quyết toán thuế uy
trung tâm đào tạo kế toán tại tphcm
trung tâm đào tạo kế toán tại cầu giấy tín
trung tâm đào tạo kế toán tại long biên
trung tâm đào tạo kế toán tại hà đông re
trung tâm kế toán tại thanh xuân
trung tâm kế toán tại bắc ninh
trung tâm kế toán tại bình dương
trung tâm kế toán tại hải phòng
dịch vụ quyết toán thuế tại quận bình thạnh
dịch vụ quyết toán thuế tại quận tân phú
dịch vụ quyết toán thuế tại quận 5
dịch vụ quyết toán thuế tại quận 3
dịch vụ quyết toán thuế tại tphcm
dịch vụ quyết toán thuế tại quận cầu giấy
dịch vụ quyết toán thuế tại quận long biên
dịch vụ quyết toán thuế tại quận hà đông
dịch vụ quyết toán thuế tại quận thanh xuân
dịch vụ làm báo cáo tài chính tại huyện củ chi
dịch vụ làm báo cáo tài chính tại quận bình tân
dịch vụ làm báo cáo tài chính tại quân phú nhuận
dịch vụ làm báo cáo tài chính tại quận gò vấp
dịch vụ làm báo cáo tài chính tại quận thủ đức
dịch vụ làm báo cáo tài chính tại quận bình thạnh
dịch vụ làm báo cáo tài chính tại quận tân phú
dịch vụ làm báo cáo tài chính tại quận 12
dịch vụ làm báo cáo tài chính tại quận 11
dịch vụ làm báo cáo tài chính tại quận 10
dịch vụ làm báo cáo tài chính tại quận 9
dịch vụ làm báo cáo tài chính tại quận 8
dịch vụ làm báo cáo tài chính tại quận 7
dịch vụ làm báo cáo tài chính tại quận 6
dịch vụ làm báo cáo tài chính tại quận 5
dịch vụ làm báo cáo tài chính tại quận 4
dịch vụ làm báo cáo tài chính tại quận 3
dịch vụ làm báo cáo tài chính tại quận 2
dịch vụ làm báo cáo tài chính tại quận 1
hướng dẫn sử dụng hàm vlookup
thủ tục hoàn thuế thu nhập cá nhân
chi phí không được khấu trừ khi tính thuế tndn
chi phí không được khấu trừ khi tính thuế tndn
một số lỗi liên quan đến phần mềm htkk
cách kê khai bổ sung thế gtgt
cách lập bảng cân đối kế toán
cách lập báo cáo kết quả hoạt động kinh doanh
cách tính thuế gtgt theo phương pháp khấu trừ
xử lý hóa đơn sai
cách viết hóa đơn gtgt khi bán hàng
xử lý khi viết sai hóa đơn gtgt
lập tờ khai thuế gtgt mẫu 01
cách kê khai thuế gtgt theo tháng quý
cách tính thuế gtgt theo phương pháp trực tiếp
câu hỏi thường gặp về hóa đơn chứng từ
kê khai thuế tndn tạm tính quý
cách tính thuế gtgtg mới nhất
cách lập tờ khai thuế gtgt trên doanh thu 04
cách lập tờ khai thuế tndn 01b
ghi sổ kế toán theo hình thức nhật ký chung
xử lý khi phát hiện thừa thiếu hàng hóa
cách lập tờ khai thuế tndn 01a
xử lý khi phát hiện thừa thiếu hàng hóa
thông tư 200
địa chỉ học kế toán
khóa học kế toán dành cho giám đốc
dịch vụ thành lập doanh nghiệp công ty trọn gói giá rẻ
trung tâm đào tạo kế toán tại hải dương
trung tâm đào tạo kế toán tại biên hòa đồng nai
lớp học kế toán tại biên hòa đồng nai
trung tâm đào tạo kế toán tại vinh nghệ an
trung tâm đào tạo kế toán tại quận 9
trung tâm đào tạo kế toán tại vĩnh phúc
trung tâm đào tạo kế toán tại hưng yên
trung tâm đào tạo kế toán tại phú thọ
trung tâm đào tạo kế toán tại bà rịa vũng tàu
trung tâm đào tạo kế toán tại quận 3 tphcm>trung tâm đào tạo kế toán tại quận 3
trung tâm đào tạo kế toán tại đà nẵng
trung tâm đào tạo kế toán tại huế
lớp học kế toán tổng hợp tại đà nẵng
lớp học kế toán tổng hợp tại huế
trung tâm đào tạo kế toán tại vinh nghệ an
trung tâm đào tạo kế toán tại đà nẵng
trung tâm đào tạo kế toán tại bà rịa vũng tàu
trung tâm đào tạo kế toán tại huế
khóa học kế toán dành cho người mới bắt đầu
khóa học kế toán dành cho người đã học kế toán
học kế toán thực hành cấp tốc
học kế toán thực hành cấp tốc
học kế toán thực hành tại cầu giấy
học kế toán thực hành tại thanh xuân
]học kế toán thực hành tại hà đông
học kế toán thực hành tại long biên
học kế toán thực hành tại long biên
học kế toán thực hành tại hải phòng
học kế toán thực hành tại bắc ninh
học kế toán thực hành tại tphcm
học kế toán thực hành tại quận 3
học kế toán thực hành tại hải phòng
học kế toán thực hành tại bắc ninh
học kế toán thực hành tại bình dương
học kế toán thực hành tại biên hòa
học kế toán thực hành tại vinh
học kế toán thực hành tại vinh
học kế toán thực hành tại huế
học kế toán thực hành tại đà nẵng
học kế toán thực hành tại đà nẵng
học kế toán thực hành tại đà nẵng
học kế toán thực hành tại hải dương
học kế toán thực hành tại hưng yên
học chứng chỉ kế toán
học kế toán ở đâu tốt
Dịch vụ kế toán ACB chuyên cung cấp dich vu ke toan trọn gói uy tín chuyên nghiêp giá rẻ nhất tại HCM và các tỉnh lân cận với chi phí bỏ ra chỉ từ 500.000-1.500.000đ.
Tri ân khách hàng, ACB giảm giá lên đến 50% giá trị hợp đồng khi doanh nghiệp trở thành đối tác của chúng tôi.
Liên hệ: Dịch vụ kế toán , Dich vu ke toan .
Lầu 4, Tòa nhà Long Mã, 602 Cộng Hòa,P.13,Q.Tân Bình,HCM.
Hotline: (08) 62 97 97 97 - 0966 660 888.
Post a Comment