I have created workflow for my job card doctype, when user select particular action from the action button it also updates the job card status . In the Job Card I have created child table which i want to update based on the action selection.
In below screenshot my current jobcard Status is “Fabrication Complete” and now if the user select “Send to Copper platting” i want to create an entry into my “cylinder events” child table with below:
Old status name = Fabrication Complete, New Status Name = “Send to Copper platting”, Date Time = “time when the action was selected”
same if the person selects Rejected it should create an entry into cylinder event table as below:
Old status name = “Fabrication Complete”, New Status Name = “Rejected”, Date Time = “time when the action was selected”
I could not make the script to work to update table so i changed the approach and created custom fields where i am updating the date and time when user select the workflow step. This works fine when i am in the job card doctype but when i am selecting the same action when in the list view its not updating the field with date and time. any suggestion on how to make the same script work for the job card and the list view of the job card?
here is my code for the updating fields based on workflow action: