
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 01:43 AM
Hello.
I cloned a widget to run under a scoped application and I'm getting this:
Solved! Go to Solution.
- 5,049 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 09:01 AM
I suppose you cloned Data Table [widget-data-table] widget. The code
GlideTableDescriptor.get(data.table).getED().hasAttribute("glide.security.ui.filter")
tests whether the table data.table has attribute with the name glide.security.ui.filter. No standart tables has the attribute. So you can just remove the part of code. If you do want to use the code, that you have to rewrite the fragment to get the same information about attributes of the table in alternative way.
I posted in my answer on the question the code of small function isTableAttributeEqualValue. The code shows how one can get attributes of table. You need just modify the last line of the code to use only return gr.next(). The resulting function will looks as following
function isTableHasAttribute (tableName, attributeName) {
var gr = new GlideRecord("sys_schema_attribute_m2m");
gr.addQuery("schema.name", tableName); // "Dictionary Entry"."Table"
gr.addQuery("attribute.name", attributeName); // "Attribute"."Name"
gr.query();
return gr.next();
}
Then you can use isTableHasAttribute(data.table, "glide.security.ui.filter") instead of GlideTableDescriptor.get(data.table).getED().hasAttribute("glide.security.ui.filter").
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 02:28 AM
Hi Rafael,
Please go through the below threads, which might be helpful to you.
If my reply has helped you,Kindly click the Helpful button.
If my reply is the answer you were looking for, Kindly click the Accepted Solution button.
Thanks,
Priya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 02:34 AM
Hi Rafael,
please go through below links:
1. https://community.servicenow.com/community?id=community_question&sys_id=07a433e2dbd957003882fb651f9619bc
2. https://community.servicenow.com/community?id=community_question&sys_id=b3a00765db98dbc01dcaf3231f96198e
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 09:01 AM
I suppose you cloned Data Table [widget-data-table] widget. The code
GlideTableDescriptor.get(data.table).getED().hasAttribute("glide.security.ui.filter")
tests whether the table data.table has attribute with the name glide.security.ui.filter. No standart tables has the attribute. So you can just remove the part of code. If you do want to use the code, that you have to rewrite the fragment to get the same information about attributes of the table in alternative way.
I posted in my answer on the question the code of small function isTableAttributeEqualValue. The code shows how one can get attributes of table. You need just modify the last line of the code to use only return gr.next(). The resulting function will looks as following
function isTableHasAttribute (tableName, attributeName) {
var gr = new GlideRecord("sys_schema_attribute_m2m");
gr.addQuery("schema.name", tableName); // "Dictionary Entry"."Table"
gr.addQuery("attribute.name", attributeName); // "Attribute"."Name"
gr.query();
return gr.next();
}
Then you can use isTableHasAttribute(data.table, "glide.security.ui.filter") instead of GlideTableDescriptor.get(data.table).getED().hasAttribute("glide.security.ui.filter").