How to code Update Value in workflow

Hi, I’m doing a date update in one of my fields. The field is a Date data type and what I want to happen is that when the user changes the worflow_state the Date field would update to the current date. how can I do that?

Hi @Rabie_Moses_Santilla,

If the worflow_state trigger does not work then use before_save.

Thanks.

Hi Rabie

For ex your workflow state draft means below code use that condition
if self.workflow == “Draft”:
filed_name = now_datetime()