- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 11:23 AM
Hey Everyone!
I hope all is well. I am creating a related list/relationship that applies to the interaction table and queries from the wu_appointment table.
Nonetheless, the goal is for the interaction table to show the appointment for the user. One appointment per interaction.
I want the query to query the sys_id for the interaction, but it isn't working.
What am I missing?
(function refineQuery(current, parent) {
var appointmentID = parent.opened_for;
var appointments = 'sys_class_name=wu_appointment^contact='+ appointmentID;
current.addQuery("sys_id", current.sys_id);
current.addEncodedQuery('active=true'+ appointments);
current.addEncodedQuery('ORDERBYDESCopened_at');
// Add your code here, such as current.addQuery(field, value);
})(current, parent);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:07 PM - edited 04-08-2024 01:08 PM
Hi @Community Alums,
How are you setting the relationship between the Interaction record and the Walk-up Appointment record?
If you use the 'Associate Record' functionality, the wu_appointment will be automatically visible under the 'Related Tasks' tab in the Interaction record.
e.g.
In regards to your script, looks like you want to fetch all the active wu_appointment with the same caller/requestor value. Not sure if you want to be doing that but try the script below:
(function refineQuery(current, parent) {
current.addActiveQuery();
current.addEncodedQuery('contact=' + parent.opened_for);
})(current, parent);
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:07 PM - edited 04-08-2024 01:08 PM
Hi @Community Alums,
How are you setting the relationship between the Interaction record and the Walk-up Appointment record?
If you use the 'Associate Record' functionality, the wu_appointment will be automatically visible under the 'Related Tasks' tab in the Interaction record.
e.g.
In regards to your script, looks like you want to fetch all the active wu_appointment with the same caller/requestor value. Not sure if you want to be doing that but try the script below:
(function refineQuery(current, parent) {
current.addActiveQuery();
current.addEncodedQuery('contact=' + parent.opened_for);
})(current, parent);
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 04:33 AM - edited 04-09-2024 05:00 AM
Hey James,
It does work for the Assoicate Record and the answer was in that relationship query.
So, when I used your more simplified query and added the interaction query, I got my answer.
current.addActiveQuery();
current.addEncodedQuery('contact=' + parent.opened_for);
current.addEncodedQuery('interaction=' + parent.sys_id);
Thanks!