👩‍💻 Check out our latest job positions here 👈 or send us a PM for more info.

Javascript Function is not a function... (Not the error of "function is not defined")

I encounter the following issue after upgrading from sugar CRM to suiteCRM v7.10.x

I have the following javascript function put in a javascript file named receipt.js:

function getReceipt() {
    open_popup('ReceiptPage', '580', '380', '&pcr=pcr&record=' + $('[name="record"]').val() + '&module_name=ReceiptPage', true, false, { 'call_back_function': 'set_return', 'form_name': 'EditView', 'field_to_name_array': [] });
}

Inside receipt.js, I already implemented a few functions and they’re all working fine except getReceipt() function. I always get the error “getReceipt is not a function at HTMLInputElement.onclick”.
I believe there is something wrong with the function, because the message is not “is not defined” but it is “not a function”, and the rest of the functions are working fine within the same file “receipt.js”.

Is there anything wrong with my function? Your expertise comments are appreciated.