Is it possible to create a second Activities formatter?

CharlesR1
Kilo Guru

Hello,

Is it possible to create a second Activities(filtered) formatter that is independent from the Out of Box entry? I have created a new one with a new name on the Incident table, but when I configure activities on this, it also changes the activities shown on the original Global formatter!

We want to have two on the Incident form- one for all the fields, and another for only 4 specific fields.

Thanks,

Charles

1 ACCEPTED SOLUTION

So I got around it by creating a Translated HTML field (u_history) which I made Read Only, then I created a Before Business Rule like the one below:



Condition: current.u_duration_1.changes() || current.u_duration_2.changes() || current.u_decimal.changes() || current.u_time.changes()



Script:


current.u_history = 'Number: '+current.u_decimal + ', Start Time (GMT): ' +current.u_time + ', Duration 1: ' +current.duration_1 + ', Duration 2: ' +current.duration_2 +'<br><br>'+current.u_reoccurrance_history;



Adding '+current.u_reoccurrance_history;' at the end allows the previous content of the History field to be added below the current comment. As such it looks as works the same way as an Activities filter. These fields all get updated at the same time hence why it can be done in the one Business Rule - if we wanted each field to be added to the history individually (i.e. without the others being added too if they had not changed) then they would need to be split out into separate Business rules. It's not perfect, but it's an option that works for us in the absence of a separate Activities formatter.



Thanks all for your help



Charles


View solution in original post

8 REPLIES 8

Slava Savitsky
Giga Sage

Every formatter is based either on a UI macro stored in sys_ui_macro table or on an XML template stored on the server's file system. With the Activity Formatter the latter is the case. You could write your own macro that replicates the behavior of the out-of-box one but that would be quite complex. What is the business problem you are actually trying to solve? There might be an easier way to do it.


Hi Salva,



Thanks for your help. So currently we have the Activities(filtered) section on our Incident form, and this has been set up to show the history of approximately 20 fields. The requirement is for a second Activities or Journal style section to be added in addition to this, but it needs to show the history of only 4 specific fields (two Duration fields, one Date/Time and one Decimal).



Cheers,


Charles


So I got around it by creating a Translated HTML field (u_history) which I made Read Only, then I created a Before Business Rule like the one below:



Condition: current.u_duration_1.changes() || current.u_duration_2.changes() || current.u_decimal.changes() || current.u_time.changes()



Script:


current.u_history = 'Number: '+current.u_decimal + ', Start Time (GMT): ' +current.u_time + ', Duration 1: ' +current.duration_1 + ', Duration 2: ' +current.duration_2 +'<br><br>'+current.u_reoccurrance_history;



Adding '+current.u_reoccurrance_history;' at the end allows the previous content of the History field to be added below the current comment. As such it looks as works the same way as an Activities filter. These fields all get updated at the same time hence why it can be done in the one Business Rule - if we wanted each field to be added to the history individually (i.e. without the others being added too if they had not changed) then they would need to be split out into separate Business rules. It's not perfect, but it's an option that works for us in the absence of a separate Activities formatter.



Thanks all for your help



Charles


Hey Charles,

 

What type is the u_reoccurence_history field you mention in this post?