query related to ui action

AnithaAnumanthu
Tera Contributor

Hi ,

 

requirements is:

there is related link(ui action ) on incident form, when click related link name is "show only records which have caller id is abel tuter"  should show  only   list of record of caller id and caller id should show on url.

Ex. on incident form caller_id= abel tuter, when you click on that link , show list of  record of abel tuter.

15 REPLIES 15

iam new  to servicenow,  there is Button or related link on incident form , when i click on button redirected list view and show list of records which have  same caller  id  on form.

 

Example. on incident form called id field is abel tuter, when i click button on incident form, redirected to list view of incident whose called id is same. please refer screenshot for better understanding.

AnithaAnumanthu_0-1694632990843.png

 

Hi @AnithaAnumanthu 

 

I still not agree with use case or you did not explain the use case. If you want to see for list of incident for a user it is available in Incident it self.

 

AtulyaG_0-1694687749140.png

 

AtulyaG_1-1694687780196.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

I don't have any use case,Iam learning ui action as I nnew to servicenow,  so  i practicing on platform, i want to  add button on incident form when you click on that link redirect to list view of incident show same caller id records.i hope you got my point.thank you.

Thanks @Anitha ananthul  for your response. I am not in position to say that it is not possible but how , i have no idea. Sorry for this.

 

Also we need to see before we develop, what benefit this feature will give to user or is any alternative for this or not.

 

My experience say we can do alot in SN but we need to think what is best and feasible with less code / script. 

 

@Ankur Bawiskar 

 

Any thoughts on this?

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@AnithaAnumanthu 

So from what I understood, I will list down

1) on incident form you want to have UI action

2) once clicked it will redirect to incident_list i.e. list of incident records where caller_id is same as that of the value present on current form for caller_id

If my above understanding is correct, then this can be achieved using both client side alone or server side alone

Client side

Client checkbox - true

Onclick - openURL()

Script:

function openURL(){
	var query = "caller_id=" + g_form.getValue('caller_id');
	var url = "/incident_list.do?sysparm_query="+ query;
	g_navigation.open(url, '_blank'); // this will open in new tab
	// if you want to open in same then don't give that 2nd parameter
}

AnkurBawiskar_0-1694773212337.png

 

Server side

client checkbox - uncheck

var query = "caller_id=" + current.caller_id;
var url = "/incident_list.do?sysparm_query="+ query;
action.setRedirectURL(url);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader