Skip to Main Content
Spotfire Ideas Portal
Status Already exists
Product Spotfire
Categories API
Created by Guest
Created on Sep 25, 2018

Allow setting of the AllowCaching flag for the DataFunctionDefinition class via the API

I've built an extension that creates custom data functions and allows the user to edit them. I'd like to be able to alter the 'AllowCaching' setting, but the only public API method for setting the value is on the DataFunctionDefinitionBuilder class - so I can only set the value when I first create the DataFunction and cannot alter it thereafter.

  • ADMIN RESPONSE
    Oct 3, 2018

    The DataFunctionDefininition is an immutable class by design, but settings such as 'AllowCaching' can be changed by replacing the current DataFunctionDefinition instance:

    var dfd = df.DataFunctionDefinition;
    var builder = new DataFunctionDefinitionBuilder(dfd);
    builder.AllowCaching = ...;
    df.DataFunctionDefinition = builder.Build();
  • Attach files
  • Guest
    Reply
    |
    Oct 29, 2018

    Thanks - I hadn't realised I could change the DataFunctionDefinition property to a new one (seems a little odd, but works :)).