Skip to main content
Solved

Event.RowSelected - Determining New vs. Existing row


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.?

Best answer by MoulaliShaik79

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.

View original
Did this topic help you find an answer to your question?

4 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 633 replies
  • June 22, 2022

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • June 22, 2022

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
            }

 


Forum|alt.badge.img+1

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.


  • Author
  • Freshman II
  • 3 replies
  • June 22, 2022

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings