RCVDetail OurUnitCost wont change

I’m trying to get RcvDtl.Ourunitcost to update through a function.

I’ve tried just about every way I can think of via code, here is what I’ve done so far:

decimal proposedDocUnit = decimal.Round(newUnitPrice / dtl.OurQty, 4);
dtl.AllowUpdSuppPrice = true;
dtl.RowMod = “U”;

string msg;
rcvBO.CheckSupplierPrice(ref rcvTS, vendor, PurPoint ?? "", PackSlip, (int)dtl.PackLine, proposedDocUnit, out msg);

string q = "", s = "", lc = "", pc = "";
rcvBO.CheckDtlBeforeUpdate(rcvTS, vendor, PurPoint ?? "", (int)dtl.PackLine, PackSlip, out q, out s, out lc, out pc);

anyChanges = true;
bool requiresUserInput = false;
rcvBO.PreUpdate(ref rcvTS, out requiresUserInput);
rcvBO.Update(ref rcvTS);

This seems to do nothing, this was my attempt at following the trace log when updating supplier price, it automatically changed ourunitcost.

This was my other attempt, manually setting it.

dtl.AllowUpdSuppPrice = true;
dtl.DocInVendorUnitCost = priceperPart;
dtl.DocUnitCost = priceperPart;
dtl.DocVendorUnitCost = priceperPart;
dtl.OurUnitCost = priceperPart;
dtl.RowMod = “U”;
string q = “”, s = “”, lc = “”, pc = “”;
rcvBO.CheckSupplierPrice(ref rcvTS, vendor, PurPoint ?? “”, PackSlip, (int)dtl.PackLine, priceperPart, out q);
rcvBO.CheckDtlBeforeUpdate(rcvTS, vendor, PurPoint ?? “”, (int)dtl.PackLine, PackSlip, out q, out s, out lc, out pc);
anyChanges = true;
bool requiresUserInput = false;
rcvBO.PreUpdate(ref rcvTS, out requiresUserInput);
rcvBO.Update(ref rcvTS);

This changed all otehr variables, like docvendorunitcost, docunitcost, etc to the right price, but left ourunitcost alone.

No matter what, I cant seem to get it to change, has anyone had success?

I’m not at my computer to verify the dataset but these are required for the PODetail dataset to update the price.. ScrUnitCost and DocScrUnitCost.

It might be the same.

I don’t see either in the dataset, I think the only cost one I skipped was “DocInUnitCost” because in existing records it was 0.00 so I skipped it in this.

I was wrong, it had “DocScrUnitCost”. I havent tested it yet though, I basically went through and added everything I saw in trace that had the old cost, and changed that. Hoping that will work, but if anyone else has ideas please let me know.

dtl.AllowUpdSuppPrice = true;
dtl.AllowLCUpdate = true;
dtl.DocScrUnitCost = priceperPart;
dtl.VendorUnitCost = priceperPart;
dtl.ScrOurUnitCost = priceperPart;
dtl.DocScrVendorUnitCost = priceperPart;
dtl.ScrVendorUnitCost = priceperPart;
dtl.DocInVendorUnitCost = priceperPart;
dtl.DocUnitCost = priceperPart;
dtl.DocVendorUnitCost = priceperPart;
dtl.OurUnitCost = priceperPart;
dtl.RowMod = “U”;
string q = “”, s = “”, lc = “”, pc = “”;
rcvBO.CheckSupplierPrice(ref rcvTS, vendor, PurPoint ?? “”, PackSlip, (int)dtl.PackLine, priceperPart, out q);
rcvBO.CheckDtlBeforeUpdate(rcvTS, vendor, PurPoint ?? “”, (int)dtl.PackLine, PackSlip, out q, out s, out lc, out pc);
anyChanges = true;