Hi,
I have an itemtype A which is having relationship with Itemtype B.
A is having Property X.
B is having Property Y.
Now after creating Itemtype A, i add 2 instance of item B in relationship tab.
My requirement is to update Property X on Itemtype A form using 2 values present in Y of B instance.
I am using below server side code but it is not returing anything.
Innovator inn = this.getInnovator();
Item myPart = inn.newItem("A","get");
myPart.setID(this.getID());
myPart.setAttribute("select","name");
myPart=myPart.apply();
string prevName = myPart.getProperty("name");
//Below query gives sum of 2 B itemtype instances
Item results = inn.applySQL(
" Select Sum(B.Y) from innovator.A A "+
" Inner join innovator.B B on B.SOURCE_ID = A.id"+
" where A.NAME = '" + prevName + "' and A.IS_CURRENT=1 and B.IS_CURRENT=1");
var b = results.getResult();
myPart.setProperty("X",b);
If i am doing it wrong, then kindly suggest how i can achieve it.
Thanks in advance !!