Create an upload function to update the entity

Create an upload function to update the entity

  

Hi,

I would like to create a upload function to update my entity with excel sheet.

My plan was to delete the data in the entity and then update the entity with the new excel sheet (data).

The update function have to make sure that all the data format are correct and rollback the transaction if there are error.


Thanks

hi, jace

- you can upload the excel

- then use excel to record list

- loop the list

- raise exception if wrong.. it will rollback in the exception handler


regards,

bb

Barong Bali wrote:

hi, jace

- you can upload the excel

- then use excel to record list

- loop the list

- raise exception if wrong.. it will rollback in the exception handler


regards,

bb

ok i will give it a try. It is using screen action?


you create server action and run it from screen action or using timer.

regards,

bb

Jace Jace wrote:

ok i will give it a try. It is using screen action?

Hi Jace,

You can put it in a Screen Action, but that has two downsides:

  1. It may take too long if the Excel file is really big. The browser can then generate a time-out, and you're import is aborted. If that is the case, you need to think about using a timer to do the import.
  2. If the logic to import and save is complex, i.e. there's actual business logic involved (rather than just dump the data in an Entity), it's better to keep that seperated from your screen logic, for better code maintainability (you may even want to put it in a seperate eSpace).