In that if Purchase manager reject the material request, I need dialog over there for capture reason of rejection. Captured reason will be set to custom field.
I tryed this code but not working for me?!
use
frappe.ui.form.on("Material Request", "workflow_state", function(frm, cdt, cdn){
if (frm.doc.worflow_state ==== "Reject"){
// do something
}
});
The problem with this code is the event is not trigger if I make any action!
It is only triggered onload.
@Mohammed_Redha it dont work, because the workflow handle the save event after the field update!
Usually i use the after_save event, to ensure that the user will post a comment
@Mohammed_Redha itâs in client side, is a event that occurs before a document is saved, in my case I should enforce a comment by the user, is because it, that I need save first and update after, if you try to insert a comment by js, and invoke te save event of the doc, frappe tells, that has a conflict in the doc.
Hello @max_morais_dmm and @Mohammed_Redha
There is not events that are related to workflow (same as refresh, onload, save, ⌠etc that we use it in the normal scripts) to be used with the workflow which helps to check on certain values and allow or disallow the process to complete?
Been trying to find some way around this issue. Using the âafter_saveâ trigger works but itâs not effective because the document state remains as âNot Savedâ and the calculations done on the form are lost if it is refreshed at this point
Could you (or anyone else) suggest an alternative solution pls?
I have faced issue. Dialog is not working when click on âRejectâ button in workflow action dropdown. Still open refresh but i want open dialog in âRejectâ button in workflow action.