Is there an easy way to run code in sugar?

Hi,  It seems like it takes longer to develop with sugarCRM than just making a application from scratch.  Are there ways of running groups of code without needing to rebuild the application and clicking around to see if something as taken effect?  For example if I am using the beanfactory class to get an existing record with an specific ID can I echo that out to the console?

Best Regards

James Palmisano

Parents Reply Children
  • A couple of other thoughts...

    Logic hooks allow you to run arbitrary PHP code and can be applied without requiring a rebuild (although, best practice is to use logic hook extension to define it). Anyhow, that's another approach. If you wish to output data to the log file, you can always do so via the standard Sugar logging capabilities, as described here:

    Angel's Blog: SugarCRM Troubleshooting 101: Quick and Easy Custom Logs

    The type of code is also important. Sugar 7 uses a lot of JavaScript code and you can run a lot of prototype code directly within the JavaScript console in Chrome or your browser of choice. That would allow you to instantiate SugarBeans and a wide variety of things, all without having to rebuild. The JavaScript also offers ways to output info to the log, although it goes to the console, by simply using console.log('your message') and using "debugger" also comes in handy.

    In short, there are different ways to run prototypes and your options will vary depending on the type of code you are wanting to introduce.