Server Side Script UPDATE value in other doctype

I have created a new doctype called Test with three fields test_code, test_name, status

Now when Create a new project in Project doctype i need to insert it to Test doctype
So I have created a new server script after save as below

                doctype = 'Test',
                test_code =,
                status = doc.status

And it worked Sucssfuly

after that create a new server script Before Delete

                    doctype = 'Test',
                    test_code =,
                    status = doc.status

also that worked

Now I need a server script to update or change the value For Example: when chang status in Project doctype I want to update status in Test doctype where

How I can do that?

1 Like

Have you tried hooks?

An on_update hook for Project doctype could work.

Try it.

thanks @Jitendra_Rathod
I can do that in Server script doctype or in .py file?

yes, you can do in .py file.

I won’t do change in files, is there any way to do it in Server Script as I did with insert and delete?

add your custome script and pass the path in

How i can do that?

Try this code

value = frappe.db.get_value(doctype, docname, fieldname)
frappe.client.set_value(doctype, docname, fieldname, value)
or this
doc = frappe.get_doc(doctype-name, document-name)
// get property
// set property to the document
doc.first_name = ‘My Name’
// save a document to the database

This is good for an update an existing Document, but
how to insert a complete new document
like Journal Entry

Please check this link…