How can i update BOM table

How can i update value in BOM table by using groovy script.

I tried below script to update but its not working.
obj.setValueByAttId(ItemConstants.ATT_BOM_BOM_NUMERIC03,”3″);

Please let me know how can i update..

Thanks in Advance…

Add Comment
2 Answer(s)

You can try something like this.

ITable affTable= item.getTable(ItemConstants.TABLE_BOM);
Iterator it1=affTable.iterator();
while(it1.hasNext())
{
IRow row=(IRow) it1.next();
ICell cell = row.getCell(ItemConstants.ATT_BOM_REF_DES);
System.out.println(“The Ref Des is: ” + cell.getValue().toString());
cell.setValue(“Test11”);
}
}

It worked for me.

Agile Angel Answered on March 9, 2016.
Add Comment

ITable affTable= item.getTable(ItemConstants.TABLE_BOM);
Iterator it1=affTable.iterator();
while(it1.hasNext())
{
IRow row=(IRow) it1.next();
ICell cell = row.getCell(ItemConstants.ATT_BOM_BOM_TEXT01);

def v2 = row.getCell(ItemConstants.ATT_BOM_BOM_NUMERIC01).toDouble();

v3 = (v1.multiply(v2)).toString();

cell.setValue(v3);
}

In above code when i define
def v2 =  obj.getValueByAttId(ItemConstants.ATT_BOM_BOM_NUMERIC01).toDouble();

It fetches the value from last bom Table and performing multiplication.

when using def v2 = row.getCell(ItemConstants.ATT_BOM_BOM_NUMERIC01).toDouble();

We are getting bellow exception.
No signature of method: com.agile.api.pc.CellRedlined.toDouble() is applicable for argument types: () values: {}

Please help me how can i fix this.

Thanks in Advance……

Agile User Answered on March 10, 2016.

cell.getValue().toDouble()

on March 10, 2016.

Thanks,It’s Working…
You saved me lot of work..

on March 11, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.