ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Js Script Doctype Triggers

Okay so there are form event based triggers like refresh, onload and then there are field based triggers. I’ll cite my query in detail below:

I have two doctypes, Lets call them DocA and DocB.

  1. There are three fields on DocA: (FieldA, FieldB, FieldC)
  2. There are two fields on DocB: (FieldA. FieldB)

Now I have a script running for DocB:

  1. Trigger is FieldA in DocB ( fielda:function(frm))
  2. When this script runs it changes the value of FieldA in DocA

I have another script, for DocA:

  1. Trigger is FieldA in DocA

Now for the script for DocA to be executed (since its a field based trigger), will the trigger for DocB cause a chain execution (it is changing the value for a field in another document which in itself is a trigger) OR would I have to open DocA for the script to run and execute (I think this wouldn’t be the case because this would be a simple refresh trigger).

Any help is appreciated.