This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to get Multiple value in Method just like gridview or list view .

Pankaj Thakur - Tuesday, April 23, 2013 7:41 AM:

Hello,
    I create a method for send mail automatically.  now I want to send all value through this method.

Suppose abcd is an itemtype & its have 2 property name1 & name2 . Now I want to show all the values through method Ex:- 


Item abc = inn.applySQL("Select * from innovator.abcd");

Is that any way to fetch all the value of name1 & name2 .

is that any way to store multiple value in method just like grid view, list view etc. ?



Brian - Friday, May 3, 2013 12:30 PM:

HI Pankaj,

inn.applySQL(...) returns an Item or collection of items.

See section 7.17 of the programmers guide.

But basically:

Item result = inn.applySQL("Select * from innovator.abcd");

for (int i = 0; i < result.getItemCount(); i++){

    Item itm = result.getItemByIndex(i);

    string name= itm.getProperty("name","");

    string descrip = itm.getProperty("description","");

  //etc.

}

An Item object can hold more than one record.

You should be familiar with itm.getItemCount(), itm.getItemByIndex(), itm.isCollection(), itm.isError()

Hope this helps,

Brian.



Pankaj Thakur - Saturday, May 4, 2013 6:04 AM:

Hello Brian Sir,

      Thanks for the reply . Its work.





Thanks & Regards
Pankaj Thakur