Skip to content

Data population rules

Matt Marum edited this page Mar 10, 2016 · 3 revisions

Rules Description and comments

Rule Options Description Example
skip no Skip data generation for field $GLOBALS['dataTool']['Users']['picture'] = array('skip' => true);
teamset_max no Assign TeamSet with maximum number of Teams in it $GLOBALS['dataTool']['Accounts']['team_set_id'] = array('teamset_max' => true);
teamset no Assign random TeamSet ID $GLOBALS['dataTool']['default']['team_set_id'] = array('teamset' => true);
value yes Assign given value for field $GLOBALS['dataTool']['Leads']['alt_address_country'] = array('value' => "'USA'");
increment yes Assign value that will be incremented each time you generate value for module
incname no Assign incname string constant + increment number for field $GLOBALS['dataTool']['Users']['user_name'] = array('incname' => 'user');
autoincrement no Field will be populated by DB with auto increment value $GLOBALS['dataTool']['Cases']['case_number'] = array('autoincrement' => true);
sum yes Sum several pieces/fields into one value. Piece could link to a bean field or num value to sum $GLOBALS['dataTool']['Quotes']['total'] = array('sum' => array('subtotal', 10, 'tax'));
sum_ref yes Same as "sum" but values are taken from remote (other modules) beans $GLOBALS['dataTool']['Quotes']['subtotal'] = array('sum_ref' => array(array('module' => 'ProductBundles', 'field' => 'total'), array('module' => 'ProductBundles', 'field' => 'total')));
same yes Assign value that will same as given field with available "toUpper" or "toLower" modifications $GLOBALS['dataTool']['Tags']['name_lower'] = array('same' => 'name', 'toLower' => true);
same_ref yes Same as "same", but value is taken from remote (other module) bean $GLOBALS['dataTool']['Quotes']['billing_address_street'] = array('same_ref' => array('module' => 'Accounts', 'field' => 'billing_address_street'));
same_hash yes MD5 hash of given field value $GLOBALS['dataTool']['Contacts']['portal_password'] = array('same_hash' => 'portal_name');
related yes Relation ID of given module. Option is module name, that should be also generated by Tidbit $GLOBALS['dataTool']['Contacts']['account_id'] = array('related' => array('module' => 'Accounts'));
gibberish yes Generate large text that will contains of N words $GLOBALS['dataTool']['Users']['description'] = array('gibberish' => 8);
range yes Generate numeric value in (min,max) range with possible multiplier factor $GLOBALS['dataTool']['default']['decimal2'] = array('range' => array('min' => 0, 'max' => 1000), 'multiply' => 4.3);
list yes Generate random value from predefined strings array. Used for generating last names, first names and e.t.c $GLOBALS['dataTool']['default']['email'] = array('list' => 'last_name_array', 'suffix' => '@example.com');
same_datetime yes Generate Datetime value, based on another field with possible modifications $GLOBALS['dataTool']['Calls']['date_end'] = array('same_datetime' => 'date_start', 'modify' => array('hours' => array('field' => 'duration_hours'), 'minutes' => '30'));
suffixlist yes Generate value with suffix appended. Suffix will be generated randomly from predefined list $GLOBALS['dataTool']['Accounts']['name'] = array('list' => 'last_name_array', 'prefixlist' => array('companyPre'), 'suffixlist' => array('companyExt'));
enum yes Generate value of dropdown values defined in SugarCRM
getmodule no Assign current module as a value $GLOBALS['dataTool']['tag_bean_rel']['bean_module'] = array('getmodule' => true);
prefixlist yes Same as "suffixlist" but value will be prepended $GLOBALS['dataTool']['default']['email'] = array('list' => 'last_name_array', 'suffix' => '@example.com');
suffix yes Append constant string suffix $GLOBALS['dataTool']['default']['email'] = array('list' => 'last_name_array', 'suffix' => '@example.com');
prefix yes Same as "suffix"
isQuoted no Trim and quote value into " $GLOBALS['dataTool']['Contacts']['primary_address_postalcode'] = array('range' => array('min' => 15000, 'max' => 99999), 'isQuoted' => true);