Hi all,
Can we hide enum element on dataset.
I want to hide enum element for specific company on EP which is working on dataset.
How can i achieve this.
Thanks and regards
Siddhant Singh
Hi all,
Can we hide enum element on dataset.
I want to hide enum element for specific company on EP which is working on dataset.
How can i achieve this.
Thanks and regards
Siddhant Singh
Hi Siddhant,
As I mentioned before you could try to use the unbound drop-down control (asp:DropDownList) and fill it dynamically with needed elements. The list of elements can be returned from DataSet via method call.
DropDownList1.Items.Add(...
Another option you can try is to create new enum (without short value) and add a new field to the backend table with SaveContent = false and use new enum as type.
On PostLoad you can fill value to the new field from original field and use it in EP in AxDropDownBoundField. On insert\update you can copy value back from new field to original.
Hi Sergei,
The Enum is attached with the AxDropDownBoundField.
Enum has 3 values, Full, half and short.
I have to hide short from this enum.
Can you please tell what may be the code to do so.
Thanks and reagards
Siddhant Singh
Hi Siddhant,
I guess in this case you can create method on DataSet which will return list (or array) of avaiable enum values and you will populate custom combobox control with these value.
Hi Sirgei,
I want to hide value of Enum, based on company check.
Thanks and regards
Siddhant Singh
Hi Siddhant,
Could you, please, clarify do you want to hide element based on enum or you want to hide value in enum?
Hi Sergei,
Below code is there in Web page, and company is also getting in the code.
Can you please tell what line of code can be written to hide the specific Enum element which is in AX.
protected void Page_Load(object sender, EventArgs e) { string comp = Microsoft.Dynamics.Framework.Portal.SessionHelper.Instance.GetSession().SessionInfo.Company; // Sets the form mode based on the managed content enum parameter this.SetupMode(); bool hoursVisibility = (bool)this.dsAbsenceRequestEdit.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("hoursVisibility"); this.grpDescription.Fields[2].Visible = hoursVisibility; this.dsAbsenceRequestEdit.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("checkLeaveBalance"); if(comp != "UK") { HyperLink1.Visible = false; } }
Thanks and regards
Siddhant Singh
Hi Siddhant Singh,
You can utilize ControlHelper.GetCurrentSessionCompany method in WebControl code and based on company hide certain UI elements on the web page (for example Page_Load method can be the place where to write this logic on WebControl)
using Microsoft.Dynamics.Framework.Portal.CommonControls; ... string company = ControlHelper.GetCurrentSessionCompany(AxBaseWebPart.GetWebpart(this).Session);
André Arnaud de Cal...
293,278
Super User 2025 Season 1
Martin Dráb
232,002
Most Valuable Professional
nmaenpaa
101,156
Moderator