Evan_Purdy
(Evan Purdy)
September 16, 2021, 6:25pm
1
I did the usual process of doing a trace and then making similar calls to the BO’s but I seem to be missing a secret ingredient. There is a call to “GetMiscChrgDefaults” but I don’t need the defaults for the msc code so I didn’t include that, I’m willing to set them in the code. I’m not thinking at 100% right now so I figure it might be something obvious… Getting an OK response but nothing happens.
dynamic mscData = EpicorRest.DynamicPost("Erp.BO.QuoteSvc", "GetNewQuoteMsc", new { Company = "78863", quoteNum = quote, quoteLine = line, qtyNum = "0", MiscCode = "PSur", MiscAmt="10.0", ds = new object() });
EpicorRest.DynamicPost("Erp.BO.QuoteSvc", "Update", mscData.parameters.ds);
josecgomez
(Jose C Gomez)
September 16, 2021, 10:15pm
3
I think you need to set your values after GetNew not in th get new call
Evan_Purdy
(Evan Purdy)
September 17, 2021, 2:01pm
4
Didn’t seem to help:
dynamic mscData = EpicorRest.DynamicPost("Erp.BO.QuoteSvc", "GetNewQuoteMsc", new { Company = "78863", quoteNum = quote, quoteLine = line, qtyNum = "0", MiscCode = "PSur", MiscAmt="10.0", ds = ds1 });
mscData.parameters.ds.QuoteMsc[0]["quoteNum"] = quote;
mscData.parameters.ds.QuoteMsc[0]["quoteLine"] = line;
mscData.parameters.ds.QuoteMsc[0]["qtyNum"] = "0";
mscData.parameters.ds.QuoteMsc[0]["MiscCode"] = "PSur";
mscData.parameters.ds.QuoteMsc[0]["MiscAmt"] = "10.0";
EpicorRest.DynamicPost("Erp.BO.QuoteSvc", "Update", mscData.parameters.ds);
josecgomez
(Jose C Gomez)
September 17, 2021, 2:16pm
5
What response are you getting back from the server?
Evan_Purdy
(Evan Purdy)
September 17, 2021, 2:42pm
6
Hmm well the msc charge code is invalid because we had a pilot refresh last night and so its gone, let me try fixing that and see what happens
carlosqt
(Carlos Quintanilla)
September 17, 2021, 3:07pm
7
Hi Evan,
You also missing to set RowMod = “A”. Try adding that but also consider calling the methods to load misc charge defaults too. See below.
For Quotes you should be doing something like this:
newQuoteMsc.MiscCode = "SURC";
quoteSvc.GetMiscChrgDefaults(ref qTS, "QuoteMsc");
newQuoteMsc.RowMod = "A";
And for SalesOrder:
newOrderMsc.MiscCode = "SURC";
orderSvc.ChangeMiscCode(ref oTS, "OrderMsc");
newOrderMsc.RowMod = "A";
The two custom methods there will populate all defaults from the misc charge table based on the misc code.
Hope that helps.
PSE
Evan_Purdy
(Evan Purdy)
September 17, 2021, 3:24pm
8
I got it working:
dynamic mscData = EpicorRest.DynamicPost("Erp.BO.QuoteSvc", "GetNewQuoteMsc", new { Company = "78863", quoteNum = quote, quoteLine = line, qtyNum = "0", MiscCode = "PSur", MiscAmt="10.0", ds = ds1 });
mscData.parameters.ds.QuoteMsc[0]["quoteNum"] = quote;
mscData.parameters.ds.QuoteMsc[0]["quoteLine"] = line;
mscData.parameters.ds.QuoteMsc[0]["qtyNum"] = "0";
mscData.parameters.ds.QuoteMsc[0]["MiscCode"] = "Draw";
mscData.parameters.ds.QuoteMsc[0]["MiscAmt"] = "10.0";
mscData.parameters.ds.QuoteMsc[0]["DocMiscAmt"] = "10.0";
mscData.parameters.ds.QuoteMsc[0]["DspMiscAmt"] = "10.0";
mscData.parameters.ds.QuoteMsc[0]["DocDspMiscAmt"] = "10.0";
mscData.parameters.ds.QuoteMsc[0]["Description"] = "PLate price increase";
mscData.parameters.ds.QuoteMsc[0]["FreqCode"] = "E";
EpicorRest.DynamicPost("Erp.BO.QuoteSvc", "Update", mscData.parameters);
1 Like