Data are empty in database view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 09:48 PM
Hi Team,
I have applied database view to license_role and license_has_family table to get the mapping of application, subscription, role.
But the data in license has family is empty.
Iam keeping application field which is reference from both table as a key to join.
Kindly suggest whats wrong i have did.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 12:41 AM
I have tried to check in bgscript the name from license_role table returns undefined. Why it happens
var a=new GlideRecord('license_has_family');
a.addQuery('sys_id','0a7bb0201bb131105bfd54ab234bcb85');
a.query();
if(a.next())
{
var b=new GlideRecord('license_role');
b.addQuery('application',a.license_family);
b.query();
gs.print(b.name);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 12:44 AM - edited ‎11-10-2023 12:44 AM
You're missing the while / if (b.next()) {}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 05:28 AM
Still it doesnt work Kindly suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 12:21 AM
Hi @Preethi26
The reason you're unable to join the tables because value of Application (application) field in license_role is application display_value while value of Application Entitlement (license_family) is sys_id.
You may try adding Application Entitlement [license_family] in the middle to solve this.
Hope this help.
Regards,
Oat