Trigger on System Populated Fields

Dear Experts,

Is there any way we can write custom scripts that trigger on System Populated Fields.

E.g. the Pricing Rule field in a Sales Order form - users cannot key in the Pricing Rule, instead it is suggested by the System. Is it possible to listen on changes to this field?

I have tried cur_frm.cscript.pricing_rule = function(doc, cdt, cdn) {…} but it does not work.

Thanks very very much.

Explain your use case.

Also please don’t add so many thanks!

As an alternative to add_fetch Pricing Rule field in the Sales Order form - #6 by bohlian - haven’t been able to get this to work.

I am trying to use a frappe.call({ … }) to pull information from the Pricing Rule Doctype once the Pricing Rule is fired. Is this possible? or are there alternatives?