Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
There is a list type field named 'Reviewers' on Policy records.
On the list view of Policies, we want to highlight with field styles, where any of the user listed under Reviewers is inactive.
In the screenshot attached below, Daniel Zill is inactive user, and if he is present in Reviewers, the respective column value is applied with defined field styles.
<img width="809" height="370" alt="image" src="https://github.com/user-attachments/assets/b483207e-f3ba-4db7-a717-d392694eaf50" />
<img width="433" height="107" alt="image" src="https://github.com/user-attachments/assets/5129038f-d210-40f4-bcd8-1727d791edca" />

The condition to check if any inactive user is present in Reviewers must be written on 'Value' (actual Server script) and the styles to applied must be mentioned on 'Style'.
Refer below screenshot:
<img width="911" height="239" alt="image" src="https://github.com/user-attachments/assets/477e52cb-bdad-439d-a1cc-5b6be0415c20" />

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//The below code followed by "javascript:", inside 'Value' field for the List type Reviewers field's Style record will do the condition check.
var answer = false;
var arr=[];
arr = current.reviewers.split(',');
for(i=0; i<arr.length; i++){
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',arr[i]);
gr.query();
if(gr.next()){
if(gr.active == false){
answer = true;
}
}
}
answer;

//The Style field then must be populated with the style we want to apply. I have applied "background-color: blue;" "text-decoration:line-through;"
background-color: blue;
text-decoration:line-through;
Loading