Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

duplicate serial numbers asset

var gaDupCheck = new GlideAggregate('alm_asset'); 


gaDupCheck.addAggregate('COUNT', 'serial_number'); 
gaDupCheck.addNotNullQuery('serial_number'); 
gaDupCheck.groupBy('serial_number'); 
gaDupCheck.addHaving('COUNT', '>', 1); 
gaDupCheck.query(); 

while (gaDupCheck.next()) { 

 var gr = new GlideRecord('alm_asset');
  gr.addQuery('serial_number',gaDupCheck.serial_number);
  gr.query();
  gs.info('Duplicate serial number: ' + gaDupCheck.serial_number);

}
Comment

PREVIOUS NEXT
Code Example
Javascript :: getters and setters in java script 
Javascript :: Timestamp Format: 23.12.2015 08:34:50 
Javascript :: javascript prototype chaining in stackoverf 
Javascript :: iterate set javascript 
Javascript :: test command in node js 
Javascript :: staticDir storybook svg and images not loading 
Javascript :: single line vs multiple line comment js 
Javascript :: instant search initial value 
Javascript :: how to add datepicker in appended input 
Javascript :: node_modules imers-browserifymain.js 
Javascript :: how to refrence schema in my mongoose schema with populate function 
Javascript :: javascript hashmap equivalent 
Javascript :: redux extension link 
Javascript :: how to connect two model in mongoose 
Javascript :: know if a gridview is empty from javascript 
Javascript :: javascript change color of button onclick 
Javascript :: how to make local storage read only site:stackoverflow.com 
Javascript :: The setTimeout() method receives the second parameter in 
Javascript :: role based authentication in node js mongodb 
Javascript :: js destructuring arguments 
Javascript :: palindromes array number 
Javascript :: How to Use the Return Keyword in a Function 
Javascript :: odoo js reload widget 
Javascript :: find parent index of nested array object javascript 
Javascript :: add a cumma in a number jquery 
Javascript :: react axios request data objest from online json with table element 
Javascript :: react native tinder 
Javascript :: toast.toastAlert ext js 
Javascript :: get html from url in react js 
Javascript :: google apps script parse html 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =