I want to use a UBAQ to submit records to UD06. The UBAQ is named “WinQuotes”. The Custom action is called “WonQuote”. From The QuoteEntry form, I want to execute the UBAQ to submit a record if the user clicks the WinQuote button I added to the line. The button should pull the Quote number, and line number, then submit a record to UD06 with those as Key1 and 2, along with a true checkbox01 value.
Normally, when I run a custom action from a UBAQ, I am sending the results back to a grid on the form. In this case, the BAQ results stay hidden, and the BAQ is only used to submit the record to UD06.
This is what I would use to submit a custom action when the BAQ is linked to a grid dataview.
private void BAQRunCustomAction(EpiDataView iEdv, string iActionID)
{
BAQDataView BAQView = (BAQDataView)iEdv;
Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
MethodInfo mi = t.GetMethod("BAQRunCustomAction", bf);
object[] param = new object[] { BAQView, iActionID};
mi.Invoke("Ice.Lib.Framework.BAQUpdater", param);
}
Can I modify this code to accept the BAQ ID instead of an epidataview?
I think that I would pass my data from this form to my BAQ thorugh CallContext, something like this:
private void btnWinQuoteLine_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
EpiDataView edvQuotes = (EpiDataView)(oTrans.EpiDataViews["OrderDtl"]);
object myLine = edvQuotes.dataView[edvQuotes.Row]["QuoteLine"];
EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
edvCallContextBpmDataRow["ShortChar01"] = txtMyQuote.Value.ToString();
edvCallContextBpmDataRow["ShortChar02"] = myLine.ToString();
// Run custom code in BPM
BAQRunCustomAction("WinQuotes", "WonQuote");
}
Then, inside my custom action, I take a look at the callcontext values and save them into internal variables. I create a new records in UD06 with these callcontext values as the keys.
How can I send callcontext data to my BAQ, and the run my custom BAQ action even though I don’t have a BAQ grid on my form?
Thanks!
Nate