Skip to main content

Hi,

On event handlers, like for example RowSelected, apart from doing a simple check like if RefNbr equals the defaulting value “<NEW>” or something like that. is there a standard / correct way to check if the row is new or if it’s an existing row being selected for different classes like ARInvoice, ARTran, APInvoice, APTran, Batch, GLTran, etc.?

You have PXCache.GetStatus(row) that shows you whether a record is inserted or updated (or not changed)


Hi @rualdventer64  In addition to Dmitrii's comment, here is the code sample for your reference.

 

Code Sample:

   if (Base.Document.Cache.GetStatus((object)Base.Document.Current) == PXEntryStatus.Inserted)
{
//NEW ROW
}
else
{
//OLD ROW
}

 


Hi @rualdventer64 

 

Could you please use the below line in RowSelected Event Handler.

 bool available = (e.Cache.GetStatus(row) == PXEntryStatus.Inserted);

if the result is “True” means existed record.

please give a trial with a new record also for cross-checking.

Hope this helps you.

 

Thanks,

Moulali Shaik.


Thanks for the examples guys, really appreciate it, I’ll try all of them and give an update.


Reply