# Quote Adapter-Creating Quote Dtl? **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2017-01-05 20:42 UTC **Views:** 2153 **Replies:** 9 **URL:** https://www.epiusers.help/t/quote-adapter-creating-quote-dtl/36801 --- ## Post #1 by @Aaron_Moreng Having a bit of trouble understanding what I'm doing wrong with my quote adapter. I'm creating a quote detail record from a quote adapter. I call the methods in the order I find them in the trace log. > bool dtl = adapterQuote.GetNewQuoteDtl(adapterQuote.QuoteData.QuoteHed[0].QuoteNum); > if(dtl){ > //ChangePartNumMaster > bool lIsPhantom = false; > bool lIsSalesKit = false; > string uomCode = String.Empty; > string rowType = String.Empty; > Guid sysRowID = Guid.Empty; > bool salesKitView = false; > bool removeKitComponents = false; > bool suppressUserPrompts = false; > bool runChkPrePartInfo = true; > string vMessage = String.Empty; > string vPMessage = String.Empty; > string vBMessage = String.Empty; > bool vSubAvail = false; > string vMsgType = String.Empty; > bool getPartXRefInfo = true; > bool checkChangeKitParent = true; > string cDeleteComponentsMessage = String.Empty; > bool multipleMatch = false; > bool promptToExplodeBOM= false; > string explodeBOMerrMessage = String.Empty; > adapterQuote.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); > errorLocation = "366"; > //ChangePartNum > adapterQuote.ChangePartNum(false, String.Empty); > //add drawNum > drawNum = RandomString(7); > adapterQuote.QuoteData.QuoteDtl[0].DrawNum = drawNum; > errorLocation = "373"; > adapterQuote.Update(); > } I catch the exception message of "Part is Required" when this code is run and it occurs right before the last adapter update. Seems that I am providing the correct information for it to create a Quote Dtl record, but can anyone see what I'm missing? --- ## Post #2 by @Aaron_Moreng I've also attempted setting the field values before and after the ChangePartNum method fires, but any time I call the update, I get the Part Num Is Required message. I definitely think I'm missing something on this one, any help would be appreciated. > if(dtl){ > //ChangePartNumMaster > bool lIsPhantom = false; > bool lIsSalesKit = false; > string uomCode = String.Empty; > string rowType = String.Empty; > Guid sysRowID = Guid.Empty; > bool salesKitView = false; > bool removeKitComponents = false; > bool suppressUserPrompts = false; > bool runChkPrePartInfo = true; > string vMessage = String.Empty; > string vPMessage = String.Empty; > string vBMessage = String.Empty; > bool vSubAvail = false; > string vMsgType = String.Empty; > bool getPartXRefInfo = true; > bool checkChangeKitParent = true; > string cDeleteComponentsMessage = String.Empty; > bool multipleMatch = false; > bool promptToExplodeBOM= false; > string explodeBOMerrMessage = String.Empty; > adapterQuote.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); > > //ChangePartNum > errorLocation = "359"; > adapterQuote.ChangePartNum(false, String.Empty); > adapterQuote.QuoteData.QuoteDtl[0].Company = adapterQuote.QuoteData.QuoteHed[0].Company; > adapterQuote.QuoteData.QuoteDtl[0].QuoteNum = adapterQuote.QuoteData.QuoteHed[0].QuoteNum; > adapterQuote.QuoteData.QuoteDtl[0].QuoteLine = 0; > adapterQuote.QuoteData.QuoteDtl[0].CustNum = adapterQuote.QuoteData.QuoteHed[0].CustNum; > adapterQuote.QuoteData.QuoteDtl[0].PartNum = partNum; > adapterQuote.QuoteData.QuoteDtl[0].RowMod = "A"; > > errorLocation = "373"; > //update > adapterQuote.Update(); > } --- ## Post #3 by @hkeric.wci Where are you setting the variable **partNum**? --- ## Post #4 by @Aaron_Moreng I set it outside the method, but I've also tried hard coding it into the method. Neither seems to work for me. --- ## Post #5 by @hkeric.wci try > adapterQuote.QuoteData.QuoteDtl[0].PartNum = partNum; // set this before calling: > adapterQuote.QuoteData.QuoteDtl[0].PartDescription = partNum; // leave for testing > adapterQuote.ChangePartNum(false, String.Empty); --- ## Post #6 by @Aaron_Moreng That worked > adapterQuote.QuoteData.QuoteDtl[0].PartNum = "10017000"; > adapterQuote.QuoteData.QuoteDtl[0].LineDesc = "10017000"; > adapterQuote.ChangePartNum(false, String.Empty); > errorLocation = "373"; > //update > adapterQuote.Update(); Thank you for your help! --- ## Post #7 by @hkeric.wci Awesome! I just happened to have a snippet from @Edge as reference =) which is similar but BO version for Part. if(!partBO.PartExists(testPart)) { partBO.GetNewPart(ds); ds.Part[0].PartNum = testPart; ds.Part[0].PartDescription = testPart; ds.Part[0].TrackLots = true; partBO.ChangePartNum(testPart,ds); partBO.Update(ds); } --- ## Post #8 by @Aaron_Moreng I think it can be pretty confusing what needs to be set before a certain method will perform correctly. In the code example above it looks like he's calling the BO directly, which accepts a dataset as part of the method parameters. In the adapters though, I've noticed that they often have a different set of parameters to call the same method than the BO does. Thanks again, been pulling my hair out on this one! --- ## Post #9 by @josecgomez [quote="Aaron_Moreng, post:8, topic:36801"] it can be pretty confusing what needs to be set before a certain method will perform correctly [/quote] Actually if you look at the trace with the Changes Only Option it will show you the dataset which fields changed. So that means those fields need to be set before the method call is made. --- ## Post #10 by @Aaron_Moreng That's a good tip, I'll definitely be using it in the future! Thanks --- **Canonical:** https://www.epiusers.help/t/quote-adapter-creating-quote-dtl/36801 **Original content:** https://www.epiusers.help/t/quote-adapter-creating-quote-dtl/36801