Addition of values not working as expected
Hi,
I have a form1 with fields say Id,Name and Type and Quantity, Quantity available then form2 with fields say ID,Name,Type,Quantity,Quantity Sold and Quantity in stock. Based on the type given in form quantity available will be listed. What i want to do here is , On success of form 1 i have written a code to fetch the form 2 field with current form1 fields, If their type and name is equal then add Form2.Quantity =Form1.Quantity+form2.Quantity.
- rec = Form2[Event_ID == input.Event_ID.toString() &&Type == input.Type];
- rec.Quantity_Sold = rec.Quantity_Sold + input.Quantity.toLong();
This code doesn't affect records. I don't know what I am missing. Help me sort out the issue.