How to get the view name of the form by using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 03:41 AM
Hi All,
For change table we are having two different views.So I want to get the view name by using script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 08:05 AM
I tried this...its not going to view loop.I think view query is not right
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 08:15 AM
i tried this
current.getEncodedQuery() ,-- this line gives me something like 'sys_is=XXXXXXXXXX'
so it will not fulfill the first condition even.
also i didnt get any value for view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 08:30 AM
current.getEncodedQuery() is giving output as ORDERBYDESCnumber
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2014 09:04 AM
Business rules are general server side, while client scripts (and views) are client side. View name is meaningless to a business rule unless you deliberately capture it in a custom field so the BR can see it. Client side you can get the view name with: document.getElementById('sysparm_view').value
So I suppose you could add a custom field (and perhaps hide it), but copy the view name to it on submit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 10:49 AM
Hello,
Instead of using
view.startsWith("default")
use:
current.view.startsWith("default")
Hope this helps!