Menu
Welcome, Guest
Username: Password: Remember me

TOPIC: Create Accounts using script execute from CLI

Create Accounts using script execute from CLI 4 months 1 week ago #80288

  • bf.ts90
  • bf.ts90's Avatar
  • Offline
  • Junior Member
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
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
The administrator has disabled public write access.

Create Accounts using script execute from CLI 4 months 1 week ago #80289

  • gunnicom
  • gunnicom's Avatar
  • Offline
  • Senior Member
  • Posts: 45
  • Thank you received: 20
  • Karma: 7
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.
The administrator has disabled public write access.
The following user(s) said Thank You: bf.ts90

Create Accounts using script execute from CLI 4 months 5 days ago #81946

  • bf.ts90
  • bf.ts90's Avatar
  • Offline
  • Junior Member
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Hi gunnicom,

thank you so much for your answer. I tried your solution and combined with include EntryPoint.php file, it works fine. :)
The administrator has disabled public write access.
Time to create page: 0.064 seconds
Powered by Kunena Forum