Hello,
Excuse me I have the "Enterprise Subscription" eXpressApp Framewrok am testing, but I doubt the following:
I am creating an order, and after save, wanted register some information in another table. I tried the following:
public class Order: BaseObject
{
…
protected override void OnSaved ()
{
base.OnSaved ();
Release lan = new Release (this.Session);
lan.BaixaDate = DateTime.Now;
lan.PayRec = TypeLancamento.Receive;
lan.Status = StatusLancamento.Baixado;
lan.Save ();
}
…
}
But without success.
Can you help?
Thanks.
Hi Lucas,
The OnSaved method is called after an object is saved and changes are committed to the database. To save changes made to objects in this method, someone should commit the transaction again. So, there is no bug here. I recommend that you move you code to the OnSaving method that is called just before an object is saved, so your changes are saved in the same transaction.
Thanks,
Michael.
Hi Michael,
I'm having the same problem:
Q294844
How you solved this problem?
Thanks.
Hi Lucas,
According to the customer's response, an issue described in ticket Q294844 was caused by a mistake in his controller code, but not in the framework itself. I do not know what the exact mistake was, as he did not provide details.
I am afraid I cannot determine why you have a similar issue without reviewing your project. Please provide us with a small sample project, demonstrating your issue.
Thanks,
Michael.
Resolved.
I used the excerpt below.
if (!(Session is NestedUnitOfWork) && Session.IsNewObject(this))
{}
Thanks.
Resolved.
Hi Lucas,
I am glad to hear that your issue is now resolved. Thank you for informing us of that.
Thanks,
Michael.