Add script include to global scope from store scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 09:18 PM
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
- Labels:
-
Architect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 10:51 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 01:41 AM - edited 08-22-2023 11:31 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 04:53 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2023 10:49 AM
Hello Pethum,
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.
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,