I am using OOB data certification. While certifying CIs , user should not be able to certify empty elements. Please see image in the description.

Sachin Gavhane
Giga Guru

find_real_file.png

As shown in above pic, user should not be able to certify empty elements as marked in yellow. There should be some error when user tries to certify these empty elements.

Please help

1 ACCEPTED SOLUTION

Business Rule which you need to set up will look like below:

BR Details;

Table: Certification Element:

Condition: State Changes to Certified

Script :

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

	// Add your code here
	if(current.certified_value == ''){
		gs.addErrorMessage('Empty Field Values cannot be certified');
		current.setAbortAction(true);
	}

})(current, previous);

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

16 REPLIES 16

Thanks , I am able to achieve my requirement but on certifying empty elements error message is not getting popup. can you help?

Also can we achieve the same requirement using client script?

Displaying message will be tricky here, reason being when a user tries to certify the element there is a separate table "cert_element" as mentioned before also which is capturing all the info but the form from where you are trying to certify is a different table i.e. Certification task.

What you may try here is there is a Global UI Script named "CertificationTaskScript" which calls a Script Include named "CertificationAjax" . You need to play round here to get the message displayed. If it is really necessary then do invest time else your requirement is done not allowing users to certify when it is empty.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Shloke, thanks for your reply. I guess i need to play aroung with that UI script. But In case if you are able to find some solution for the same, please let me know here. Displaying message is imp. please help if possible

Hi 

@shloke04
 
I need your help in one more requirement , User should not be able to certify elements if that user is not a member of group the certification task is assigned to.
 
I have raised new question in community , link for the same is as follows:
 
https://community.servicenow.com/community?id=community_question&sys_id=541e61251b65811056b699b8bd4bcb4e
 
Requesting you to help

I have responded there in your post. Please have a look and let me know if you have a query.

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke