getView is undefined Portal error

manibaig
Mega Guru

I am getting this error on portal only it's working fine in SN , any idea why? Thanks for your help!

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

You may try g_form.getViewName()


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

Prateek kumar
Mega Sage

Try this:

var currentView = document.getElementById('sysparm_view').value;


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Brad Tilton
ServiceNow Employee
ServiceNow Employee

There are many client side apis and methods available in the main ServiceNow interface that are not supported in Service Portal. Here is a full list of supported client side APIs:

https://docs.servicenow.com/bundle/london-servicenow-platform/page/build/service-portal/reference/cl...

SanjivMeher
Kilo Patron
Kilo Patron

You may try g_form.getViewName()


Please mark this response as correct or helpful if it assisted you with your question.

Hi, g_form.getViewName() is returns empty value on SP! So is there any other way that we can get the view?