Abort the scheduled data import through Pre-script script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:52 AM
I need to abort the scheduled data import from Excel, based on checking headers of imported Excel sheet.
From Below script I'm able to get the headers name in system logs but cannot find a funtion which I can call inside the if(header1 != 'Allocation Logic') to abort the import submission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 08:19 AM
Then something else is not working. I have just did a test to confirm this.
I used script:
Every time I hit "Execute Now", new rows are added to the import set row table.
I change the script to:
and no matter how many times I press "Execute Now", no new rows are added to the import set row table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 01:07 PM
Consider what to do if that query on line 25 doesn't find anything. I think you want to abort the import in that case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 01:32 PM
In the "Transform Scripts" related list, create an onStart transform script, move your code in there, and use either
ignore = true;or
error = true;to stop the transformation if your header check condition is not satisfied.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 06:36 AM
Hi @Slava Savitsky This will ignore the imported data to insert in the table but the requirement is to restrict the data source execution while importing excel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 09:06 AM
Here is what product documentation says about conditions in scheduled jobs:
Try adding the following to your code as the last line:
answer;
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
