So, in the UI I’m calling the BO ChangePartNumMaster from the quote adapter.
It requires a guid as a parameter and the trace shows this: <parameter name=“SysRowID” type=“System.Guid”>
This compiles, but is this the proper way to create that guid?
System.Guid sysRowID = new System.Guid(“00000000-0000-0000-0000-000000000000”);
I couldn’t call the BO without that parameter in there. It wouldn’t compile. I’m assuming Epicor does something that if it’s empty, it will generate a new one? (I hope)
Oh I see, this is a different case. Do you think you’ll get the desired result? Looks like you are going to need to pass a proper SysRowID, not a blank one.
**Edit - It looks like this is the line that’s failing: qa.GetNewQuoteDtl((int)edvQuoteHedR[“QuoteNum”]);
I’m attempting to create a new quote line on a button click using this code:
using( QuoteAdapter qa = new QuoteAdapter(oTrans) )
{
qa.BOConnect();
qa.GetNewQuoteDtl((int)edvQuoteHedR["QuoteNum"]);
qa.QuoteData.QuoteDtl[0].QuoteNum = (int)edvQuoteHedR["QuoteNum"];
qa.QuoteData.QuoteDtl[0].QuoteLine = 0;
qa.QuoteData.QuoteDtl[0].PartNum = partNum;
qa.QuoteData.QuoteDtl[0].Company = "ISI";
qa.QuoteData.QuoteDtl[0].RowMod = "A";
qa.ChangePartNumMaster(ref partNum,
ref lIsPhantom,
ref lIsSalesKit,
ref uomCode,
rowType,
sysRowID,
salesKitView,
removeKitComponents,
suppressUserPrompts,
runChkPrePartInfo,
out vMessage,
out vPMessage,
out vBMessage,
out vSubAvail,
out vMsgType,
getPartXRefInfo,
checkChangeKitParent,
out cDeleteComponentsMessage,
out multipleMatch,
out promptToExplodeBOM,
out explodeBOMerrMessage);
qa.ChangePartNum(lSubstitutePartsExist, uomCode);
qa.Update();
}
It gives me the “Failed to enable constraints” error followed by an “Object not set to an instance of an object” error, but after all of that, if I refresh the quote, the new line appears. I feel like I’m missing something minor. Any ideas?
I had that same thought as you replied and that did get past the failed constraint.
Now it seems to hit an error “Part is Required” just before the qa.Update() method.
I tried doing this qa.QuoteData.QuoteDtl[0].PartNum = partNum; just before, but it didn’t seem to matter.
using( QuoteAdapter qa = new QuoteAdapter(oTrans) )
{
qa.BOConnect();
qa.GetByID((int)edvQuoteHedR["QuoteNum"]);
qa.GetNewQuoteDtl((int)edvQuoteHedR["QuoteNum"]);
/*qa.QuoteData.QuoteDtl[0].QuoteNum = (int)edvQuoteHedR["QuoteNum"];
qa.QuoteData.QuoteDtl[0].QuoteLine = 0;
qa.QuoteData.QuoteDtl[0].PartNum = partNum;
qa.QuoteData.QuoteDtl[0].Company = "ISI";*/
qa.ChangePartNumMaster(ref partNum,
ref lIsPhantom,
ref lIsSalesKit,
ref uomCode,
rowType,
sysRowID,
salesKitView,
removeKitComponents,
suppressUserPrompts,
runChkPrePartInfo,
out vMessage,
out vPMessage,
out vBMessage,
out vSubAvail,
out vMsgType,
getPartXRefInfo,
checkChangeKitParent,
out cDeleteComponentsMessage,
out multipleMatch,
out promptToExplodeBOM,
out explodeBOMerrMessage);
qa.ChangePartNum(lSubstitutePartsExist, uomCode);
qa.QuoteData.QuoteDtl[0].PartNum = partNum;
qa.Update();
}
*Edit, you know what, I bet I know what I’m doing wrong. This is the same thing I ran into before. I’m updating [0], but I need to find the proper one to update, don’t I?
**Edit, Yup, that was it. I was updating the wrong index.
After I use the BO to create my quote line, is there a way to pull that line into focus?
Right now it adds it, but there’s not much feedback unless I put in a message.
Ideally, I’d like it to behave in a way such that once the line is created, it pulls the user into the Line/Detail view for that line.