Thursday, January 26, 2012

Hide Fields in a AxGroup /AxForm in Enterprise portal

There was a requirement to hide/un-hide the fields within AXGroup according to the setup defined in AX form either to show fields or not as per user.

protected void AxFrmEmployee_PreRender(object sender, EventArgs e)
    AxForm frm = this.axFrmEmployee;
    for (int i = 0; i < this.AxGroup1.Fields.Count; i++)
        AxBoundField fld = this.AxGroup1.Fields[i] as AxBoundField;
        if ((fld != null) && (fld.Metadata.Name == "TitleId"))
            fld.Visible = (frm.CurrentMode == DetailsViewMode.ReadOnly) ? false : true;

No comments:

Post a Comment

I will appreciate your comments !

Download large bacpac (sandbox database) to DEV environment much faster

As the LCS website gets slower and slower and the database backups get bigger and bigger.  Use AZCopy to download objects out of LCS asset l...