- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:21 AM
Hi all,
How to hide the related link based on the condition like if no record present in the related list tab and column in related list records.
we need to check two conditions.
For example,
1.in the above screenshot the outage tab is there in the related list currently there is no record we need to hide the related link PO Question in incident form.
2.If the record is there in the Outage tab we need to check the begin and end column is empty if that is empty, then also we need to hide the related link PO Question in incident form.
can anyone help me on this how we can give these 2 conditions in UI action.
Thanks,
Saranya K
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:51 AM
Hi @Saranya K
call SI in UI action condition using below code
UI action condition=>var Validation().CheckIncident(current.sys_id);
CheckIncident: function(num) {
gs.addInfoMessage("SI calsss");
var answer;
var gr = new GlideRecord('incident');// please glide outage table
gr.addQuery('parent_incident', num);// as per your parent related list field
gr.query();
if (gr.getRowCount == 0) {
gs.addInfoMessage("In iff loop");
answer = true;
}
else if(gr.next()){
var test=gr.description;// your start date field name
var test1=gr.short_description;// your end date field name
if(test == '' && test1==''){
gs.addInfoMessage("In start and end date");
answer=true;
}
}
return answer;
Please try and it will help you. Please mark correct answer if it will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:51 AM
Hi @Saranya K
call SI in UI action condition using below code
UI action condition=>var Validation().CheckIncident(current.sys_id);
CheckIncident: function(num) {
gs.addInfoMessage("SI calsss");
var answer;
var gr = new GlideRecord('incident');// please glide outage table
gr.addQuery('parent_incident', num);// as per your parent related list field
gr.query();
if (gr.getRowCount == 0) {
gs.addInfoMessage("In iff loop");
answer = true;
}
else if(gr.next()){
var test=gr.description;// your start date field name
var test1=gr.short_description;// your end date field name
if(test == '' && test1==''){
gs.addInfoMessage("In start and end date");
answer=true;
}
}
return answer;
Please try and it will help you. Please mark correct answer if it will help you.