gs.getSession().getStack().top().indexOf('parameter')>0

Ashish Kumar Ag
Kilo Guru

What is the function of gs.getSession().getStack().top().indexOf('parameter')>0.

4 REPLIES 4

Deepak Ingale1
Mega Sage

gs.getSession().getStack().top() will give the URL portion. (like home.do or navpage.do or incident.do?sysparm_query == ....) etc.


This is a condition in BR gs.getSession().getStack().top().indexOf('sysparm_query'). So it will check whether URL has sysparm_query. This is working fine in Base instance. But in CMS its throwing an error skipping business rule.


May be because of iframe when its checking the URL in CMS not getting sysparm_query.


Any idea why its throwing an error message.


Hi Ashish,


Even I sense that may be due to iFrame. But even I don't know exact reason for it.


Deepak Ingale1
Mega Sage

Hi Ashish,


Did this answer your question or you have any other followup question as well


.indexOf('string') will search for 'string' in the url portion and will return its position in whole URL whether it is at 10th position or 11th or so...


> 0 will check if URL contains 'string', if yes then do this and if no then do that...