I thought this would be easy. I’ve worked with UD fields on many other tables and BPMs. But this one is acting up on me.
I am trying to set FreeShipping_c to be true on a BPM through the BO method. I have an in-trans DD on ShipDtl that when a new row is added, I look up the order info associated to it and if it meets certain criteria, we check the free shipping checkbox.
Everything seems to work OK but it just doesn’t check the box. I have tried CustShip.Update and UpdateMaster. Neither one seems to work. I added in an extra method that I saw being called in the trace before the UpdateMaster, CheckPCBinOutLocation. Still no luck. No errors either. Just doesn’t work.
var shipInfo = (from s in ttShipDtl
where s.Company == callContextClient.CurrentCompany
orderby s.PackLine ascending
select s).FirstOrDefault();
if (shipInfo != null)
{
var packNum = shipInfo.PackNum;
message += packNum.ToString() + "\n";
Erp.Contracts.CustShipSvcContract boCustShip = null;
Erp.Tablesets.CustShipTableset dsCustShip = new Erp.Tablesets.CustShipTableset();
boCustShip = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.CustShipSvcContract>(Db);
try
{
dsCustShip = boCustShip.GetByID(packNum);
var shipHead = (from n in dsCustShip.ShipHead
where n.PackNum == packNum
select n).FirstOrDefault();
if (shipHead != null)
{
shipHead["FreeShipping_c"] = true;
message += shipHead["FreeShipping_c"].ToString() + "\n";
//shipHead.RowMod = "U";
bool belongToAnotherPC;
int lineNum;
string pcOutsideMessage;
boCustShip.CheckPCBinOutLocation(ref dsCustShip, out lineNum, out belongToAnotherPC, out pcOutsideMessage);
string opReleaseMessage;
string opCompleteMessage;
string opShippingMessage;
string opLotMessage;
string opInventoryMessage;
string opLockQtyMessage;
string opAllocationMessage;
string opPartsListNeedsAttr;
string opLotListNeedsAttr;
string shipCreditMsg;
string msgg;
string opPostUpdMessage;
bool cError;
bool compError;
bool updateComplete;
bool checkComplianceError;
bool changeStatusError;
bool checkShipDtlAgain;
var btCustNum = shipHead.BTCustNum;
message += btCustNum.ToString();
boCustShip.UpdateMaster(ref dsCustShip, false, false, false, false, false, false, false, packNum, btCustNum, out opReleaseMessage, out opCompleteMessage, out opShippingMessage, out opLotMessage, out opInventoryMessage, out opLockQtyMessage, out opAllocationMessage, out opPartsListNeedsAttr, out opLotListNeedsAttr, out shipCreditMsg, out cError, out compError, out msgg, out opPostUpdMessage, out updateComplete, out checkComplianceError, out changeStatusError, out checkShipDtlAgain);
}
}