Input parameters on views

  • 10 September 2012
  • 4 replies
  • 2 views

Badge +4

Hello,


I have a View that executes, when is initialized, a List SmartObject method (T-SQL Procedure) that requires some inputs to be passed.


Since the View is used in a form, these inputs should come from this form.



What I am doing now is:


1. In the form, I disable the view initialized method.


2. I create the action Execute a View method and here I fill in the list method inputs with form data.


 


Is there any best approach of doing this without having to disable the view initialized method ?



I don't find anyway of creating View input parameters, so I can assign these inputs to the List method and then, configure the View input parameters on the form.


 


Thank you,


Tiago Calado


 


4 replies

Badge +5

For what it is worth,


I leave the Initialize action alone and follow it with the "Hide a view" action.  That way later on when I need it, I just use the "Show a View" action and it is ready and waiting for me.


 

Badge +2

tcalado,


 


I've struggled with the same.
You're able to create properties on your ofrm, but their's no way to modify them.
I'assume you want execute the SQL procedure with parameters from your first view.


Those parameters will probably change al the time?


Sebastian

Badge +3

Hi Tiago


There are quite a few ways for you to configure this setup.


1) If the values for the method are static and if they'll always be the same, they can be hardcoded on SmartObject level. Meaning that there won't be any parameters for which you need to specify values on higher level and/or at runtime.


2) If the values are dynamic, they need to be configured on either View or Form level.


2.a) If the way in which these values are obtained is always the same for this View, it can be configured from View level. That will ensure that all instances of this View will always function in this manner, even if the View is used on a Form.


2.b) If these values however are not the same for all instances of this View, it will need to be configured from Form level. Best practice would be to edit the default "Form initialized" Rule, and disable the Action populating the View. You would then have to configure a new custom action in order to populate the View in this instance. This will ensure that other instances of this View are not impacted in any way.


Kind regards,


Eugene

Badge +4

Hi Gener,


 


I have implemented the 2.b)


 


Thank you,


Tiago

Reply