capturing onhold reason and duration in tow new fields

Mansi roy
Tera Contributor

Hello All,

 

Could anyone please help me how to acheive the below one.

 

I need to capture the onhold reason of catalog task so that the reason will not get clear after closed complete of task.And on hold duration.

 

There is a field in the form pending reason when the state is getting changed to pending.I need to copy this value in another new field 'hold reason' so that the value should not clear upon closed complete.I need to capture the onhold duration also.

5 REPLIES 5

I assume your BR is onBefore update 'state changes to resolved'? And at least runs earlier than the logic that is clearing the field? 

You can just use the normal field conditions and don't need a script. Just set 'inc_hold' to 'hold_reason'.

 

And if you do want to use a script, it's the same, just use

current.setValue("u_inc_hold", current.hold_reason);

 

You can check if you have the value of hold reason by adding logging to your script:

 

var reason = current.hold_reason;

gs.log(current.number + " hold reason: " + reason);

current.setValue("u_inc_hold", reason);

current.update();


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark