Hi
I have run into the following problem and would like some suggestions. We have an application with Invoices and InvoiceItems (a one to many relationship). On save of the Invoice our system sends out an automated email to the recipient with the invoice attached. That works perfectly. The problem we have though is two-fold:
- Upon saving a child item in non-inline edit, it forces a save in the invoice object as well which triggers the sending of the mail (a big problem as the recipient now receives a mail for each item as it is being entered)
- To solve this problem we switched to inline edit mode which works as expected. The invoice object is only saved on saving of the invoice, not the child records. The problem is that the New button still appears to allow the user to create a new record in detail view. I have hidden the edit button which was simple enough with the following code in a ViewController
if (View is ListView && View.ObjectTypeInfo.Type == typeof(InvoiceItem))
{
Frame.GetController<DevExpress.ExpressApp.Web.SystemModule.ListViewController>().EditAction.Active.SetItemValue("myReason", false);
}
But there is no way to hide the New button in the same manner because it hides the inline new as well.
So now my questions
- Is there now a better way to accomplish the hiding of the New button than in the very old post Q2781232) Is the better solution perhaps to try stop the child record forcing a save on the parent record in detail view? If so how would one do that?