Not able to import records in new custom module

Hello all

We are using SuiteCRM 7.9.8 and have created a new module with the “Module Builder” tool.
The thing is that even we have set to true the flag “Import Records” to allow this new custom module to import new records from excel or csv files… once the new custom module is deployed, and we see the “Import Records” button in the List View, when we try to start the process we get this error

I have seen that this was an issue included in the forum in the post:

https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/19060-imports-aren-t-set-up-for-this-module-type

But the solution was to find a file named "<module_key>_<module_name>.pdf"where there should be an option ‘$importable = false;’ but we are not able to find it.

Anyone can help please?

The extension is not PDF, it’s PHP.

It says the file should be in

./modules/<module_key><module_name>/<module_key><module_name>_sugar.php

But i guess for custom modules it should be under the “custom” directory. Search also for similar files, anything ending in “sugar.php”

Hello, thanks a lot!

I have searched and in the “Custom” folder in the project, and in the new custom module folder, but there is not such file. There is only the “Ext” folder and no file inside is like the one we are looking for.

I have found other modulename_sugar.php files, but not for my custom module

Is it enought to copy the file from other module,and change the “Module Name” within the file?

Copying from another module is worth a try, yes. But look inside the file and change the Class names and module references. You’ll need some (not necessarily complete) understanding of what it’s doing in order to change it successfully.

No, I have copied the Calls_Rescheduler_sugar.php module and called it to my new custom module

Conec_Distribuidor_sugar.php with this content

class Conec_Distribuidor_sugar extends Basic {
        var $new_schema = true;
        var $module_dir = 'Conec_Distribuidor';
        var $object_name = 'Conec_Distribuidor';
        var $table_name = 'conec_distribuidor';
        var $importable = true;
        var $tracker_visibility = false;
        var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if th$


    function Conec_Distribuidor_sugar(){
        $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
        if(isset($GLOBALS['log'])) {
            $GLOBALS['log']->deprecated($deprecatedMessage);
        }
        else {
            trigger_error($deprecatedMessage, E_USER_DEPRECATED);
        }
        self::__construct();
    }


        function bean_implements($interface){
                switch($interface){
                        case 'ACL': return true;
                }
                return false;
}

}
?>

Then in Admin I run “Quick Repair”… but still getting the same result.

Is this a normal bug when you create a new module??

I think I am gonna start trying with ETL, but should be easier with the import tool of the SuiteCRM rigt?

I don’t know much about how all this works.

You can consider importing from SQL, that is always a quick option. If this is meant to be just a one-time large import, I would definitely do it with phpMyAdmin.

If you need a UI process to be done by users, then it gets more complicated.