Tech Support > Microsoft Windows > Windows CRM > settimeout
settimeout
Posted by CRM Master on December 20th, 2006


Why does this settimeout fail, it says object expected when the timer runs
out, i've been struggeling alot with this now, please help me out.

It is an onchange event on oppertunity productline that gets data from a
product on an iframe. When it works it should call itself to whether the
condition is true and do some stuff.

function tester(){
alert("test");
}

lookupItem = crmForm.all.productid.DataValue;

if (lookupItem && lookupItem[0] != null)

{

document.all.IFRAME_Produkt.src="http://crm/products/product/edit.aspx?id="
+
lookupItem[0].id;

waitToBLoadedthenChange();

}

function waitToBLoadedthenChange() {
if (lookupItem[0].name.toString() !=
crmForm.all.IFRAME_Produkt.contentWindow.crmForm.a ll.name.DataValue.toString()
)
setTimeout("tester();",3000);
else
crmForm.all.uomid.DataValue =
crmForm.all.IFRAME_Produkt.contentWindow.crmForm.a ll.defaultuomid.DataValue;
}

--------------------------------------------------------------------------------
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 30345 spam-mails
Betalende brugere får ikke denne besked i deres e-mails.
Hent en gratis SPAMfighter her.