26
Views
2
Comments
Solved
Add/Edit data in popup

Hi All

In reactive web application, I need to update my table records using add and edit functions. How can we call same client action for both functions. I am adding/ editing the data in popup.

Rank: #94
Solution

Hello Kavya,

Hope you're doing well.

You may call the same Client Action and receive an ID (Table Identifier) as an Input Parameter.

Then if your ID is equal NullIdentifier(), it means that you're creating/adding a new record to your database.

On the other hand, if your ID is not null, it means that you're updating/editing the record with that ID in the database.

Inside of your client action, you should call a Server Action where you use CreateOrUpdate<Entity> action, in order to create or update your record.


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #170

Hi kavya,

You can use CreateOrUpdateFuncion:

if your id is null, a new record will be created, otherwise it will be edited.

Hope this helps.

Regards.