Skip to main content
Solved

Event Handlers dont fire when using load records from File


Forum|alt.badge.img

Most screens with grids have an option to import from an excel file.  Specifically I am talking about the SO entry screen below 

I have a customization where I customized and added an event handler on this screen and it fires fine when users are entering data in the grid.  But when they load records form file, it doesn’t handle.  Never fires the event from what I can tell.  I stripped it bare to see if the code was having an issue, but even the simplist code never fires as below:  

protected void SOLine_RowUpdating(PXCache cache, PXRowUpdatingEventArgs e)
{

    var row = (SOLine)e.NewRow;

}

But the same event fires when modifying the data in the screen. 

Any thoughts? 

 

Best answer by andriitkachenko

@edwardmcgovern53 If you load from Excel using standard Acumatica feature, you can control the process if you implement IPXPrepareItems interface. The methods provided by the interface allow you to change mapping, validate records, etc. In your case - you can also fire you additional logic from them.

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

6 replies

Yuriy Zaletskyy
Jr Varsity I
Forum|alt.badge.img+3

The PXRowUpdating event might not be the right place for import scenarios. Try using the PXRowPersisting or PXRowPersisted events instead. These events are more reliable for handling data during batch operations like imports.


Forum|alt.badge.img

Its not about reliability, Its just not calling them, ever lol.  I didn’t try rowpersisting/persisted.  I’ll give it a try.  Thanks


Forum|alt.badge.img

RowPersisting and Persisted are not firing either

Row level seem not to be firing.  

Field level are.  I tried verifying and others. 

 


Forum|alt.badge.img

When using screen entry  both the insert and the update events would fire when adding a new record.  I did the validation in the update event on the row because I was assured to have the data there I was looking for. in the insert it wasn’t there but alway in the subsequent update it was there.   This is SOLine and the inventoryid btw. 

But when importing all fields are set at the same time.  Only the insert is called.  There is no update.   Its just depending on how data is going in (data entry, or import process like populate from file) affects the events called. 

I just need to cover both updates and inserts so that imports and screen mods are covered.  Thanks for the input Yurly. 


andriitkachenko
Jr Varsity I
Forum|alt.badge.img+5

@edwardmcgovern53 If you load from Excel using standard Acumatica feature, you can control the process if you implement IPXPrepareItems interface. The methods provided by the interface allow you to change mapping, validate records, etc. In your case - you can also fire you additional logic from them.


Forum|alt.badge.img

I did not know that.  It would be nice to handle the problem instead of adding new event handlers.  I will check that out 


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