I have a subform where I add quantity distributed or quantity returned in inventory. The total on hand is part of the subform and I have it populated with the queantity on hand.
if(SubForm.Quantity_to_Distribute != null)
{
x = Add_New_PPE[ID == input.SubForm.Select_PPE_Description];
x.Total_On_Hand=input.SubForm.Total_PPE_On_Hand - input.SubForm.Quantity_to_Distribute;
}
else if(SubForm.Quantity_to_Return != null)
{
x = Add_New_PPE[ID == input.SubForm.Select_PPE_Description];
x.Total_On_Hand=input.SubForm.Total_PPE_On_Hand + input.SubForm.Quantity_to_Return;
}
The workflow to populate the subform isif(Add_New_PPE[ID = input.SubForm.Select_PPE_Description].count() != null)
{
x = Add_New_PPE[ID == input.SubForm.Select_PPE_Description];
input.SubForm.Total_PPE_On_Hand = x.Total_On_Hand;
input.SubForm.PPE_Restock_Level = x.PPE_Restock_Level;
input.SubForm.Unit_dispensed = x.Unit;
}
And it it works for the first item. When I add a second or sunsequent items in the subform, the total on hand doesn't populate. Any ideas?