Changes to UD field do not prompt to save, when changed via customization

I added a filed to the OrderDtl table via UD extended table maintenance, and added it to the Order Entry form.

If I manually change the field’s contents and try to close the Order Entry screen, I get prompted to save changes.

But when the field is updated by a button press on the form (via a customization), there is no prompt to save the changes. And the changes are not saved. Just leaving the record and coming back to it reloads the fields with the prior values.

If I directly edit the field after the button press updates the fields, I get the prompt to save.

Something special need to happen to get the system to realize the field is “dirty” ?

HOw are you doing it? You should be using the EpiDataView in code and notifying the adapter.

I was just setting the control’s value.

Guess I’ll have to start doing things the right way.

Yeah setting the control values is a big no no. Always always use the EpiDataViews or the Adapters. That way it will ensure that all the Epicor logic is triggered.

1 Like

This should work for what you are attempting to do:

string value = "test Value";
EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));
System.Data.DataRow edvOrderDtlRow = edvOrderDtl.CurrentDataRow;
if (edvOrderDtlRow != null)
{
  edvOrderDtlRow["YourUDField_c"] = value;
}

//you can use an oTrans.Update(); if you want this code to update the new value right away or if you want to save it wht the normal save button that is gonna be depending on the needs you have.

If you want some further help with this you can contact me at my email

Daniel Montemayor
E: dmontemayor@mayantechs.com
Software Developer.

1 Like

Daniel,
Let’s keep the conversation within the forum, so that everyone can benefit.
Thank you

3 Likes