Add script include to global scope from store scoped application

pethumdesilva
Tera Guru

Hi Experts,

 

I'm planning to create a ServiceNow store application, It's a scoped application. there we need to access the global scope file and those files are set the accessible from "This application scope only".

 

As a workaround I'm planning to create a new script include in global scope and set the accessible from "All application scope" so I can access this class from my scoped application.

 

my questions are,

1. Is this the best practice or do we have proper way to do this?

2. When I publish my scoped application to store and someone install this to their instance these dependent global script include created automatically? 

 

Thanks in advance,

Pethum

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @pethumdesilva 

unfortunately you cannot go that way. Your "global" Script Include would not be part of the scoped application you want to publish to the store. 

I cannot recommend any alternatives as you did not provide any details about the underlying business requirement.

Maik

pethumdesilva
Tera Guru

Hello @Maik,

 

Thanks for the reply,

 

My requirement is to create a custom identity provider as a store application, most of the OOB scripts include like "MultiSSO_OIDC_internal" and "OIDC_internal" are in global scope and it's accessible from global scope only, then I can't extend those script include from my scoped application.

 

Do you have any recommendation for this? 

 

Best regards,

Pethum

Chaitali_Vale
Mega Sage
Mega Sage

Hello @pethumdesilva ,

Yes it is best practice to create script include in global application and then set it to the "All application scope". Also whenever that application is installed script include will automatically created. 

 

Please mark my solution as Helpful/Correct, if applicable. 

Thanks & Regards,
Chaitali Vale



Roman88
Giga Contributor

Hello Pethum,

  1. Using a script include in the global scope with "All application scope" access is a common workaround to make global functions accessible to scoped applications. While it's a practical solution, it's essential to document this dependency clearly for future maintainability.

  2. No, dependent global scripts are not automatically created when someone installs your scoped application from the ServiceNow store. Users who install your scoped app will need to manually configure these dependencies by creating the required global script includes and setting their access appropriately. 

Best regards,

BB shortcuts