Clear the date field value based on the another field value change

siva58
Tera Contributor

HI All.

i  am using 2 fild in a table, 1. Approval,

siva58_0-1666178422666.png

 

2.Approval date.

siva58_1-1666178618291.png

 

If i am changing Approval  field value Requested  to Approve that should be populated in the Approval date  Field.it was working fine.

my requiremnt is:

if i am changing the Approval field value Approved to Requested or Not yet requested, the date field need to clear the value. but still it was showing the date .

1 ACCEPTED SOLUTION

Ahmmed Ali
Mega Sage

Hello @siva58 

 

You can create a before update business rule on your table with condition as "Approval changes AND Approval is Requested", and in script tab, write script as below to clear the approval date field.

 

current.approval_date = ""; //Validate the back end name of the field.

 

Note: you can do the same with on change client script as well on the approval field, but that would work only if someone updates approval in form view. it would not work for updates done in list view. 

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

3 REPLIES 3

Aman Kumar S
Kilo Patron

How did you achieve the first part, can you share the approach that you took?

Best Regards
Aman Kumar

Ahmmed Ali
Mega Sage

Hello @siva58 

 

You can create a before update business rule on your table with condition as "Approval changes AND Approval is Requested", and in script tab, write script as below to clear the approval date field.

 

current.approval_date = ""; //Validate the back end name of the field.

 

Note: you can do the same with on change client script as well on the approval field, but that would work only if someone updates approval in form view. it would not work for updates done in list view. 

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Pratik Malviya
Tera Guru

Hi @siva58 ,

 

From where you are setting approval date, if from BR then you can add else part and set

gr.setValue("u_approval_date","");

 

or if you are doing it from client side by using client script, then you can add else part and add

g_form.setValue("u_approval_date","");

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks,
Pratik Malviya