Adding custom buttons + functionality in SuiteCRM 8.9.x, Blank Screen Issues

I have managed to move our CRM system from LimeCRM to SuiteCRM, and the results are very good! I am very happy for the functionality, although I still have some dreams I’d like to have.

For you guys hacking on SuiteCRM 8.9.x, I want to share some information which might help if you counter similar issues. Developing on 8.9.x is somtimes troublesome, because the structure is very picky, complicated and not so well documented. I expect these problems to be solved in time.

This explanation has been made with Codex AI.

I tried to add custom actions to the AOS_Quotes DetailView in SuiteCRM 8.9.x (legacy UI inside the Angular shell). The goal was to show extra custom fields and add two buttons: “Generate PDF (with images)” and “Create Sales + Purchase Contracts.” EditView worked, but DetailView went blank.

What was happening:

  • In SuiteCRM 8, the Angular shell embeds the legacy DetailView.

  • If the legacy DetailView throws a fatal error, Angular shows only the top bar and a blank content area.

  • The SuiteCRM log eventually revealed a fatal Smarty template error in DetailView.tpl.

  • The root cause was JavaScript braces { … } inside customCode for a button in detailviewdefs.php. Smarty interprets {} as template tags, so it tried to parse window.location… and failed. That crash stops the legacy render, leaving the Angular shell empty.

Challenges in this kind of customization:

  • Legacy view metadata is rendered through Smarty. Any { or } in customCode (or bad escaping) can break the template.

  • SuiteCRM 8 doesn’t always surface the error in the browser; you must check suitecrm.log.

  • “Blank” usually means the legacy PHP view died, not an Angular problem.

What solved it:

  • Removing braces from the JavaScript inside customCode (e.g., turning if (…) { … } into if (…) …:wink: stopped Smarty from parsing it.

  • As a safer pattern, move custom buttons into view.detail.php (add to $this->dv->defs) instead of embedding complex JS in detailviewdefs.php. This avoids Smarty parsing pitfalls.

  • Keep the custom detailviewdefs.php minimal (only add fields/panels) and keep core layout intact.

Recommended approach for forum users:

  1. When DetailView is blank, check suitecrm.log for Smarty errors.

  2. Avoid {} in customCode strings.

  3. Prefer adding buttons in view.detail.php or use sugar_html definitions with minimal JS.

  4. Use custom detailviewdefs only for field layout changes, not for complex UI logic.

Sometimes you just need to move files one by one and then

  1. Quick Repair & Rebuild
  2. Clear cache
  3. Hard reset on browser
  4. Check logs

Best Regards,

Tapio

1 Like