Query a reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 03:44 AM
I am trying to query a reference field with function, gr.addQuery('name', current.name); Both name and current name are reference field refeering to non display value. But the record is not getting queried.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 01:19 AM
I was looking into the asmt_m2m_category_assessment and it's field "assessment_record" point to the table "asmt_assessable_record". As I understand you, current.vendor point to core_company. Here you will never get a match if you use "gr.addQuery('assessment_record', current.vendor)"
//Göran

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 11:58 PM
Try to get that value in a separate variable and query then. because reference fields cannot be queried directly.
Something like:
var temp= gr.getValue('field_name');
gr.addQuery('temp',current.vendor);
Regards,
Suresh D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2016 12:55 AM
I tried with above code, all the records of table are getting queried irrespective of the current.vendor value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 12:54 AM
We can use dot operator to refer the particular field of the table being referred.
gr.addQuery('assessment_record.name',current.vendor);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 04:10 PM
Thank you Charanpreet,
The dot walking method worked fine for me. It is (one of?) the correct answer.