Generating smartobject

  • 19 June 2014
  • 1 reply
  • 3 views

Badge +1

Hi,

 

I generated c# class with smartobject service tester tool, and opened in visual studio. I want to know if it is possible to code my own getList method and generate new smartobject with that class. 


1 reply

Badge +7

I just experimented with that as well.  I didn't know you could build a class from the tester tool...pretty cool.

 

Can you extract the existing GetList method and create a new project and deploy that to your K2 server?

 

public DataTable GetList() {

// Set method to execute
_smartObject.MethodToExecute = "GetList";

// Assign Input properties
if (AutoID != null)
{
SetPropertyValue(_smartObject.ListMethods["GetList"].InputProperties["AutoID"],AutoID);
}
if (Start_Time != null)
{
SetPropertyValue(_smartObject.ListMethods["GetList"].InputProperties["Start_Time"],Start_Time);
}
if (End_Time != null)
{
SetPropertyValue(_smartObject.ListMethods["GetList"].InputProperties["End_Time"],End_Time);
}
if (PTOID != null)
{
SetPropertyValue(_smartObject.ListMethods["GetList"].InputProperties["PTOID"],PTOID);
}

try
{
SmartObjectClientServer soServer = CreateConnection();

// Execute SmartObject
using (soServer.Connection)
{
return soServer.ExecuteListDataTable(_smartObject);
}

 

 

 

 

 

 

Reply