Adding an image to table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2016 10:10 PM
Hello,
I would like to add an image to a field in the table. I have chosen the field type as Image (the image icon is available in System UI -> Images) and set the business rule, but the image is not getting displayed in the table. Can someone help me how to go about it?
function onDisplay(current, g_scratchpad) {
var gr = new GlideRecord('u_inventory');
gr.addQuery('u_product_name',current.u_product_name);
gr.query();
while(gr.next()){
if(gr.u_product_quantity == 0){
current.u_availability = "images/star.png";
}
if(gr.u_product_quantity > 0){
current.u_availability = "images/pic2.jpg";
}
}
}
Thanks,
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2016 03:45 AM
for the list view, you'll need to use field styles (check out the field style on the incident table caller_id field for the Vip flag).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2016 04:18 AM
For the vip flag, the script used is current.caller_id.vip == true,may i know where is the .vip method defined. Since in my case I need to compare the value of a field with another table's field.
Thanks,
Sam