Search code examples
erpacumatica

Why DAC class is not saved in Acumatica?


Let's say I have following code:

DacClass cl = new DacClass();
//init fields of DacClass()
this.Persist();

but when I run this code in any graph, I'm getting different errors. Why?


Solution

  • You can't create DAC item in db in current graph. As mentioned in T200 manual you should create instance of graph and in created instance to call method persist. Another option is to use method PXDataBase.Insert. The first option is preferable for case if you need insertion with graph logic. The second option is preferable for cases if you need perfomance.