ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Update document using REST API


#1

Hi, I wanted to updated the document using frappe PUT call, here is the code

frappe.ui.form.on("[doc]", "on_submit", function(frm,cdt, cdn) {
var docData = {};
docData.field = "Test";    
frappe.call({
    		url: "/api/resource/[doc]/"+docData.name,
    		type: "PUT",
    		args: {
    			data : docData
    		},
    		callback: function(r) {
    			console.log(JSON.stringify(r));
    			//location.reload();
    		}
    	});
});

In this response, following messages popup “Not allowed to change field after submission”

P.S. Document Permission is set "Is Submitable"


#2

Solved.

I had to mark that field as Allow on Submit.