How to Check attachment attached or not on submit client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 11:14 PM
Hii All
i need to check attachment has attach or not by using on submit client script
like i make one catalog item in that i want to check that this catalog item has attachment or not
i try many thing but no luck
your help highly appreciated
thanks and regards
Dheerendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 11:45 PM
Hi @dheeru_1994
I tried your problem on my instance and I got the solution, you can check the below got it's working for me
function onSubmit() {
//Type appropriate comment here, and begin script below
var sysid = g_form.getUniqueValue();
alert("Check id = " + sysid);
var attachGR = new GlideRecord('sys_attachment');
attachGR.addQuery('table_sys_id', sysid);
attachGR.query();
if (attachGR.next()) {
alert("form contains attachment");
}else{
alert("No attachment ");
return false;
}
}
Please mark correct and helpful if it's works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 11:59 PM
Sir
apki script chal rahi hai par client side pe glide record hum use nahi karte hai or bhi hum isko kis tareeke se get kar sakte hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 12:04 AM
Thanks for replay,
This glideRecord is only for checking if the entry got in sys_attachment table or not for the attachment. If not than we simply return false, so the form would not be saved.
Can you please tell me what you want to get ?
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 12:18 AM
if any other way to get this same requirement with on submit client script
what if some one reject that i do not want to use glide record