How to check/detect any changes in the form data with database record
Application Type
Traditional Web

Hello All,

Currently I am trying to do something with the form. I would like to get/display the existing record from the database in the form and let user to edit/update accordingly. Then, when user resubmit the form, system is able to check/compare WHICH of the fields in the form is edited/updated. Does anyone have any idea/suggestion/demo on how to achieve that?

From what I understand from your question, is that you want to update records, right?

You just need to get the data based on an id when getting on the screen to update that record, then, each input on the form will have the data from the aggregate because there was a filter based on an id.

I will show you! 

To update records, if you are using an entity you can use scaffolding if you don't have a lot of changes from the inputs

If you don't want to scaffold, remember to put the right inputs on the form, and the way you want to update things


You can click here if didn't show the productDetail Screen

Then, you will have a preparation with the aggregate getting the data based on the  'ProductId' in this case and then each input will have one output from the attribute of our entity, we can interpret this as a holder or a structure that holds new and already existed values.

Than you just need to pass the entity record updated.


To see what was updated or not, you can do it, you can go attribute by attribute, on Screen initialize, in this case in the preparation you must put a variable of the type of the entity you want to check., then in the preparation, you need to save the record in that variable.

When saving you can see what was updated or not. Not so hard, but why you want to do this(if this is what you want to do), There is the create and update for some reason.

Regards,

Márcio

@Marcio Carvalho , Hi Marcio

The purpose/reason why I wanted to do check what was updated is because the that is the technical requirements of my application. Do you have any suggestion on that? Maybe which of the approach is easier/more suitable in implementing?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.