6 Şubat 2014 Perşembe

CRM 2011- Sub Gridde Seçili Eleman Bilgilerini Custom Sayfaya Yollama

Ben burada subgriddeki secili elemanları alıp custom sayfaya yollama işlemlerini ribbondaki bir butona tıklayınca gerceklestırecegım.Siz baska bir eventte de yapabilirsiniz.

Asagıdaki örnekte, subgridde secılı olan productların Id lerını custom sayfaya yollayıp burada bu secılenlere gore ıslem yapacagız.

Not:Custom sayfaya querystring yoluyla verileri aktaracagız.

CloseAsWonButtonOnClick : Butona tıklandıgında calısacak javascript fonksiyonu.
GetSelectedSubGridRow : Subgridden secili elemanları alan javascript fonksiyonu.
Default.aspx.cs  :Custom aspx sayfamızın kod tarafı

function CloseAsWonButtonOnClick() {
    var userId = Xrm.Page.context.getUserId();
    var entityid = Xrm.Page.data.entity.getId();
    var orgname = Xrm.Page.context.getOrgUniqueName();

    if (userId != null && entityid != null && orgname != null) {
        var url = null;

        var selectedRowsGuidId = GetSelectedSubGridRow('opportunityproductsGrid');
        if (selectedRowsGuidId != null) {
            if (selectedRowsGuidId.length == 0) {
                alert('You must select opportunity product.');
            }
            else{
                var selectedrow = "&selectedrow=" + selectedRowsGuidId.join("&selectedrow=");
                url = "http://deneme:1111/Modules/OpportunityEntity/WinOpportunity/Default.aspx?orgname=" + orgname.toUpperCase() + "&userid=" + userId.toString() + "&entityid=" + entityid.toString() + selectedrow;
            }
            else {
                alert("Only,you can copy one product");
            }

            if (url != null) {
                var features = 'height=500,width=500,left=300,top=150,resizable=yes,titlebar=no,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no, status=no';
                window.open(url, 'OpportunityWonInterface', features);
            }
        }
    }
}

function GetSelectedSubGridRow(subGridName) {
    var array = new Array();
    var grid = document.getElementById(subGridName).control;
    for (var rowNo = 0; rowNo < grid.get_selectedRecords().length; rowNo++) {
        array[rowNo] = grid.get_selectedRecords()[rowNo].Id;
        /*        alert(grid.get_selectedRecords()[rowNo].Id);
        alert(grid.get_selectedRecords()[rowNo].Name);*/
    }

    if (array.length != 0) {
        return array;
    }
    else {
        return new Array();
    }
}


Default.aspx.cs
/**/
protected void Page_Load(object sender, EventArgs e) {
            if (!IsPostBack) {

                string selectedProductsID = Request.QueryString["selectedrow"];
                if (!string.IsNullOrEmpty(selectedProductsID)) {
                            ArrayList array = new ArrayList();
                            for (int indexLog = 0; indexLog < selectedProductsID.Split(',').Length; indexLog++) {
                                string id = selectedProductsID.Split(',')[indexLog];
                                array.Add(new Guid(id));
                            }
                            ViewState["selectrowid"] = array;
                        }
           }
}

Dynamics CRM Asynchronous Processing Service

Windows could not start the Microsoft Dynamics CRM Asynchronous Processing Service service on… (failed while monitoring asynchronous operations queue. Exception: System.NullReferenceException: Object reference not set to an instance of an object)


Hatanın Trace Logu

Hizmetler(Services) altında  Microsoft Asynchronous Processing Service i start ederken yukarıdaki hatayı alıyorsak ,asagıda verecegım ayarlara gore Asynchronous Service ayarlarını güncelleyin.

1.)Servisin özelliklerinden Recovery tabı altındakı ayarları asagıdakı gıbı güncelleyin.
2-)Network System yerine Local System Account seçimini deneyebilirsiniz.