Join 2 table by Glide Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:30 PM
I have two table : user and right, can I join them by GlideRecord : user.right_id = right.right_id ? I see addQuery in GlideRecord have fixed value ex : gr.addQuery('active', 'false').but I want to join 2 table with similar field. pls help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 10:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 11:31 PM
Hi Khiem,
Yes in GlideRecord() you can addQuery fixed values. But then your solution also might be that only.
Suppose, you created a Business Rule on User table, there is field right_id. From there, you can GlideRecord() on Right table. You can do something like this to query:
var gr = new GlideRecord('right');
gr.addQuery(gr.right_id, current.right_id);// Or you can right gr.addQuery(gr.right_id,"=",current.right_id) gr.query();
Please let me know if that worked for you.
Mark my answer as Correct/Helpful if that helps you anyhow.
Regards,
Vishrut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 10:34 PM
Hi Khiem,
Is there any update on your above query?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement from the suggestion/input I have provided.
This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
- Vishrut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2018 01:23 AM
I'm sorry I forgot that.But I want to join two table with condition is table1.field1 = table2.field2 ,not fix condition. Can GlideRecord do that ?