User Should be added on WatchList Once click on Follow Button

Aakhiil
Tera Expert

Hello All,
We have an requirement, when user opens an VMS form and click on FOLLOW button , then the user should be added to the watchlist of that VMS. 
But we are not able to find the UI action for that Follow button because its OOB.
So I created on Custom button name as "Custom Follow" and written a "On Load" client script for hiding the follow button. Script as below. when I execute the script both "Follow" & I created "Custom Follow" both are getting disappearing. 
Could someone please let me know how can we achieve this functionalities?
Note : VMS table parent table is Task Table


Client Script for hiding the follow button:

function onLoad() {
    var items = $$('BUTTON').each(function(item) {
 
        if (item.innerHTML.indexOf('Follow') > -1) {
            item.hide();
        }
    });
}

 

Aakhiil_0-1721637575306.pngAakhiil_1-1721637785614.png

 


Any help will be appreciated 

Thanks
Aaakhil

1 ACCEPTED SOLUTION

Paul Curwen
Giga Sage

Any Follow activity is added to the live_group_member table. You don't need to alter the Follow script, instead  just create a Business Rule that adds the user to the associated record, the user reference is stored in the stored in the member column. To get the Table it is associated with look at the related record in the live_group_profile table that is stored on that table in the document column. That column is of type Document ID.

 

Like Reference fields, Document ID fields allow the record to reference another record. However, Document ID fields allow you to reference a record on any table, not just a pre-defined one like Reference fields.

 

This means that the data is stored in 2 fields: Table Name & Document (sys_id)

 

Watch this if you are not familiar: https://www.youtube.com/watch?v=FZ_gvKUKFpk

 

 

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

View solution in original post

3 REPLIES 3

Paul Curwen
Giga Sage

Any Follow activity is added to the live_group_member table. You don't need to alter the Follow script, instead  just create a Business Rule that adds the user to the associated record, the user reference is stored in the stored in the member column. To get the Table it is associated with look at the related record in the live_group_profile table that is stored on that table in the document column. That column is of type Document ID.

 

Like Reference fields, Document ID fields allow the record to reference another record. However, Document ID fields allow you to reference a record on any table, not just a pre-defined one like Reference fields.

 

This means that the data is stored in 2 fields: Table Name & Document (sys_id)

 

Watch this if you are not familiar: https://www.youtube.com/watch?v=FZ_gvKUKFpk

 

 

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

Hi @Paul Curwen 

Thank You so much  for your help.

I have created business rule on Live group members table for adding the current logged in user who follows the ticket in to watch list. And I created a notification for them

Appreciated 
Thanks a Lot!!

Aakhiil_0-1722510356399.pngAakhiil_1-1722510399212.png

Business rule on "Live Group members" table 
On After - insert & update
Script as fallows:

Aakhiil_2-1722510516273.png

 

Arun_Manoj
Mega Sage

Hi @Aakhiil ,

 

Inactive the OOB UI action for your table. table_name.config search then u will get the ui action name.

or re-write the script to hide button

function onLoad() {
var buttons = document.querySelectorAll('button');
buttons.forEach(function(button) {
if (button.innerText.includes('Follow') && !button.innerText.includes('Custom Follow')) {
button.style.display = 'none';
}
});
}

 

Thanks

Arun