store app development

ratnaj
ServiceNow Employee
ServiceNow Employee

I need to make my store app add an entry to  sys_service upon installation. How can I achieve it?

1 ACCEPTED SOLUTION

Shaqeel
Mega Sage

Hi @ratnaj 

 

You need to add a script in "Scripted Application Install Exit" for your application,

(function install() {
var gr = new GlideRecord('sys_service');
gr.initialize();
gr.name = 'Your Service Name';
gr.description = 'Your Service Description';
gr.insert();
})();

After this don't forget to publish.

 

Regards

Shaqeel 


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

View solution in original post

4 REPLIES 4

shyamkumar VK
Kilo Patron

@ratnaj , do you want to publish your app into ServiceNow store??

if not can you elaborate your ask

Regards,

Shyamkumar

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Shaqeel
Mega Sage

Hi @ratnaj 

 

You need to add a script in "Scripted Application Install Exit" for your application,

(function install() {
var gr = new GlideRecord('sys_service');
gr.initialize();
gr.name = 'Your Service Name';
gr.description = 'Your Service Description';
gr.insert();
})();

After this don't forget to publish.

 

Regards

Shaqeel 


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

ratnaj
ServiceNow Employee
ServiceNow Employee

Thanks Shaqeel.

Hi @ratnaj 

 

Kindly mark Helpful 🙂

 


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel