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 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
Marcelo Ferreira wrote:
Thank you Marcelo for changing the Entities as well the code, which created an error when creating a new product.
Hi
Please try with saving the product value also in your Changes table. And then fetch the values in the edit screen.
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.
Thank you all for taking the time to help me :).
Which error are you getting? because I tested it and I was able to create products with no problem.
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.
Ravi
Ravi Kumar Vakkalanka wrote:
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.
You are missing to assing GetUserId() to ProductForm.Record.ProductVersion.UserId
Thank you very much, Marcelo.