I am working on upgrading to Kinetic 2025.2 and trying to move a customization on the Sales Order Classic UX to a server function. I was making some progress, but ran into some issues. Currently, my issue is I get the following error when calling SalesOrder MasterUpdate.
{
"HttpStatus": 404,
"ReasonPhrase": "REST API Exception",
"ErrorMessage": "Record for update was not found by its SysRowID value [00000000-0000-0000-0000-000000000000].",
"ErrorType": "Ice.Common.RecordNotFoundException",
"ErrorDetails": [
{
"Message": "Record for update was not found by its SysRowID value [00000000-0000-0000-0000-000000000000].",
"Type": "Error",
"Program": "Epicor.Ice.dll",
"Method": "UpdateRow",
"LineNumber": 1052,
"ColumnNumber": 21
}
],
"CorrelationId": "9b8f551b-697c-4c95-9868-a581d6f947f6"
}
I was getting a new order line, but after adding calls to ChangeSellingQtyMaster and ChangeUnitPrice, the error started. I get this error if I call either Update or MasterUpdate.
My code
CallService<Erp.Contracts.SalesOrderSvcContract>(so =>
{
// Load exisitng order
var soDS = so.GetByID(orderNum);
//Add a new order line
so.GetNewOrderDtl(ref soDS, orderNum);
//Populate the new line
var dtlRow = soDS.OrderDtl.Last();
//var dtlRow = soDS.OrderDtl.First(r => r.RowMod == "A");
dtlRow.PartNum = partNum;
dtlRow.RowMod = "U";
//ChangePartNumMaster out/ref parameters
string replacingPart = partNum;
bool substitutePartExist = false;
bool isPhantom = false;
string uomCode = ""; // returned by the method
string deleteComponentMsg = "";
string questionString = "";
string warningMessage = "";
bool multipleMatch = false;
bool promptToExplodeBOM = false;
string partMessage = "";
string subPartMessage = "";
string explodeBOMerrMessage = "";
string msgType = "";
bool multiSubsAvail = false;
bool runOutQtyAvail = false;
string cMsgTypeSaleable = "";
so.ChangePartNumMaster(
ref replacingPart,
ref substitutePartExist,
ref isPhantom,
ref uomCode,
Guid.Empty,
"",
false,
false,
false,
true,
true,
true,
false,
out deleteComponentMsg,
out questionString,
out warningMessage,
out multipleMatch,
out promptToExplodeBOM,
out partMessage,
out subPartMessage,
out explodeBOMerrMessage,
out msgType,
out multiSubsAvail,
out runOutQtyAvail,
out cMsgTypeSaleable,
ref soDS
);
//dtlRow.LineDesc = partDesc;
dtlRow.OrderQty = partOrderQuantity;
dtlRow.SellingQuantity = partOrderQuantity;
dtlRow.UnitPrice = partUnitPrice;
dtlRow.SalesUM = GetPartUM(partNum);
dtlRow.RowMod = "U";
//ChangeSellingQtyMaster out/ref parameters
decimal ipSellingQuantity = partOrderQuantity;
bool chkSellQty = false;
bool negInvTest = false;
bool chgSellQty = true;
bool chgDiscPer = true;
bool suppressUserPrompts = false;
bool lKeepUnitPrice = true;
string pcPartNum = partNum;
string pcWhseCode = "";
string pcBinNum = "";
string pcLotNum = "";
int pcAttributeSetID = 0;
string pcDimCode = GetPartUM(partNum);
decimal pdDimConvFactor = 0;
string pcMessage = "";
string pcNeqQtyAction = "";
string opWarningMsg = "";
string cSellingQuantityChangedMsgText = "";
so.ChangeSellingQtyMaster(
ref soDS,
ipSellingQuantity,
chkSellQty,
negInvTest,
chgSellQty,
chgDiscPer,
suppressUserPrompts,
lKeepUnitPrice,
pcPartNum,
pcWhseCode,
pcBinNum,
pcLotNum,
pcAttributeSetID,
pcDimCode,
pdDimConvFactor,
out pcMessage,
out pcNeqQtyAction,
out opWarningMsg,
out cSellingQuantityChangedMsgText
);
dtlRow.LineDesc = partDesc;
dtlRow.UnitPrice = partUnitPrice;
dtlRow.DocUnitPrice = partUnitPrice;
dtlRow.DocListPrice = partUnitPrice;
dtlRow.DocOrdBasedPrice = partUnitPrice;
dtlRow.ExtPriceDtl = partUnitPrice;
dtlRow.DocExtPriceDtl = partUnitPrice;
dtlRow.DspUnitPrice = partUnitPrice;
dtlRow.RowMod = "U";
var hedRow = soDS.OrderHed.FirstOrDefault();
hedRow.RowMod = "U";
so.ChangeUnitPrice(ref soDS);
//MasterUpdate out/ref parameters
bool lCheckForOrderChangedMsg = false;
bool lcheckForResponse = false;
string cTableName = "OrderDtl";
int iCustNum = GetOrdCustNum(orderNum);
int iOrderNum = orderNum;
bool lweLicensed = false;
bool lContinue = false;
string cResponseMsg = "";
string cCreditShipAction = "";
string cDisplayMsg = "";
string cCompliantMsg = "";
string cResponseMsgOrdRel = "";
string cAgingMessage = "";
string cShipByDateMessage = "";
string cNeedByDateMessage = "";
cMsgTypeSaleable = "";
dtlRow.RowMod = "U";
hedRow.RowMod = "U";
so.MasterUpdate(
lCheckForOrderChangedMsg,
lcheckForResponse,
cTableName,
iCustNum,
iOrderNum,
lweLicensed,
out lContinue,
out cResponseMsg,
out cCreditShipAction,
out cDisplayMsg,
out cCompliantMsg,
out cResponseMsgOrdRel,
out cAgingMessage,
out cShipByDateMessage,
out cNeedByDateMessage,
out cMsgTypeSaleable,
ref soDS
);
});
Am I doing something wrong or missing something?
