Friday, May 9, 2014

Refresh the form automatically in MS CRM

Recently I faced a scenario where the page should load automatically I,e once the record has been created internally workflow will trigger [to update the telephone number in account] which will update the created record fields for this use the below code on onload 

function Refresh()
{
var type = Xrm.Page.ui.getFormType();
if(type==2)//form opened for update
{
var x=Xrm.Page.getAttribute("telephone1").getValue();
if(x==""||x==null)
{
setTimeout("doTimer()", 8000);//for 8 seconds
}
}
}

function doTimer()
{
window.location.reload(true);

}

No comments:

Post a Comment