I have tried that but it doesn't seem to work.
Following is the code i tried.
for each Stock_Record_Obj in input.Fabric_Details
{
//fetch fabric stock record by using the ID of the record from the lookup field
product_Obj = Fabric_Stock[ID = Stock_Record_Obj.Design_No];
//check if a fabric stock record exists
if(product_Obj.count() > 0)
{
//fetch fabric shade record by using the ID of the record from the lookup field
product_Shade_Obj = Fabric_Stock[ID = Stock_Record_Obj.Shade_No];
//check if a fabric shade record exists
if(product_Shade_Obj.count() > 0)
{
//update the records meter
product_Obj.Meter=product_Obj.Meter - Stock_Record_Obj.Meter;
}
}
}