Javascript not working

Hi,
Iā€™ve recently installed suitecrm on a web server and itā€™s mostly working.
Iā€™ve discovered however that most functions that involve javascript simply do not fire at all, when checking the error console it always says
ā€˜ReferenceError. Canā€™t find variable.ā€™

Iā€™ve tried changing all the permissions, but it just isnā€™t working!
Thanks

Did you trying doing a quick repair and rebuild, rebuild relationships etc ?

Yup tried that.
The popups in the calendar seem to be working, the main part where itā€™s not working is the ā€˜generate pdfā€™ function in the invoices module.
It always says:
ā€œReferenceError: Canā€™t find variable: showPopupā€

I have worked out the problem, it was from a custom view.detail file:

<?php class AOS_InvoicesViewDetail extends ViewDetail { public function display(){ parent::display(); echo ''; } } ?>

By using this custom file it stops the pdf generation from working.
How do I fix this?

1 Like

I had the same problem. Instead of extending the ViewDetail class, you should extend the ModuleViewDetail class. I had this problem with Contact.

class CustomContactsViewDetail extends ContactsViewDetail

You may need to try to put this out of PHP or use heredoc operator.

?>

<script>
console.log("i am logged");
</script>