- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 11:46 AM
Hi,
I have created an UI action where it will attach a file in a datasource. I have created a schedule import as well.
Now i want to execute the schedule import whenever attachment added in the particular datasource.
I have created an Business rule in sys_attachment table and condition mentioned is
Tablename is sys_data_source
tablesyid is " Sysid"
code mentioned is
(function executeRule(current, previous /*null when async*/ ) {
var rec = new GlideRecord('scheduled_import_set');
rec.get('name', 'upload attachment');
if (typeof SncTriggerSynchronizer != 'undefined')
gs.executeNow(rec);
else
Packages.com.snc.automation.TriggerSynchronizer.executeNow(rec);
})(current, previous);
Now i'm getting message like:
Remove Package calls from script
: Replace the Package call with the appropriate GlideScriptable class.
Please let me know how to execute schedule import through Business rule.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 05:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 07:32 PM
@ram11vrnr Try below if it works for you,
Drop all of the prefix terms, leaving only the last. For example, Packages.com.snc.automation.TriggerSynchronizer.executeNow becomes TriggerSynchronizer.executeNow
For more details refer : Package
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2023 10:00 PM
Hi Abhay,
Thanks for the update. I'm getting an error message when i'm trying to add attachment. Please let me know how to fix this,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 05:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2023 08:41 PM
Hi @ram11vrnr
Try this
var importGr = new GlideRecord('scheduled_import_set');
if (importGr.get(ImportSetSysID) {
gs.executeNow(importGr);
}