Enter a new input in comment field once Close button is clicked

Lawrence29
Tera Contributor

Hi, just wanted to know the best approach to make the comment field mandatory to enter a new input once the close button is clicked.417163048_2693660580790383_1584582483818610675_n.png

5 REPLIES 5

Tai Vu
Kilo Patron
Kilo Patron

Hi @Lawrence29 

If your UI Action has the Client checked, you can set the field mandatory right inside the UI Action within the client side function.

Sample.

Screenshot 2024-01-31 at 10.26.07.png

 

In the other hand, you can also define an UI Policy to make the field mandatory when the state is closed.

 

Cheers,

Tai Vu

Hi Timi, 

My UI Action is not client checked as it is also a backend UI action. I already set it up as mandatory in UI Policy.

My ask is how can the Close UI Action require a new Comment input even though there is already a text in the Comment field.

Thanks,
Lawrence

Hi @Lawrence29 

Oh now I see your use case. You may need to have a Before Update Business Rule to achieve it.

Sample below.

Timi_1-1706674309361.png

(function executeRule(current, previous /*null when async*/) {

	if(previous.getValue('u_comment') === current.getValue('u_comment')){
		current.setAbortAction(true);
		gs.addErrorMessage('Please input your new comments beside the existing ones');
	}

})(current, previous);

 

Cheers,

Tai Vu

Hi Timi,

 

Can we call that in the UI action? it does not show the error message when clicking close button

Thanks,

Lawrence