K2 SmartForms

SmartObject Properties vs Method Parameters

SmartObject Properties vs Method Parameters

When assigning the method bindings of our new SmartObject method. The question is:

When do we need to create and use SmartObject method parameters?

And when do we need to create and use SmartObject properties?

smartobject properties vs method parameters

K2 provides you with four options for bindings, SmartObject property, SmartObject method parameter, Specific value and System value as shown above. In most cases you will be able to use the existing SmartObject properties. But if your method requires additional input parameters you will have to create SmartObject method parameters and map them accordingly.

smartobject properties vs method parameters

The parameter will then serve as placeholders that you will be able to assign data to on the Input Mappings screen when you configure your method call as below.

smartobject properties vs method parameters

On the other hand, you will note that if you would assign the return property to a SmartObject method parameter as the one below:

smartobject properties vs method parameters

There will be no return property to select in the Context Browser.

smartobject properties vs method parameters

If you use a SmartObject property instead:

smartobject properties vs method parameters

You will now see that you can select it as a return property in the Context Browser.

smartobject properties vs method parameters

So to summarize, you can only use SmartObject method parameters when you are assigning the bindings to your method input properties. On the return properties you will then need to use a SmartObject property to be able to select it in the Context Browser.

 

 

You may also like

Leave a comment

PODCAST  |  Why you need to establish a K2 Center of Excellence today

Interview with Arno van Rooyen, CEO, Velocity