Forum Discussion
I assume you just get the very plain items without properties. Use the "get" command and combine it with and combine it with a "select" to reduce server load.
Item Man_Part_List = inn.newItem("Manufacturer Part","get");
Man_Part_List.setAttribute("select","item_number");
---
You liked this answer? Subscribe to my Youtube channel to learn even more about PLM --> PLM Underground on Youtube
- nchagan5 years agoIdeator I
Changed the code use "get' command and combined it with "Select". Still didn't worked.
Item Man_Part_List = inn.newItem("Manufacturer Part", "get");
Man_Part_List.setAttribute("select","item_number");
Man_Part_List.setAttribute("where", "[Manufacturer_Part].IS_CURRENT= '1'");
Man_Part_List = Man_Part_List.apply();- angela5 years agoCatalyst II
It should work. I was able to use this one successfully in my test db:
Innovator inn = this.getInnovator();
Item Man_Part_List = inn.newItem("Manufacturer Part", "get");
Man_Part_List.setAttribute("select","item_number");
Man_Part_List.setAttribute("where", "[Manufacturer_Part].IS_CURRENT= '1'");
Man_Part_List = Man_Part_List.apply();
for (int i = 0; i < Man_Part_List.getItemCount(); i++)
{
Item cur_man_part = Man_Part_List.getItemByIndex(i);
string cur_man_part_name = cur_man_part.getProperty("item_number"); //cur_man_part_name always returns NULL
return inn.newResult("My test result: " + cur_man_part_name);
}---
You liked this answer? Subscribe to my Youtube channel to learn even more about PLM --> PLM Underground on Youtube
- nchagan5 years agoIdeator I
It is weird. I used the same code on my environment and for me it returns NULL.The only change is, am using newError instead of newResult but that should not make any difference.
return inn.newError("My test result: " + cur_man_part_name1);