omit edit button in can read related list of knowledge base table for all the users except owner

sonalibhaga
Kilo Contributor

omit edit button in can read related list of knowledge base table for all the users except owner (its a field on the knowledge base table) and ownership group (its a field on the knowledge base table) members

1 REPLY 1

G Ponsekar
Mega Guru

Hi @sonalibhaga ,

 

  1. Open any Knowledge Base record.
  2. Go to the Can Read related list.
  3. Right-click the list header and select Configure > List Control.
Create the condition script
Now you will add a script to the Omit edit condition field (if not found in form, configure -> form layout ). This script will evaluate whether to hide the "Edit" button for the current user.
  1. Navigate back to the List Control for the Can Read related list.
  2. In the Omit edit condition field, enter the following script. 
 
javascript
// Check if the user is the owner
var isOwner = gs.getUserID() == parent.owner;

// Check if the user is a member of the ownership group
var isMember = gs.getUser().isMemberOf(parent.ownership_group);

// Return true to omit the button if the user is neither the owner nor a member
if (isOwner || isMember) {
    return false; // Show the button}return true; // Hide the button

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP