locked
window.onload is not working? RRS feed

  • Question

  • Below is my script i am calling another function on window.onload. In my scripy "window.onload" function is not working. please advice me if anything wrong.

    function GetQuoteStatus()
    {
    var value="true";
    Xrm.Page.getAttribute("pricingrequest").setValue(value);
    setTimeout(function () {
                    var id = Xrm.Page.data.entity.getId();
           var entityLogicalName = Xrm.Page.data.entity.getEntityName();
           Xrm.Utility.openEntityForm(entityLogicalName, id);
    }, 500);
    window.onload = pricingonload;
    }

    function pricingonload()
    {
    debugger;
    var offerid=Xrm.Page.getAttribute("biz_offerid").getValue();
    var accountid=Xrm.Page.getAttribute("biz_accountid").getValue();
    if(offerid !=null &&accountid!=null)
    {
    var quotevalue=Xrm.Page.getAttribute("new_dfexpressquotestatus").getValue();
    if(quotevalue =="Quote Completed")
    {
    Xrm.Page.ui.tabs.get("PricingInfo").setVisible(true);
    }
    }
    }

     
    Tuesday, November 25, 2014 7:55 AM

Answers

  • Hi,

    Are you getting any errors? Can you post the error.

    Meanwhile try Replacing

    window.onload = pricingonload;

    with

    window.onload = pricingonload();

    And add the pricingonload function above GetQuoteStatus function.

    Thanks,

    Prasad

    Tuesday, November 25, 2014 10:31 AM