I want to display changes made to a record

I want to display changes made to a record

  

Hi,

I'm a beginner in Outsystems. I want to have a log each time someone makes changes to a record, but it's not displaying correctly.

What am I doing wrong?

I have added the OAP file.


Thank you for your time

Hi

Please try with saving the product value also in your Changes table. And then fetch the values in the edit screen.

Solution

Hi Gambit,

I did some changes in your code and I leave it in attachment. What you want to accomplish should be done with this pattern.

Regards,

Marcelo

Solution

Hi Gambit Play,

If you want to display the previous saved number in the record, then it should have column saving the record of the previous value, as soon as you check there is a change while updating the record, you can save the previous value in a column or log entity based on your requirement.

Thus while updating the record the previous value needs to be updated and can be displayed in the front end using the added column.

Thanks


A discussion about change logs wouldn't be complete without a link to the Human Readable Change History Forge component.

Marcelo Ferreira wrote:

Hi Gambit,

I did some changes in your code and I leave it in attachment. What you want to accomplish should be done with this pattern.

Regards,

Marcelo

Thank you Marcelo for changing the Entities as well the code, which created an error when creating a new product.


Thank you all for taking the time to help me :).

Hi Gambit,

Which error are you getting? because I tested it and I was able to create products with no problem.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Gambit,

Which error are you getting? because I tested it and I was able to create products with no problem.

Regards,

Marcelo

Hi Marcelo,

I was getting error when creating a "Product", but that has been resolved. 

I do have one more question. How do I get the User name to display in the "Last changes"


I have added a OAP file in the attachment. 

Thank you for your time.

Hi Gambit

You should just add the "UserID" foreign key (From Users Table) into the Changes table. 

Thanks

Ravi

Ravi Kumar Vakkalanka wrote:

Hi Gambit

You should just add the "UserID" foreign key (From Users Table) into the Changes table. 

Thanks

Ravi

Hi Ravi,

The "Changes" table has been renamed to "ProductVersion" and as you can see in the oap file I already did add UserId as a foreign key. I tried different things but does not seem to work.


Thanks


Hi,

You are missing to assing GetUserId() to ProductForm.Record.ProductVersion.UserId

Regards,

Marcelo



Marcelo Ferreira wrote:

Hi,

You are missing to assing GetUserId() to ProductForm.Record.ProductVersion.UserId

Regards,

Marcelo



Thank you very much, Marcelo.