The CreatorCon Call for Content is officially open! Get started here.

how to clear the cache in scoped application using script?

Community Alums
Not applicable

hi Developers I am able to clear the cache via script using ga.cacheFlush(); in global scope but same cannot use in scoped Application

Can anyone suggest any alternative for clearing cache via code in scoped Application

thanks in advance

Regards 

harsha

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Harsha,

try this

Running gs.cacheFlush(); in the Scripts - Background module

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Hi Ankur

it is showing that cacheFlush() function is not allowed in scoped application,while we run that in background scripts.

Regards

Harsha

Hi Harsha,

you can try creating a script include in global scope which is accessible from All application scope and then call that script include function

But I would like to understand what is the requirement to clear the cache using script.

Haven't come across that much earlier.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Pratiksha Kalam
Kilo Sage

Hello,

Have a look on this,

cache issues

Steps to determine the cause of a cache flush

 

 

If answer is helpful please mark correct or helpful!

Thanks,

Pratiksha