Import issuse occours when enum created as a function

First i created a enum the code as the following :-
I have created these field in custom/Extension/modules/Leads/Ext/Vardefs/sugarfield_remiter_country.php
$dictionary[‘Lead’][‘fields’][‘remiter_country’] = array (
‘name’ => ‘remiter_country’,
‘vname’ => ‘LBL_REMITER_COUNTRY’,
‘type’ => ‘enum’,
‘function’ => ‘getCountryList’,
‘len’ => 100,
‘audited’ => true,
‘comment’ => ‘’,
‘default’ => ‘’,
‘merge_filter’ => ‘disabled’,
);

After Vardef created then I create function on the following path
custom/Extension/application/Ext/Utils/getCountryList.php

function getCountryList(){
	static $getCountryList = null;
    global $current_user, $db, $app_list_strings;
	if(!$getCountryList){
		
		$query = "SELECT id,name,country_iso,country_id FROM rtx_country where deleted = 0 order By name asc";
        
		$result = $db->query($query, false);

		$getCountryList = array();
		$getCountryList[''] = '';

		while (($row = $db->fetchByAssoc($result)) != null) {
			$getCountryList[$row['country_id']] = $row['name'] .' ( '. $row['country_iso'] .' ) ';
		}

	}
	return $getCountryList;
}

I have created more field of enum with same functionlity, But I got an error when I importing data.

Please help me out.

I’m working on a similar feature. The import errors you’re seeing are only “Notice” which is only Information, and it’s less serious than a “Warning” or an “Error”. Was any of the data imported?

Thanks for your reply.

But when you have found notice or Warning on the time of import data from Import modules, it will be effected on the rollback or refreshing the page.

So yesterday I went though Import Moudles and trace where Notice found. There is a function importSanitize which is revert back the value from enum option.

So I change little bit vardef in my code as the following:-

function getCountryList(){
	static $getCountryList = null;
    global $current_user, $db, $app_list_strings;
	if(!$getCountryList){
		
		$query = "SELECT id,name,country_iso,country_id FROM rtx_country where deleted = 0 order By name asc";
        
		$result = $db->query($query, false);

		$getCountryList = array();
		$getCountryList[''] = '';

		while (($row = $db->fetchByAssoc($result)) != null) {
			$getCountryList[$row['country_id']] = $row['name'] .' ( '. $row['country_iso'] .' ) ';
		}
		$GLOBALS['app_list_strings']['getCountryList_list'] = $getCountryList;
	}
	return $getCountryList;
}

********vardef*******
$dictionary['Lead']['fields']['remitting_country'] = array(
    'name' => 'remitting_country',
    'vname' => 'LBL_REMITTING_COUNTRY',
    'type' => 'enum',
    'function' => 'getCountryList',
    'options' => 'getCountryList_list',
    'len' => 100,
    'audited' => true,
    'comment' => '',
    'default' => '',
    'merge_filter' => 'disabled',
);