Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: JT JT
Added: Aug 28, 2018 5:59 AM
Views: 6
Tags: create testing
Create dummy records within a table from random strings
  1. var ranString = '';
  2. for (var i=0; i<20; i++){
  3.         ranString = Math.random().toString(36).replace(/[^a-z]+/g, '');
  4.         gs.info(ranString);
  5.         var dataSource = new GlideRecord('u_data_souce');
  6.         dataSource.initialize();
  7.         dataSource.u_name = ranString.substring(0,4);
  8.         gs.info(dataSource.u_name);
  9.         dataSource.u_value = ranString.substring(4,8);
  10.         gs.info(dataSource.u_value);
  11.         dataSource.insert();
  12. }