- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2015 02:57 AM
Greetings,
I was hoping for assistance, likely a simple answer but too much time has been spent already trying 70 different methods and I am sure someone here will know it.
Stripped down to its basic form I am trying to addQuery against 1 field on a table and 1 field on another table, stepping through a reference field.
var getCvr = new GlideRecord('pm_portfolio_project');
getCvr.addQuery('project.u_start_date','=','u_project_start_date');
getCvr.query();
while(getCvr.next()) {
//do stuff
getCvr.update();
}
I have confirmed the project.u_start_date works fine, I am assuming its comparing 'u_project_start_date' as a literal string and not evaluating the field from the original table. Any advise?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2015 08:34 AM
Replace the addquery with this
getCvr.addEncodedQuery('pm_project.start_dateSAMEASstart_date@day')
If this doesn't work, open the table > filter the record as needed > right click on the query end >do a copy query> use it in encoded query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2015 09:43 AM
- var getCvr = new GlideRecord('pm_portfolio_project');
- getCvr.addQuery('project.u_start_date',current.u_project_start_date); // if field is located on current record where BR is firing (eg. if BR is configured on table A, current will point to Table A record
- getCvr.query();
- while(getCvr.next()) {
- getCvr.u_gtg_plan = 'Found a match';
- getCvr.update();
- }
- var getCvr = new GlideRecord('pm_portfolio_project');
- getCvr.addQuery('project.u_start_date',getCvr.u_project_start_date); // compare same record two fields if both fields are pointing toward 'pm_portfolio_project
- getCvr.query();
- while(getCvr.next()) {
- getCvr.u_gtg_plan = 'Found a match';
- getCvr.update();
- }
Though your question is now answered, you can try with above two codes as well