Create Accounts using script execute from CLI

Good Morning to all, I’m new on SuiteCRM world.

I need to create (and in future update) companies through a php script that is launched from the command line. In my case, i read accounts from a file.

An example of code what I would like to do, can be found into install/popoulateSeedData.php but I can’t understand where to put the script in order to access the classes and everything necessary. I tried to include the Account.php file, but my script goes wrong when in Account.php includes other files

My script is into a my custom folder in the CRM root.

Someone who can help me with some examples or let me know how to make it?

SuiteCRM version in use: 7.11.2

Thank you very much

Maybe you can try a

chdir(DIR . ‘/…’);
at the beginning of your script, so your base path from where the includes will include is the suite base folder.

1 Like

Hi gunnicom,

thank you so much for your answer. I tried your solution and combined with include EntryPoint.php file, it works fine. :slight_smile: