Get sysparm value from URL in a list control
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 12:35 AM
I have a list control for that I want to customize so if a specific sysparm(sysparm_nonew) appears in the url, I want to hide the new button.
But I can't find how get get the sysparm_nonew from the url. I tried "gs.action.getGlideURI().getMap().get('sysparm_nonew')" but will only return null no matter if I got sysparm_nonew=true eller not in the URL.
Any ideas?
//Göran
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 03:07 PM
weird.. I tried it, and just to be sure I tested again.. but I get "org.mozilla.javascript.EcmaError: "RP" is not defined." when I put it a log to see what I get...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 01:10 AM
hmm...strange, I wonder if in your instance RP is still used in OOB records, especially "New" UI action's condition based on which the button gets hidden?
Anyway your first setup gs.action.getGlideURI().getMap().get('sysparm_nonew') should work - I also added .toString() to the end but in any way
it worked in my instance:
Passed sysparm_test with a test value - here to make sure parameter is framed by the proper characters in the URL:
Global "New" UI action got hidden based on this condition:
Best regards,
Andras
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2017 11:31 AM
are you going this in a list control for a related list or for a "normal list" like incident.list?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 03:30 PM
Hi Goran,
What I wrote applies to normal v2 platform lists, not related lists, not portal list widgets, and not list v3.
When applying omit new condition to a table it is important to check which "New" UI action is rendered on the list, the global one or it is override with a table-specific "New" button, as the buttons condition to hide them may check for different things.
For change_request list it should work when the global "New" button applies, which has its condition field containing !RP.getLIstControl().isOmitNewButton() which evaluates list control omit new condition field and shows/hides the new button.
Incident table, however, did not hide the button for me as (at least in my dev instance) it has a "New" UI action on incident table which overrides global and seems ignoring omit new condition...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 04:52 AM
Ahh there is the darn little thief... 😃 I was looking at List V3