Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Uncaught TypeError: frappe.call is not a function

Now when I click submit button I take value in respective field in js code and then pass them to frappe.call but I am getting error frappe.callis not function.

Here is JS code

function GetData(){
var pname = document.getElementById(‘proj-name’).value;
var pstart = document.getElementById(‘proj-start’).value;
var pcomp = document.getElementById(‘proj-complete’).value;
var pfile = document.getElementById(‘proj-file’).value;
var pbudget = document.getElementById(‘proj-budget’).value;
var pdesc = document.getElementById(‘proj-description’).value;

		console.log(pname,pstart,pcomp,pfile,pbudget,pdesc);

		frappe.call({
		method: 'bgp.bgp.servercallmethod.servercallmethod',
		args: {
			'doctype': 'Project',
			'prname': pname,
			'prstart': pstart,
			'prcomp': pcomp,
			'prfile': pfile,
			'prbudget': pbudget,
			'prdesc': pdesc
		},
		callback: function(r) {
			frappe.msgprint({
				title: __('Notification'),
				indicator: 'green',
				message: __(r)
			});
		}
	});
	}

Here is code in py file

import frappe
@frappe.whitelist()
def servercallmethod(doctype,prname,prstart,prcomp,prfile,prbudget,prdesc):
doc = frappe.get_doc({
‘doctype’: doctype,
‘topic’: prname,
‘from’: prstart,
‘to’: prcomp,
‘upload_file’: prfile,
‘budget’: prbudget,
‘description’: prdesc
})
doc.insert()
frappe.db.commit()
return ‘Project uploaded successfully.’