How to set script include within field default value 
						
					
					
				
			
		
	
			
	
	
	
	
	
Options
			
				
					
	
			
		
	- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
03-05-2021 08:08 AM
Within this list collector, I am attempting to have this script include return a value for the field but I am unsure if the value that I am passing into the function (current.sys_id) is being sent over.
Default Value:  javascript: new announcement_portal_util().getDefault(current.sys_id);
Script Include:
var announcement_portal_util = Class.create();
announcement_portal_util.prototype = {
    getDefault: function(announcement) {
        var gr = new GlideRecord("m2m_announcement_portal");
        gr.addQuery("sys_id", announcement);
        gr.query();
        if (gr.next()) {
            return gr.sp_portal;
        }
    },
    type: 'announcement_portal_util'
};
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
		
			
				
						
							Labels:
						
						
		
			
	
					
			
		
	
	
	
	
				
		
			
		
			
					
			
		
				
		
			
		
	
	
- Labels:
 - 
						
							
		
			Scripting and Coding
 
		1 REPLY 1
	
		
		
			
			
			
					
	
			Options
			
				
					
	
			
		
	- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
03-05-2021 08:32 AM
You can add a gs.log statement after the function to confirm you're getting the correct value.
