Copy results of a smartobject list into an smartbox


Badge +1

Hi,

 

I have a problem where I want to retrieve all the rows of customers and purchases (two tables with a 1-n relationship) and bulk the join result on a SalesDetail table where I want to do some calculations. My problem is that I don't know how to do that easy bulking action in K2.

 

Could you help me?

 

Thanks !


3 replies

Badge +7

Where does your data currently reside?  

 

If it's currently in SQL, then joining or bulking of the two tables might be best handled from a stored procedure from within SQL then making that available to K2.  You could then create a list view that would diplay all of your relevant data and even add some calulations to that list view in extra columns. 

Badge +1

Hi Daeme,

 

thanks, but the point is that I want those three tables and even doing the query directly on the database, my doubt is how to call a getList from a composite smartobject or a simple smartobject, and make some calculation on each row and store the result.

 

It seems so simple on conventional languages and so complex on K2.

 

Greetings,

Badge +7

RM,

 

The SmartObject concept isn’t too bad…I actually enjoy building out a new SmartObject within K2 (called SmartBox) to handle specific scenarios that would work out kinks that involved working with an in-house DBA and her stored procedures.  I had trouble with the composite SmartObjects until I got the simple ones down. 

 

Take a look at this documentation:  SmartObjects

 

Basically you can build your tables under the K2 database by building out a SmartBox project in Visual Studio.  If you build a standard K2 project, all of the methods are pre-defined in the template and it will become available when you publish it out to your K2 server.

 

If you’d like to see a demo of something specific, I’ll put up some screen shots.  It takes about 5 - 10 minutes to build a SmartObject project that is ready for data.

Reply