Firstly updating an existing cache object can be done just as easily as the rest of the work with cache :
// declare a cache id - in real life we would have this from somewhere else Integer cacheID=1234 // load the data from the cache to begin with into the Assoc Assoc myDataFromCache = $LLIAPI.CacheUtil.Load (prgCtx,cacheID).ObjectValue // update the values myDataFromCache.newValue="abc" // Save the updated Assoc back to the cache Assoc updateCacheResult=$LLIApi.CacheUtil.Update(prgCtx, cacheID, myDataFromCache ) // if the cache update failed if (!updateCacheResult.OK) // write out to the log the value of errMsg if provided, otherwise apiError if provided, otherwise a default error message (isDefined(updateCacheResult.errMsg)) echo(updateCacheResult.errMsg) elseif ((isDefined(updateCacheResult.apiError))) echo(updateCacheResult.apiError) else echo("error deleting cache")) end endLater when we have finished with our Cache object we need to delete the cache object :
// declare a cache id - in real life we would have this from somewhere else Integer cacheID=1234 // Delete the cache Assoc deleteCacheResult=$LLIApi.CacheUtil.Delete(prgCtx, cacheID) // if the cache deletion failed if (!deleteCacheResult.OK) // write out to the log the value of errMsg if provided, otherwise apiError if provided, otherwise a default error message (isDefined(deleteCacheResult.errMsg)) echo(deleteCacheResult.errMsg) elseif ((isDefined(deleteCacheResult.apiError))) echo(deleteCacheResult.apiError) else echo("error deleting cache")) endMore information can be found in the Builder On Line Help - <builder virtual directory>/documentation/moddevguide/mdg_cacheutil.html showing a worked example and more information.