does frappe.db.commit() not work in server script in Frappe Cloud?

381 Views Asked by At

HI I am writing a server script in Frappe Cloud where I am trying to update a particular doctype(which is NOT THE DOCTYPE I HAVE CHOSEN IN DOCTYPE EVENT) using frappe.db.set_value(), then in order to save it i use frappe.db.commit(). But when the script tries to run I get the following error

AttributeError: module has no attribute 'commit'

Any ideas to whats wrong

change in the saved document data

1

There are 1 best solutions below

0
gavin On

Use of frappe.db.commit mid transaction can lead to unintended side effects like partial updates.

You don't need to explicitly commit in your Server Script, Frappe handles those bits for you.