We could, but it was a user request that the results get returned after an event (In this case the part number is changed in the tracker view.)
I figured out that I need to call the previously mentioned method, but this needs a dataset passed in, and it include the where clause based on what has been entered in the tracker. I have used this so far to build the dataset, I just don't know how to enter a where clause with it. In our case it could be 2 different input values.
PartPlant.PartNum = 'Value'
or
PartPlant.Plant= 'Value'
DynamicQuery dqa = new DynamicQuery(((Session)oTrans.Session).ConnectionPool);
QueryDesignDataSet qdds;
qdds= dqa.GetByID("MJP-Item Planning Dashboard");
---In vantage@yahoogroups.com, <jose@...> wrote:You lost me there,, what doy ou mean refresh an updatable dasboard? Can't you just hit the refrehs button? or am I missing something
Jose C GomezSoftware Engineer
T: 904.469.1524 mobile
Quis custodiet ipsos custodes?On Fri, Nov 8, 2013 at 3:43 PM, <livingstonmh@...> wrote:<div> <p>Haha alright. Another question in relation to this. Can this be used to refresh an Updateable dashboard? </p><p>I have been trying it to create a dataset to pass into the method Epicor.Mfg.BO.Dynam<var></var>icQuery GetList, but I cant seem to get it working.<var></var><var></var></p>
---In vantage@yahoogroups.com, <jose@...> wrote:Weird now your other message makes more sense, the first one got caught in the yahoo time warp.
Quis custodiet ipsos custodes?On Fri, Nov 8, 2013 at 12:49 PM, <livingstonmh@...> wrote:QueryExecutionDataSet qeds = dq.GetQueryExecutionParameters(qdds);<div> <p>I tried your example:</p><div> DynamicQuery dq = new DynamicQuery(((Session)oTrans.Session).ConnectionPool);<br> QueryDesignDataSet qdds;<br> qdds = dq.GetByID("MJP-DEV660");<br>
qeds.ExecutionParameter.AddExecutionParameterRow("ToPlant", ToPlant, "character", false, String.Empty, "A", null);
qeds.ExecutionParameter.AddExecutionParameterRow("FromPlant", Plant, "character", false, String.Empty, "A", null);
ds = dq.ExecuteParametrized(qdds,qeds,String.Empty,0,out outBool);
However it gives me a bunch of errors:
Error: CS0103 - line 75 (415) - The name 'outBool' does not exist in the current context
---In vantage@yahoogroups.com, <jose@...> wrote:
Why don't you turn those filters in your BAQ into parameters then use an ExcecuteParametirized and pass the parameters in?QueryDesignDataSet qdds = _dq.GetByID("MBP-GetUMFromConv"); QueryExecutionDataSet qeds = _dq.GetQueryExecutionParameters(qdds); qeds.ExecutionParameter.AddExecutionParameterRow("paramname", "value", "decimal", false, String.Empty, "A", null); ds = _dq.ExecuteParametrized(qdds,qeds,String.Empty,0,out outBool);
Quis custodiet ipsos custodes?On Fri, Nov 8, 2013 at 12:23 PM, <livingstonmh@...> wrote:<div> <p> I decided to scrap this approace and try something new. I am now just returning the results of the BAQ without trying to pass a where clause.</p><p> </p><p>My trouble now is that I want to filter the resulting data set returned based on the values contained in 2 EpiCombos. If the value of a field equals the first combo and the value of a second field equals the second combo.</p>
I can not figure out the code that I need to add that would do this. Here is my most recent code:
private void UpdateGrid(String Plant, String ToPlant)DataSet ds = dq.Execute(qdds);
{
DynamicQuery dq = new DynamicQuery(((Session)oTrans.Session).ConnectionPool);
QueryDesignDataSet qdds;
qdds = dq.GetByID("MJP-DEV660");
// foreach (QueryDesignDataSet.QueryWhereItemRow qwi in qdds.QueryWhereItem)// switch (qwi.FieldName)
// {
// case "Plant.Name":
// qwi.RValue = Plant;
// break;
// case "Plant1.Name":// qwi.RValue = ToPlant;
// break;
// case "TFOrdDtl.TFOrdNum":
// qwi.RValue = String.Empty;
// break;
// default:// break;
// }
//
foreach (DataColumn col in ds.Tables[0].Columns)if (col.Caption.Contains(".") && col.Caption.Split('.')[1] == qdds.QueryField[i].FieldName)
{
col.ReadOnly = true;
for (int i = 0; i < qdds.QueryField.Count; i++)
{
col.Caption = qdds.QueryField[i].FieldLabel;
break;
}
}ds.Tables[0].Columns[0].ReadOnly = false;
ds.Tables[0].Columns[8].ReadOnly = false;grdResults.DataSource = ds.Tables[0];
}
private void grdResults_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
{
grdResults.DisplayLayout.Bands[0].Columns[9].Hidden = true;}
—In vantage@yahoogroups.com, <dgodfrey@…> wrote:The difference from mine to yours is that I am accessing the QueryResults dataset from the adapter after the executing of the BAQ.
dynQryAD.ExecuteDashboardQuery(dynQryAD.RuntimeQuery);
oTrans.PushStatusText("Processing " + dynQryAD.QueryResults.Tables["Results"].Rows.Count + " Query records.", true);
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of livingstonmh@...
Sent: Friday, November 08, 2013 6:28 AM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: Execute AQ in C# adding conditions not filtering Data
------------------------------------------------------------------------------------------------------------------------ CONFIDENTIALITY NOTICE: The data attached/enclosed may contain information (including technology and technical data) which is subject to the U.S. International Traffic in Arms Regulations (ITAR) or Export Administration Regulations (EAR). This information may not be exported, released, or disclosed to foreign persons either inside or outside the United States without first obtaining the proper U.S. export license or written authorization. In addition, the information and articles described herein are either patented or proprietary, and the copying or reproduction thereof is prohibited without ADVANCED Motion Controls prior written consent. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Thank you for your compliance. X3BTB534Ok I just found another thread saying this code is obsolete in our version (9.05.700A)
I altered the code to the below, but I am not getting a .Net Error
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.GetDashboardQuery(String pcQueryID)
at Script.UpdateGrid(String Plant, String ToPlant)
at Script.btnPrint_Click(Object sender, EventArgs args)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at Infragistics.Win.UltraControlBase.OnClick(EventArgs e)
at Infragistics.Win.Misc.UltraButtonBase.OnClick(EventArgs e)
at Epicor.Mfg.UI.FrameWork.EpiButton.OnClick(EventArgs e)
at Infragistics.Win.Misc.UltraButton.OnMouseUp(MouseEventArgs e)
at Epicor.Mfg.UI.FrameWork.EpiButton.OnMouseUp(M ouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Anyone know what I did wrong here?
private void btnPrint_Click(object sender, System.EventArgs args)
{
UpdateGrid(cmbFromWH.Text, cmbToWH.Text);
}private void UpdateGrid(String Plant, String ToPlant)
{
DynamicQueryAdapter dq = new Dynam icQueryAdapter(((Session)oTrans.Session).ConnectionPool);
dq.BOConnect();
dq.GetDashboardQuery ("MJP-DEV660");
QueryDesignDataSet qdds = dq.RuntimeQuery;
DataTable dt = qdds.Tables["QueryTable"];
foreach (DataRow lo_row in dt.Rows)
{
if (lo_row["DataTableID"].ToString() == "Plant")
{
lo_row["WhereClause"]="Plant.Name=cmbFromWH.Text";
break;
}
if (lo_row["DataTableID"].ToString() == "Plant1")
{
lo_row["WhereClause"]="Plant1.Name=cmbToWH.Text";
&nb sp; break;
}
if (lo_row["DataTableID"].ToString() == "TFOrderDtl")
{
lo_row["WhereClause"]="TFOrderDtl.TFOrdNum=''";
break;
}
}dq.ExecuteDashboardQuery(qdds);
foreach (DataColumn col in qdds.Tables[0].Columns)
{
col.ReadOnly = true;
for (int i = 0; i < qdds.QueryField.Count; i++)
if (col.Caption.Contains(".") &&am p; col.Caption.Split('.')[1] == qdds.QueryField[i].FieldName)
{
col.Caption = qdds.QueryField[i].FieldLabel;
break;
}
}qdds.Tables[0].Columns[0].ReadOnly = false;
qdds.Tables[0].Columns[8].ReadOnly = false;grdResults.DataSource = qdds.Tables[0];
}
---In vantage@yahoogroups.com, <livingstonmh@...> wrote:I am executing a BAQ to return data, and I have added conditions based on some other threads I have found. Even though I am getting no errors, the BAQ is not getting filtered. Can anyone help? Following is the code:
private void UpdateGrid(String Plant, String ToPlant)
{
DynamicQuery dq = new DynamicQuery(((Session)oTrans.Session).ConnectionPool);
QueryDesignDataSet qdds;
qdds = dq.GetByID("MJP-DEV660");
string pcQueryID = "MJP-DEV660";
string pcTable = "Plant";
string pcField = "Name";
string pcCondition = "=";
bool pbIsConst = true;
string pcValue = cmbFromWH.Text;
string pcToTable = string.Empty;
string pcToField = string.Empty;
string pcLeftParentheses = string.Empty;
string pcRightParentheses = string.Empty;
string pcAndOr = "And";
bool pbNeg = false;
//MessageBox.Show(cmbFromWH.Text);
dq.AddWhereItem(qdds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,pcRightParentheses, pcAndOr, pbNeg);
pcQueryID = "MJP-DEV660";
pcTable = "Plant1";
pcField = "Name";
pcCondition = "=";
pbIsConst = true;
pcValue = cmbToWH.Text;
pcToTable = string.Empty;
pcToField = string.Empty;
pcLeftParentheses = string.Empty;
pcRightParentheses = string.Empty;
pcAndOr = string.Empty;
pbNeg = false;
//MessageBox.Show(cmbToWH.Text);
dq.AddWhereItem(qdds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTa ble, pcToField, pcLeftParentheses,pcRightParentheses, pcAndOr, pbNeg);
pcQueryID = "MJP-DEV660";
pcTable = "TFOrderDtl";
pcField = "TFOrdNum";
pcCondition = "=";
pbIsConst = true;
pcValue = string.Empty;
pcToTable = string.Empty;
pcToField = string.Empty;
pcLeftParentheses = string.Empty;
pcRightParentheses = string.Empty;
pcAndOr = "";
pbNeg = false;dq.AddWhereItem(qdds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,pcRightParentheses, pcAndOr, pbNeg);
DataSet ds = dq.Execute(qdds);
</div> <div style="color:rgb(255, 255, 255);"></div>
</div> <div style="color:rgb(255, 255, 255);"></div>
</div>
<div style="color:rgb(255, 255, 255);min-height:0px;"></div>