Skip to main content
Nintex Community Menu Bar

Howto reuse code or logic on a smartform.


Forum|alt.badge.img+1

I am working on some K2 solutions that rely heavily on SmartForms. When building these forms, I usually find that I need to reuse some parts such as logic. What I do now is that I create a button, and place all of that logic 'behind' that button. Next I hide that button. On the locations that I want to implement that logic, I connect to that hidden button.

 

Basically, what I need is what is referred to as a function in other languages. What would be the best way to do this in SmartForms.

Translate
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+10
  • 145 replies
  • February 8, 2017

So this is one of the perfect examples where Global Variables, Global Expressions, Global Outobound Rules, and why know Global Code Solutions could be shared among the Views/Forms and reused globally.

 

Nice thinking... I wanted to have some of those but unfortunatelly does not exist. perhaps could be a good product enahancement.

 

Now tipically is suggested to create Button Item View with dummy controls for buttons and have all your actions among states, or steps of your process. you can setup some params to initialize and just display the right buttons depending on the initializacion view. this is basically just a place holder for your forms.

 

Depending on the Form in question you will enable "When a Control View execute and Event" and give the buton the power to do something else.

 

Hope this helps !!!.

Translate

Forum|alt.badge.img+4
  • 26 replies
  • February 23, 2017

Have you looked at using unbound rules?  It's basically the same as what you are doing without the need to add a button to the form/view.  You simply create a new rule, give it a name, and add your conditions/actions.  No need for a triggering event.

Translate

Forum|alt.badge.img+9
  • 104 replies
  • February 24, 2017

Questiom here is how to reuse the same rule in the different form, just like we do copy-paste in code behind. Is it possible to create a reusable rule, like biding the rule in the button and use that control in different views/forms. Thanks. What is the best practice of externatilzing the rules so that it can be reusable.

Translate

create one new view write all business logic here , call this view where you required in your forms

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings