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>