Business Rule condition getDisplayValue('document_id')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 08:23 AM
On this table:
I have this Advanced Condition
Question... is the "document_id" field on the sysapproval_approver table a calculated field for getDisplayValue()??
The reason I'm asking is because when all is said and done, I need this business rule condition to be:
Now, in Script Include code, this queries just fine and pulls back perfectly... but when I try the code in this business rule as a condition, it always comes up blank.
Why does getDisplayValue('approver') work in the condition, but not getDisplayValue('document_id') ??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 08:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 08:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 09:33 AM
David,
According to me, the getDisplayValue or getValue don't work with the document_id field is because it is not a referenced field. The type od the field in itself is DocumentID.
What I advice you is to put in your GlideRecord something like "your variable.addQuery('ysapproval_approver.document_id', "CONTAINS" or "START", "theValue");
So you can directly filter on the right record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 10:15 AM
Try this
if(current.source_table!='' && current.document_id!='')
{
var target = new GlideRecord(current.source_table);
if(target.get(current.document_id))
{
gs.addInfoMessage(target.getDisplayValue());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 05:02 AM
i am using this code in business rule but its not working.
can any help me find out error?
var recovery_tier=current.getDisplayValue('recovery_tier');
//current.getValue('recovery_tier');
var gdt = new GlideDateTime();
gs.info("recovery tier--"+ recovery_tier);
gs.log("Hello World"+ recovery_tier);
//gs.print(current.recovery_tier + ' exists');
if(recovery_tier=="Criticality 5" || recovery_tier=="Criticality 4"){
gdt.addYearsUTC(1);
}if(recovery_tier=="Criticality 3" || recovery_tier=="Criticality 2" || recovery_tier=="Criticality 1"){
gdt.addYearsUTC(2);
}
current.expires = gdt.getDate();