I have a customization I am working on in the SalesOrderForm…In that customization I have a FKV from OrderHed to Customer so that I can pull a UD value from there. That part works great.
In my code, I have a handler in place for edvCustomer.EpiViewNotification. In that process, I am setting a value of a UD in edvOrderhed based on a value from a UD in edvCustomer.
But, when the oTrans.Update() is called, it asks the user if they want to save their changes. I did some digging, and read that if it is done like this:
Dim myVar As Boolean = oTrans.Update()
that it would suppress that confirmation prompt. But, when I tried it that way, it still appears.
Is there anyway to save the changes made to edvOrderHed without it prompting the user?
Here is the full code:.
Private Sub edvCustomer_EpiViewNotification(ByVal view As EpiDataView, ByVal args As EpiNotifyArgs)
If (args.Row > -1) Then
Try
Dim edvOrderHedRow As System.Data.DataRow = edvOrderHed.CurrentDataRow
Dim edvCustomerRow As System.Data.DataRow = edvCustomer.CurrentDataRow
If (Not (edvCustomer) Is Nothing) Then
If edvCustomer.DataView(edvCustomer.Row)("SingleHeatLot_c") = True Then
edvOrderHed.DataView(edvOrderHed.Row).BeginEdit()
edvOrderHed.DataView(edvOrderHed.Row)("SingleHeatLot_c") = True
edvOrderHed.DataView(edvOrderHed.Row).EndEdit()
End If
Dim myvar as Boolean = oTrans.Update()
oTrans.Refresh()
End If
Catch ex As Exception
MsgBox(ex.message)
End Try
End If
End Sub
I know this thread is old. However, I found it because I encountered the same issue and there was no solution provided. I thought I’d post my solution here in case anyone else is looking for a way to suppress the confirmation.
This is controlled by seven boolean flags in the FormOptions. You can temporarily override all of them or just override the one specific for your situation. I use the OrderForm below but the same concept should apply for all forms. These are the same flags that get set when you check the box in the confirmation dialog to suppress future confirmation dialogs.
bool confirmUpdateOnFormClose, confirmUpdateOnInvokeSearch, confirmUpdateOnNewButton, confirmUpdateOnPrimaryKey
, confirmUpdateOnRowChange, confirmUpdateOnSaveAndNew, confirmUpdateOnSaveButton;
// Retain the existing confirm options for updates
confirmUpdateOnFormClose = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnFormClose;
confirmUpdateOnInvokeSearch = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnInvokeSearch;
confirmUpdateOnNewButton = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnNewButton;
confirmUpdateOnPrimaryKey = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnPrimaryKey;
confirmUpdateOnRowChange = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnRowChange;
confirmUpdateOnSaveAndNew = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnSaveAndNew;
confirmUpdateOnSaveButton = this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnSaveButton;
// Override current confirm options for updates. This is done to suppress the confirmation dialog on save (oTrans.Update).
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnFormClose = false;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnInvokeSearch = false;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnNewButton = false;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnPrimaryKey = false;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnRowChange = false;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnSaveAndNew = false;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnSaveButton = false;
oTrans.Update();
oTrans.Refresh();
// Reset current confirm options for updates to original
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnFormClose = confirmUpdateOnFormClose;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnInvokeSearch = confirmUpdateOnInvokeSearch;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnNewButton = confirmUpdateOnNewButton;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnPrimaryKey = confirmUpdateOnPrimaryKey;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnRowChange = confirmUpdateOnRowChange;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnSaveAndNew = confirmUpdateOnSaveAndNew;
this.oTrans.OrderForm.CurrentFormOptions.ConfirmOptions.ConfirmUpdateOnSaveButton = confirmUpdateOnSaveButton;
When a user performs certain actions, several confirmation dialog windows may appear. For example, if a user attempts to clear a form that has unsaved changes, the user is prompted to either save these changes or clear them.
Because users can personalize each UI file, they only need to use confirmation dialog windows for the specific events they want. The ICE framework offers this functionality when you tell the derived EpiTransaction the purpose for the current event.
You do this by first calling the SetTransactionEvent and then specifying one of the TransactionEvent enumeration values. The framework evaluates the current confirmation settings for the TransactionEvent and determines if a confirmation window is necessary.
in front of my action, it seems to suppress the save dialog. (like I want). But do I have to worry about putting something back after this? Or does this only apply to the next action that happens?