I am working on a screen customization for Opportunity/Quote Entry. I have placed an action menu item on the screen that sets some BPM variables and then calls UD01 to perform some actions using code below.
EpiDataView myccedv = oTrans.Factory("CallContextBpmData");
DataRow xrow = myccedv.CurrentDataRow;
if (xrow == null) { return; }
//first set the code so BPM engine knows what to run
xrow.BeginEdit();
xrow["Number01"] = myQuote;
xrow["Character20"] = "MagicLogic";
xrow.EndEdit();
//then call BPM engine to run logic
using (var u = new Ice.Adapters.UD01Adapter(this.oTrans)) {
bool morePages;
SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
u.BOConnect();
DataSet ds = u.GetList(opts, out morePages);
u.Dispose();
}
The BPM on UD01.GetList performs a number of actions which may return an Epicor quote number in a BPM variable (Number03). If there is a value, I want to retrieve that quote to replace the screen.
var findq = Int32.Parse(xrow["Number03"].ToString());
xrow.BeginEdit();
xrow["Number01"] = 0;
xrow["Number03"] = 0;
xrow["Character20"] = "";
xrow.EndEdit();
EpiDataView edvQuoteHed = ((EpiDataView)(this.oTrans.EpiDataViews["QuoteHed"]));
System.Data.DataRow edvQuoteHedRow = edvQuoteHed.CurrentDataRow;
if (findq != 0)
{
if(edvQuoteHed.CurrentDataRow!=null){
var qhrow = edvQuoteHed.CurrentDataRow;
qhrow.BeginEdit();
qhrow["QuoteNum"] = findq;
qhrow.EndEdit();
}
else {
//What if there was nothing in the view? Must be something simple for an EpiGuru
}
oTrans.RefreshEverything();
}
This code works as long as the user already has a quote loaded on the screen. However, if they have not already retrieved a record, it cannot refresh the view. Is there a simple solution to this that someone would be able to help with? I apologize if this has been asked before or is obvious, but any help is appreciated!
Thanks,
Tanner