I have a DAC called APTran. I want to make sure all my records within this DAC have been inserted.
this is to audit my APTran records against a corresponding POReceiptLine unbilled qty
foreach(APTran apTran in Base.Transactions.Select())
{
// determine the state of apTran (inserted, Deleted)
}
bool isInserted = cache.GetStatus(apTran) == PXEntryStatus.Inserted;
bool isDeleted = cache.GetStatus(apTran) == PXEntryStatus.Deleted;
bool isInsertedDeleted = cache.GetStatus(apTran) == PXEntryStatus.InsertedDeleted;
InsertedDeleted is a special case where the record was inserted in the cache but deleted before it got persisted to database.
I don't know of an official way to check if records were actually inserted in database. What I usually do is check one of the database generated fields value. They will be null until inserted in the database.
bool hasBeenPersisted = apTran.Tstamp != null;