bool isInserted = cache.GetStatus(apTran) == PXEntryStatus.Inserted;
bool isDeleted = cache.GetStatus(apTran) == PXEntryStatus.Deleted;
bool isInsertedDeleted = cache.GetStatus(apTran) == PXEntryStatus.InsertedDeleted;
InsertedDeleted是一种特殊情况,其中记录已插入高速缓存中,但在记录持久化到数据库之前被删除。
我不知道检查记录是否实际插入数据库的正式方法。我通常要做的是检查数据库生成的字段值之一。在插入数据库之前,它们将为null。
bool hasBeenPersisted = apTran.Tstamp != null;