Issue With Advanced SmartObject editing


Badge +3

Hello Guys,

 

Has anyone came with a situation where you are trying to edit an advanced SmartObject and added few new properties and mapped them with the Service Object used? In my case its is breaking the Joins which Smartforms makes at the backend (Converting Innner Join to Cross Join)and started displaying 30k plus rows insttead of 175.

 

Below are the Steps I followed:-

1. Open the SO in Edit mode.
2. In Define Property and Method section go to Method Tab select the method(GetTaskList) and select edit. Attached Screenshot
"STEP1.jpg"
3. Clicked on Assigned button and created a new Property CreatedDate. Press Ok. Attached Screenshot "STEP2.jpg"
4. Mapped the CreatedDate Field of ServiceObject to the SmartObject. Attached ScreenShot "STEP3.jpg"
5. Refreshed the SO through "SmartObject Service Tester" and checked the result. Attached Screenshot "STEP4.jpg". Smartobject has returned multiple unexpected row (around 3k). The result is completely different from the one we get before editing.
6. Screen hot STEP5.jpg". show result before adding new property.

ASSUMPTION:- Ids this is due to K2 is not able to maintain the table joins when we do an edit?

 

 

Thanks

Amit

 


16643i55AE480363B4DE55.jpg
13123iBE9D267CB526D1BA.jpg
14700i37FB378ED7D8E5A9.jpg
10996iEF7886F5B04C1DAF.jpg
11494iFB3FE488EB9E9D23.jpg

3 replies

Badge +8

Have you redefined your join as well?  I have seen K2 get confused in such instances, especially when re-using a field with the same name.  Internally, SmartObject relationships are defined with GUIDs.  When you create/change a data field, K2 will usually create a new GUID, though it doesn't tell you its doing so.

Badge +3

Not Really. If you will see the screenshot I have attached (Step3.JPG). I was only adding a new Property(CreatedDate)  in the existing SmartObject and assigned it from its used Service Object Methods.

 

 It's quite strange as when i implemented the same functionality using StoreProc it give me a desired result. Is it recommended to use Webservices or StoreProc in SmartForms in case of  complicated Logics?

Badge +3

 

The reason why the SmartObject is returning so many results is because SmartForms is not able to create a specific join(link) on the Service Object methods in the K2 designer. SmartForms only does a cross join link, In other words, it will produce rows which combine each row from the first table with each row from the second table. That is why so many results get returned. It is however possible to specify a link(join) like we do using K2 Studio or K2 Designer for Visual Studio, which is absolutely mandatory when creating a List method type with more than one Service Object method types.

Because the SmartObject was created in the K2 Designer one is not able to specify a join(link) between the two Service Object methods, such as specifying a service method link. An example of a service method link which is used to join would be “Matching values in both objects”.

As a workaround, you can create an advanced SmartObject in K2 Studio or K2 Designer for Visual Studio, where is it possible to create a specific link and then use that SmartObject in SmartForms.

Reply