SugarCRM: Dynamically create dropdown values

//load needed libraries
$parser = new ParserDropDown();
$params = array();
$_REQUEST['view_package'] = 'studio'; //need this in parser.dropdown.php
$params['view_package'] = 'studio';
$params['dropdown_name'] = 'test_dropdown_list'; //replace with the dropdown name
$params['dropdown_lang'] = 'en_us';//create your list...substitute with db query as needed
$drop_list[] = array('-blank-','');
$drop_list[] = array('First','This is the First Text');
$drop_list[] = array('Second','This is the Second Text');
$drop_list[] = array('Third','This is the Third Text');
$json = getJSONobj();
$params['list_value'] = $json->encode( $drop_list );
SugarCRM: Dynamically create dropdown values

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s