audit track - interface to set the values

audit track - interface to set the values

  

Hi all.

I am creating an audit track and I am duplicating much code. In Java, for instance, I can create an interface and populate values on it for any object I receive as parameter. Is there something similar in OutSystems I can use ?  That way I can check if the register is new and/or set the new data for the replaced register.

Thanks in advance for any comment.

Luke

Hi Luciano,

I'm not sure I understand your question. What's an "audit track" in this context? What do you want to populate? What kind of "register" are you talking about?

Kilian Hekhuis wrote:

Hi Luciano,

I'm not sure I understand your question. What's an "audit track" in this context? What do you want to populate? What kind of "register" are you talking about?


Hi Kilian, how are you ?

I am sorry I was not so clear.   I just want to add the user and date time when some register had been created... like the picture below, but using the same component to add the info in every place I put it.  Today I have a web block that display the info but I don't have a component that writes the info independently of the register.  I will always have the same 4 fields for some tables.

 

Hi Luciano,

I don't know if I understand very well your problem but let me see:

If you create a table were you have that 4 attributes plus the Sprint Identifier, you can create an server action with the Sprint identifier as input variable and inside that action you can create a new audit entry. Then you can use it everytime you want or need.

Then, you can show the data where you want and you are free to use that action where you need.


Or, if you need, take a look at this (maybe this solve your problem): https://www.outsystems.com/forge/component/2124/table-audit-log/?Unfollow=False

You have more forge components in the forge section.


Hope this can help you. 


Best regards,

Ricardo

Hi Luciano,

This is one of the reasons to always use CRUD wrappers to save data to the database (exposing the Entities only read-only). Inside the CRUD wrapper, you set the ModifiedAt/By and CreateAt/By. Of course, this means duplication of code in each CRUD wrapper, but that's better than having to populate these values for each save in your code.

Thank you guys... I will think more about these ideas.