how to trigger a script include from background script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 08:20 AM
I have faced one interview question recently that create a script include with two functions f1 and f2 in which you have to find difference between created on and resolved fields .if you call function 2 in the background script and run then the difference have to come as result .
can anyone please explain how to trigger a script include from background script and in which situation you have to use glide record object in background script to trigger the script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 08:34 AM - edited 12-24-2023 08:37 AM
@Kongaleti Navee : you should use the below syntax to call script includes from any server code (business rules, back ground scripts or etc)
new YOUR_SCRIPT_INCLUDE_NAME().YOUR_FUNCTION_NAME()
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 08:40 AM - edited 12-24-2023 08:42 AM
Please see the below syntax to call script include from background script:
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 08:53 AM
Hello @Kongaleti Navee ,
Please refer the syntax below to call the script include from background script.
new ScriptIncludeName().functionName();
Let me know your views on this and Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 09:51 AM
Hi, you can use like below
var x = new script_include_name();
x.function_name();
Suresh.