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

GorkemSenol
New Contributor III

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.

GorkemSenol_0-1710515116285.png

_______________________

GorkemSenol_1-1710515171135.png

Any help is appreciated

 

 

 

 

 

 

1 ACCEPTED SOLUTION

RobbSalzmann
Valued Contributor

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

RobbSalzmann_0-1710531980731.png

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

RobbSalzmann_1-1710532123508.png

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_2-1710532211152.png

 

View solution in original post

4 REPLIES 4

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.

RobbSalzmann
Valued Contributor

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

RobbSalzmann_0-1710531980731.png

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

RobbSalzmann_1-1710532123508.png

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_2-1710532211152.png

 

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?

 

 

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