Hide sent/received email from the activity log (formatter) based on fields, like caller, assigned to

SamuelTse
Tera Guru

Hi,

I was tasked to create something to control who can see the email in the activity log. Our requirement is to only allow the "caller" and "assigned to", maybe "assignment group" to see the email conversation in the activity log. I realize that we can control this by using the UI properties but I can only use specific roles. Is there a way I can control this by ACL? perhaps setting our requirement on the email table's "read" ACL?

I have not tried that yet. any advise will be greatly appreciated.

Thanks,

Sam

1 ACCEPTED SOLUTION

SamuelTse
Tera Guru

I might have found my own solution. All I did was to create an UI policy on Incident with the following configuration:



Conditions:


Assigned to, is not, javascript:gs.user_id(); AND


caller, is not, javascript:gs.user_id();



Script:


function onCondition() {


$j("[name='z*email*']").html(""))


}



This will remove the entire section of the email of each email sent/received. z*email* is the name of the div tag that contains the body of the email. I am okay to leave the header of the email sent in the activity log. I guess I can hide it if I want to, but I prefer to leave it. I assume you can use this method to fitter out or hide cetain information from the email in the activity log, just do a find and replace in html()



By no mean this is the most elegant solution. It's more of a hack from the client side. If anyone sees anythng problem with this approach or better yet, has a better solution, I am all ears



Thanks



Sam


View solution in original post

12 REPLIES 12

SamuelTse
Tera Guru

I might have found my own solution. All I did was to create an UI policy on Incident with the following configuration:



Conditions:


Assigned to, is not, javascript:gs.user_id(); AND


caller, is not, javascript:gs.user_id();



Script:


function onCondition() {


$j("[name='z*email*']").html(""))


}



This will remove the entire section of the email of each email sent/received. z*email* is the name of the div tag that contains the body of the email. I am okay to leave the header of the email sent in the activity log. I guess I can hide it if I want to, but I prefer to leave it. I assume you can use this method to fitter out or hide cetain information from the email in the activity log, just do a find and replace in html()



By no mean this is the most elegant solution. It's more of a hack from the client side. If anyone sees anythng problem with this approach or better yet, has a better solution, I am all ears



Thanks



Sam


Hi


I think this will be a good solution as the options like ACLs or any other server side code should be run on the Journal table which is not recommended.



The client script is a more effective solution.


Hi Venkat,



Thanks for the reply. when you mentioned "client script is more effective". Do you mean client-side script in general? or you suggested it is better to use Client Script than UI Policy? or actually there is no difference which one I use? is there any performance difference?



Thanks



Sam


Thank you so much. It worked big time for me. (Y)