I am trying create a customization that will either be a tracker or an entry screen based on the Security Group. I feel like I am battling the system on controlling the ReadOnly property. I set the ReaOnly property in the load function, but the controls still are getting enabled (or ReadOnly = false) .
Do you think that I need to unbind the objects and place a set function on the AfterAdapter method for GetById or GetNew?
Have you considered using a customization wizard to set the extended properties of the data-view to be read-only? That’s the cleanest way to work with native properties, in my opinion. If a control is tied to a bound data view column, it will make that control read only.
Yes, that makes sense. The wizard does the exact same thing but calls the method in the InitializeCustomCode method, and again goes after the dataview not the control itself…
So in working on my next issue in trying to gain control of the Enable/Disable properties of all the controls (TextBoxes, DateTimeEditor, NumericEditor, epiCombo, and UltraGrids), I found out that:
don’t use the Enabled property
for TextBoxes, you can use the wizard to alter the ExtendedProperty of ReadOnly
for ComboBoxes, DateTimeEditor,and grids, I edited the “IsEpiReadOnly” property on the control itself.
Does anyone see any issue of me doing it this way?
@josecgomez, you have me very curious. Yes, I am trying to set the entire form to read only. Are you suggesting that there maybe a way to just set the form to ReadOnly and not each individual control?
Ok @josecgomez@danbedwards and everyone else that thought it, yes that is pie in my face. I am working on a whole new process in Epicor and thinking about everything, I set myself down a path forgetting to backup every once in a while to re-evaluate what the heck am I doing and is this the right way to do it.
A simple line of UD100Form.IsEpiReadOnly = true; in the Load method replaced 100 lines of code, in the SetExtendedProperties() method, that set the ReadOnly extended property of each DataField to UD100 and UD100A AND the ComboBoxes and DateTimeEditors that the extended property didn’t impact.
I know this got long quick, so thank you guys. Maybe I should just talk out loud in the forum more often.