Wednesday, April 25, 2012

Refresh tab programmatically in CRM 2011 using javascript

In CRM 2011 if you want to refresh a tab in the entity form you have yo use some javascript code.

To do this you have to find the id of the tab. The ids are like: tab0Tab, tab1Tab...in order of appearence in the form.

So what you have to do is to create a javascript file in which to insert the following function:

function changeTab()
{var link=document.getElementById('tab0Tab');
link.onclick=function()
{
window.location.reload(true);
loadArea('areaForm');
crmForm.GetTab($get('tab0', crmForm), true);
}
}

And after that to insert the function on the OnLoad event of the page.

And that's it all. After that when you'll press on the tab you selected in the function the form will be refreshed.

No comments:

Post a Comment