Follow the below steps:-
1.Create UI Script
3. Catalog Client Script:
function onSubmit() {
//Works in non-portal UI
try {
var attachments = document.getElementById('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none' ) {
alert('You must attach the completed form before submitting this request.');
return false;
}
}
//For Service Portal
catch(e) {
var count = getSCAttachmentCount();
if(count <= 0) {
alert('You must attach the completed form before submitting this request.');
return false;
}
}
}
1.Create UI Script
UI Script: GlobalCatalogItemFunctions
Global: true
Script:
function getSCAttachmentCount() {
var length;
try {
length = angular.element("#sc_cat_item").scope().attachments.length;
} catch(e) {
length = -1;
}
return length;
}
2. Select your Portal > Theme(Open the theme and go to the related list section, click JS include tab and click the new UI action).
Create New:- JS Theme
Display Name:- GlobalCatalogItemFunctions
Source:- UI Script
UI Script: GlobalCatalogItemFunctions(Select the UI script that is you created)
function onSubmit() {
//Works in non-portal UI
try {
var attachments = document.getElementById('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none' ) {
alert('You must attach the completed form before submitting this request.');
return false;
}
}
//For Service Portal
catch(e) {
var count = getSCAttachmentCount();
if(count <= 0) {
alert('You must attach the completed form before submitting this request.');
return false;
}
}
}
Attachment for catalog item in Platform and Service Portal is very important part in servicenow. Thank you for given this useful information.
ReplyDeleteThanks for your valuable comments.
DeleteThanks Resma. I'll upload some videos as well as.
ReplyDeleteYour welcome & thanks for your valuable comment!
ReplyDeleteThanks for sharing this post.
ReplyDeleteonline IT support
it is an interesting Article, i read this post that was very nice and useful thanks for sharing it.
ReplyDeleteonline training website
Thanks for your valuable comment :)
DeleteThanks for sharing this information!
ReplyDeleteI totally agree with you. Your information is very interesting and important. I really like this information.
Our easy is servicenow online training in hyderabad
If you want to see our training venue then click on links:
https://www.futureqtech.com/servicenow-online-training.php
Call Now: +91 9581111796
Drop Mail: info@futureqtech.com
Thank you for providing this kind of useful information,I am searching for this kind of useful information. it is very useful to me and some other looking for it. It is very helpful to who are searching servicenow.servicenow training in bangalore
ReplyDeleteThanks for sharing valuable information. Explanation is in very detailed thanks once again.
ReplyDeleteservicenow now learning
servicenow certification
Thanks for sharing valuable information and very well explained. keep posting.
ReplyDeletebest servicenow online training
servicenow developer training online
Very nice article,keep sharing it more.
ReplyDeleteThank you.
ServiceNow Online Training in Hyderabad
This comment has been removed by the author.
ReplyDeleteThank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeleteServiceNow Training in Bangalore
Thank you for your post. Written a Very nice article . It is amazing and wonderful to visit your site.
ReplyDeleteI hope this Servicenow link will help to all users.
Thank you for your post. Written a Very nice article this is very informative. It is amazing and wonderful to visit your site.
ReplyDeleteI hope this Servicenow link will help to all users.