Hi All,
I want to build some auditlogmnessage in general for each screen blocks or popup combined , If user add all new fields first times the message should appera as name: ABC (Added) ,If it contains picklist ex country and if we select India then all picklist option text to be passed ,Ex
Name:ABC
Country:Indial
If It contains List structure ex Country list and based on country tax,
Then it should show Countr:India (Added)
Tax: Tax1 Added
Similary for update case only the modified value ex Country :India->Japan(Modified)
Similary for Removed
I have developed javascript commpn function which accespts newjson,oldjson label,list,Picklist lables and compares and provided output ,but for each use case i need to customise it,as they need proper labels,the picklist selected option text and not the value,
Please suggest if there is common teplate to do this
Hi @Preeti zade ,
I would suggest not relying completely on custom JavaScript for this.
Instead, create a generic Audit Log component using OutSystems Structures and reusable Actions.
You can keep the comparison logic generic and pass the following as configuration:
The generic logic can then handle:
This way, the comparison logic remains the same for all screens, Blocks, and Popups. Only the configuration/metadata changes based on the use case.
I would also recommend returning a List of structured Audit Items rather than directly generating a text message. You can then have a separate reusable Action to format those items into the required audit message.
This will make the solution much easier to maintain and reuse across the application instead of creating/customizing JavaScript for every screen.RegardsDeepa
Hello,
I am passing the same with i have created the generic function client actions which accepts old json newjson
n list structure and returns the audit ,currently it is working but I want to handle this input from each use case ,forming picklisr option text,and all their Json to pass to some local Javascript which will add into list and passing that to generic.
So some customisation I need to do on each screen as the expected test is label value in case of ticklish option text and all.