Fuji client scripts: document object is null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 12:39 AM
Hi
We use document.getElementById() or gel() in client scripts to get controls. In some places we cannot replace it with g_form. For example, I need to get a catalog item sys_id in variable set client script so the only way I could do that was document.getElementById("sysparm_id").value
What I found out is that for any client script document object is null:
[Error] TypeError: null is not an object (evaluating 'document.getElementById')
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 12:42 AM
Hi Alexey,
In Scoped app(fuji), we are not supporting for DOM Object ( document.getElementById() ).
Dom manipulation is strictly restricted in fuji.
Thanks,
Pavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 12:52 AM
Ok, so please advise how to get in a variable set client script catalog item sys_id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 01:18 AM
Hi Alexey,
Could you please try with this once.
var incSysid = g_form.getUniqueValue();
Thanks,
Pavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 01:35 AM
TypeError: undefined is not a function (evaluating 'g_form.getUniqueValue()')
Also g_form.setValue functions no longer work on Fuji for catalog client script from variable set - same error
Checked on Eureka:
- g_form.getUniqueValue doesn't work - returns empty
- g_form.setValue works fine
The script is onLoad attached to variable set that is attached to a catalog item.
This blocks all our use cases with service catalog