how to trigger a script include from background script

Kongaleti Navee
Tera Contributor

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

5 REPLIES 5

Sainath N
Mega Sage
Mega Sage

@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.

Unique45
Mega Sage

@Kongaleti Navee ,

Please see the below syntax to call script include from background script:

Pratiksha_PP_1-1703436106599.png

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

Please mark correct/helpful if this helps you!

Aniket Chavan
Tera Sage
Tera Sage

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

ersureshbe
Giga Sage
Giga Sage

Hi, you can use like below 

var x = new script_include_name();

x.function_name();

Regards,
Suresh.