Forum Discussion

GorkemSenol's avatar
GorkemSenol
New Contributor III
10 months ago

How to call a dashboard extender function from a Spreadsheet type BR?

Hi,

I have a Spreadsheet BR that creates a tableview and I want a certain dashboard extender function to be triggered when they submit the data from the tableview(spreadsheet)

I think this is the way to go but probably because of the namespace, I cannot do this definition. See the screenshot at the bottom.

_______________________

Any help is appreciated

 

 

 

 

 

 

  • Here's how I do it: 

    Create a public class in your Dashboard extender with a/some public methods:

    Note the namespace, class name, and method name(s) you want to use elsewhere

    In your spreadsheet rule's Properties, add a reference to your dashboard extender's namespace, quirky, just the part after the last dot:

    Now you can code to the class and its methods in your spreadsheet rule.  Import the full namespace of the extender rule, and then reference the class by its name.  Instantiate it to use its methods:

     

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Here's how I do it: 

    Create a public class in your Dashboard extender with a/some public methods:

    Note the namespace, class name, and method name(s) you want to use elsewhere

    In your spreadsheet rule's Properties, add a reference to your dashboard extender's namespace, quirky, just the part after the last dot:

    Now you can code to the class and its methods in your spreadsheet rule.  Import the full namespace of the extender rule, and then reference the class by its name.  Instantiate it to use its methods:

     

    • GorkemSenol's avatar
      GorkemSenol
      New Contributor III

      Hi Robb,

      This is gold, thanks a lot.

      Do you think I can reference to the MainClass in the Extender Rule rather than ExtraFunctions in your example? I guess that is creating a problem for me since MainClass is also being used in the Spreadsheet rule right?

       

       

      • RobbSalzmann's avatar
        RobbSalzmann
        Valued Contributor II

        GorkemSenol  yes.  Access MainClass the same way.  
        Reference the rule your MainClass is in and then instantiate and use it.

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    Intellisense will never pick up any custom Business Rules, it's one of the very few places where it cannot help.

    Just type in the namespace you need, making sure you added it to the Referenced Assemblies field of the rule first (in Properties tab). Note that, if you're in version 7.3+ and using custom Workspaces, there are a few more pitfalls.