How to check if any field is changed customization?

I have a customization with a tab that has a bunch of fields tied to a UD table. I am looking for a clever way to update a column in the table only if the user actually changes anything.

The purpose of the field is to identify where the row was generated from. It can come from 1 of 2 places (configurator or static lookup table). The purpose of my form is to give the user an opportunity to change programming values manually if necessary. I’d like to update my field to say MANUAL if someone edits any of the fields. Feedback/advice is appreciated.

I would also like to use this field to drive a BPM to update adjacent rows with the same change made on the selected row. So it needs to happen in the context of the customization… probably can’t do it in a BPM. But I’m open to suggestion.

Thanks! Screenshot below illustrates the field I want to update when any of the other fields changed.

You could use a combination of events to determine if it was manually changed.

First, use a KeyPress() event to detect that the keyboard was used in the field. Set a flag to indicate that the control’s value was “touched” via the keyboard.

Then in a ValueChanged() event, check to see if the flag mentioned above was set. If it wasn’t, the change was via something “no-manual”.

edit

You’d need to also detect if the value wasn’t really changed. For example if the Configurator set the field at 1.23, and then you tabbed to that field and type 1.23, it might think it “changed”, when no change was actually made.

Edit #2

There are some other things that could trip you up. Using CTRL+V to paste a value into the field, does trigger the ValueChanged() event, but without a KeyPress(). Might need to use KeyDown() events instead. But those would require filtering out press like SHIFT, TAB, CTRL, etc…

My original strategy was to set the field in the “update” block right before the actual update line… but I realized later that it executed that even when no change was made. So I am still stuck looking at every field and checking for a different value? Ugh. That stinks. I suppose there wouldn’t be a way around that.

Another method would be to make those fields Read Only, and have a checkbox marked “Manual override”. Checking that checkbox makes the fields R/W, and updates the SOURCE field to “Manual”.

Unchecking the box returns the fields to the original values calculated by the Configurator, and sets the SOURCE field appropriately.

I’m trying this. Looking for the proper format to control the field in the epiDataView to be read only… since I know the control itself does nothing if it’s bound to a field. I did find out how to set the columns to read only while initializing the custom code. That part works. Struggling to make it R/W now, though.

This is what I did to set them read only:

		this._edvUD38.dataView.Table.Columns["ShortChar18"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar17"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar16"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar15"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar14"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar13"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar12"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar11"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar10"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar09"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar08"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar07"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar06"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar05"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar04"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar03"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar02"].ExtendedProperties["ReadOnly"] = true;
		this._edvUD38.dataView.Table.Columns["ShortChar01"].ExtendedProperties["ReadOnly"] = true;

This is not working to unset them on my CheckedChanged event:

			this._edvUD38.dataView.Table.Columns["ShortChar18"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar17"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar16"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar15"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar14"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar13"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar12"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar11"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar10"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar09"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar08"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar07"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar06"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar05"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar04"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar03"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar02"].ExtendedProperties["ReadOnly"] = false;
			this._edvUD38.dataView.Table.Columns["ShortChar01"].ExtendedProperties["ReadOnly"] = false;