Monday, December 7, 2015

AX 2012 : Change Toolbar webmenu by code

 Change Toolbar webmenu by code  in Enterprise Portal

    protected void AxGridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSetViewRow row;
     
        // Retrieve the current row.
        row = AxDataSource1.GetDataSet().DataSetViews["LoanRequest"].GetCurrent();
     
       // Retrieve the value.
       WorkflowStatus = row.GetFieldValue("WorkFlowStatus").ToString();
        Proxy.Info objInfolog = new Proxy.Info(this.AxSession.AxaptaAdapter);
     
        if (Convert.ToInt32(WorkflowStatus) == 1 || Convert.ToInt32(WorkflowStatus) == 5)
        {
            AxGridView1.AllowDelete = true;
            AxToolBar1.WebMenuName = "LoanRequest";
        }

        else if (Convert.ToInt32(WorkflowStatus) == 2 || Convert.ToInt32(WorkflowStatus) == 3 ||                 Convert.ToInt32(WorkflowStatus) == 4)
        {
            AxGridView1.AllowDelete = false;
            AxToolBar1.WebMenuName = "LoanRequestNotEdit";
        }

        else
        {
            //Do nothing
        }
    }

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8