I have added a button to the UD10 screen to go get the inventory amount for the part and lot selected and put it in UD10.Number05. The button works the first time I press it. If I change the lot number and press it again I get the popup box that the contextbpmdata has been changed to Inventory but the data in the field doesn’t change.
Button Code: I had to comment out the RowMod to get it to fire at all. Can I set it to look for Updated OR added rows?
private void epiButtonInventory_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
//edvUD10.dataView[edvUD10.Row]["RowMod"]="U";
edvCallContextBpmData.dataView[edvCallContextBpmData.Row]["Character01"] = "Inventory";
oTrans.Update();
}
BPM code that fires if CallContextBpmData.Character01 = Inventory
// get temp table for updated UD10 record
var NewRecord = ttUD10.FirstOrDefault();
//get quantities from partbin table
decimal thisOnHandQty =
Db.PartBin.Where(x=>
x.Company == Session.CompanyID &&
x.PartNum == NewRecord.Character01 &&
x.LotNum == NewRecord.Character02).Sum(x => x.OnhandQty);
NewRecord.Number05 = thisOnHandQty;
callContextBpmData.Character01 = "";