April 9, 2015

List of Values - Clear Cache using eScript

There are 2 ways we can do Clear Cache using eScript:

1) By invoking method "ClearLOVCache" of "List Of Values" BC

  • This method can be used with button controls on any applet based on BC "List Of Values", since this method is available under the business component "List Of Values".

  • This method can also be invoked from other Applet, BC, BS scripts by using below code. 
    var oBO = TheApplication().GetBusObject("List Of Values");
    var oBC = oBO.GetBusComp("List Of Values");
    oBC.InvokeMethod("ClearLOVCache");


2) By using OOTB Business Service (Undocumented)

  • Business Service Details
    • BS Name: LOV Cache Clear Service
    • Method: Activate (This method does not require any input arguments which is logical)

  • Code sample below:
    var bsSvc = TheApplication().GetService("LOV Cache Clear Service");
    var psIn = TheApplication().NewPropertySet();
    var psOut = TheApplication().NewPropertySet();
    bsSvc.InvokeMethod("Activate", psIn, psOut);

  • This Business Service also has another method 'RestoreActivate', use of which is not known to me yet.

  • I also found out that Application Deployment Manager (ADM) invokes this business service to clear LOV cache after the deployment.

No comments:

Post a Comment