Execute parameterized BAQ in E10

Thanks, Jose and jckinneman, for pointing out the obvious that I was missing.

I'm working on migrating a lot of customizations from Vantage 8.03 to E10.  Obviously, a lot of things have changed in the environment.  Can someone show me an example of how to do something like this:

 

                                Dim dq As New DynamicQuery(oTrans.Session.ConnectionPool)                                 Dim dqds As DynamicQueryDataSet = Nothing                                 Dim OrderNumText As Epicor.Mfg.UI.Framework.EpiNumericEditor                                Dim LineNumText As Epicor.Mfg.UI.Framework.EpiTextBox                                Dim JobNumText As Epicor.Mfg.UI.Framework.EpiTextBox                                OrderNumText = DirectCast(csm.GetNativeControlReference("7881ca23-0a34-49b7-9f30-e54e26e42a35"), Epicor.Mfg.UI.FrameWork.EpiNumericEditor)                                LineNumText = DirectCast(csm.GetNativeControlReference("965a2b7b-2c34-4736-a9e9-f6aa06dfe76d"), Epicor.Mfg.UI.FrameWork.EpiTextBox)                                JobNumText = DirectCast(csm.GetNativeControlReference("f4b95c15-4710-4b35-8c7b-bf89fbee53ac"), Epicor.Mfg.UI.FrameWork.EpiTextBox)                                if JobnumText.Text <> "" then                                 ' get the BAQ                                dqds = dq.GetQueryByID("ATP-CheckShippingJob")                                                                 ' set the parameter                                dqds.querywhereitem(0).rvalue=OrderNumText.Text                                dqds.querywhereitem(1).rvalue=LineNumText.Text                                dqds.querywhereitem(2).rvalue=JobNumText.Text                         ' execute the BAQ                                 Dim ds As DataSet = dq.Execute(dqds)

 

 

in C# in E10?  I think I've figured out some of it from other discussions, but I need some pointers on how to create the parameters to the BAQ.  Are there any examples out there of simply executing a BAQ that requires some parameters?

 

 

Theres actually a thread called E10 Dyamic Query that popped up pretty recently.  In there they show how to add a parameter to a BAQ through c#.  The parameter has to be setup on the BAQ first but once that is done the script in that thread will work.
Yes, I saw that thread.  It's where I got most of my info.  The piece that's missing for me is what are the parameters to the ExecutionParameter.AddExecutionParameterRow method?  Is there a definition of it somewhere?  I couldn't find it in any of the customization wizards or the object explorer.  Did I just not look hard enough?
Take a look at this.

 
 
image
 
 
 
 
 
Epicor's Vista/Vantage/E9 User's Group
*** When you request membership you ---MUST--- provide your COMPANY NAME and a valid EPICOR SITE-ID to be approved for the list. *** A mailing list for the...
Preview by Yahoo
 


From: "mmahrle@... [vantage]" <vantage@yahoogroups.com>
To: vantage@yahoogroups.com
Sent: Wednesday, August 13, 2014 5:27 PM
Subject: [Vantage] Re: Execute parameterized BAQ in E10

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116 --

#ygrps-yiv-1368453539yiv1157197116 .ygrps-yiv-1368453539yiv1157197116ygrp-photo-title{
clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}
#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116ygrp-photo{
background-position:center;background-repeat:no-repeat;background-color:white;border:1px solid black;height:62px;width:62px;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116photo-title
a,
#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116photo-title a:active,
#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116photo-title a:hover,
#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116photo-title a:visited {
text-decoration:none;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116attach-table div.ygrps-yiv-1368453539yiv1157197116attach-row {
clear:both;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116attach-table div.ygrps-yiv-1368453539yiv1157197116attach-row div {
float:left;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 p {
clear:both;padding:15px 0 3px 0;overflow:hidden;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116ygrp-file {
width:30px;}
#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116attach-table div.ygrps-yiv-1368453539yiv1157197116attach-row div div a {
text-decoration:none;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116attach-table div.ygrps-yiv-1368453539yiv1157197116attach-row div div span {
font-weight:normal;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 div.ygrps-yiv-1368453539yiv1157197116ygrp-file-title {
font-weight:bold;}
#ygrps-yiv-1368453539
#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116
#ygrps-yiv-1368453539yiv1157197116ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116ygrp-mkp hr {
border:1px solid #d8d8d8;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116ygrp-mkp #ygrps-yiv-1368453539yiv1157197116hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116ygrp-mkp #ygrps-yiv-1368453539yiv1157197116ads {
margin-bottom:10px;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116ygrp-mkp .ygrps-yiv-1368453539yiv1157197116ad {
padding:0 0;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116ygrp-mkp .ygrps-yiv-1368453539yiv1157197116ad p {
margin:0;}

#ygrps-yiv-1368453539 #ygrps-yiv-1368453539yiv1157197116 #ygrps-yiv-1368453539yiv1157197116ygrp-mkp .ygrps-yiv-1368453539yiv1157197116ad a {
color:#0000ff;text-decoration:none;}
#ygrps-yiv-1368453539



Yes, I saw that thread.  It's where I got most of my info.  The piece that's missing for me is what are the parameters to the ExecutionParameter.AddExecutionParameterRow method?  Is there a definition of it somewhere?  I couldn't find it in any of the customization wizards or the object explorer.  Did I just not look hard enough?





I found it in the BL Tester in DynamicQuery.  Under the Execute you can see the QueryExecutionDataSet executionParams>ExecutionParameter
It's as follows:
(Parameter, Parameter Value, ValueType, IsEmpty, SysRowID, RowMod)
So (OrderNum, OrderNumText.Text, "Int", false, Guid.NewGuid(), "A") for your first parameter.
Thanks, duckorz.  Is there a new version of BL Tester for E10, or is it the same as for E9?
There is a new one that actually installs with the E10 server. It's somewhere in the server folder under a folder called utilities I think. 
#ygrps-yiv-100701605 P.ygrps-yiv-100701605ce387540-7764-462c-979a-97379ccda45c { MARGIN:0cm 0cm 0pt;} #ygrps-yiv-100701605 LI.ygrps-yiv-100701605ce387540-7764-462c-979a-97379ccda45c { MARGIN:0cm 0cm 0pt;} #ygrps-yiv-100701605 DIV.ygrps-yiv-100701605ce387540-7764-462c-979a-97379ccda45c { MARGIN:0cm 0cm 0pt;} #ygrps-yiv-100701605 TABLE.ygrps-yiv-100701605ce387540-7764-462c-979a-97379ccda45cTable { MARGIN:0cm 0cm 0pt;} #ygrps-yiv-100701605 DIV.ygrps-yiv-100701605Section1 { }

New version but principally the same

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: 14 August 2014 00:40
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Execute parameterized BAQ in E10

 

 

Thanks, duckorz.  Is there a new version of BL Tester for E10, or is it the same as for E9?



Stephen Edginton (Beng) | Solutions & Technical Director

Mobile:  +44 7734 858415
Main:  +44 (0) 121 314 1170
Web:  www.dotnetit.co.uk

Dot Net IT Limited, One St Kenelm Court, Steel Park Road, Halesowen, B62 8HD, United Kingdom.

DotNetIT

Epicor Platinum Partner

Epicor Alliance Partner

Thanks.  Found BL Tester.  Now I have another problem.  I've got the parameters set up (as far as I know) but when I try to assign the results of the ExecuteByID() method (which BL Tester indicates returns a DataSet) to a DataSet  I get a compile error:

 

Error: CS0029 - line 148 (567) - Cannot implicitly convert type 'void' to 'System.Data.DataSet'

which says to me that ExecuteByID() is a void function.

 

Here's the code

 // Add Custom Module Level Variables Here ** DynamicQueryAdapter dqAdapter; DynamicQueryAdapter dqAdapter2; Ice.BO.QueryExecutionDataSet dqds; DataSet ds;

and in private void ShipDtl_AfterFieldChange(object sender, DataColumnChangeEventArgs args)

 

  dqAdapter = new DynamicQueryAdapter(oTrans);  dqAdapter.BOConnect(); // DynamicQueryDataSet dqds = null;  dqds = new Ice.BO.QueryExecutionDataSet();   EpiNumericEditor OrderNumText = new EpiNumericEditor();  EpiTextBox LineNumText = new EpiTextBox();  EpiTextBox JobNumText = new EpiTextBox();  DataRow testrow = null;  OrderNumText = (EpiNumericEditor)csm.GetNativeControlReference("7881ca23-0a34-49b7-9f30-e54e26e42a35");  LineNumText = (EpiTextBox)csm.GetNativeControlReference("965a2b7b-2c34-4736-a9e9-f6aa06dfe76d");  JobNumText = (EpiTextBox)csm.GetNativeControlReference("f4b95c15-4710-4b35-8c7b-bf89fbee53ac");

  if (!string.IsNullOrEmpty(JobNumText.Text)) {   dqds.ExecutionParameter.AddExecutionParameterRow("OrderNum", OrderNumText.Text, "Int", false, Guid.NewGuid(), "U");   dqds.ExecutionParameter.AddExecutionParameterRow("OrderLine", LineNumText.Text, "Int", false, Guid.NewGuid(), "U");    dqds.ExecutionParameter.AddExecutionParameterRow("JobNum", JobNumText.Text, "nvarchar", false, Guid.NewGuid(), "U");    // execute the BAQ    ds = dqAdapter.ExecuteByID("ATP-CheckShippingJob", dqds);    if ((ds != null)) {    if (ds.Tables[0].Rows.Count == 0) {     MessageBox.Show("Job number " + JobNumText.Text + " not linked to sales order");    }   }  }

I know the BAQ works, at least to the extent I've tested it in the BAQ designer.  So, if ExecuteByID returns void, where do I see the results of the query?

You are using an adapter, an adapter is not the same add the business object.
What you are seeing on the bl tester is the business object.
Your adapter doesn't return but rather assigns to the adapter dataset.
Not sure how that works on the dynamic query one but your data might be in adapter.adapterData[]

On Aug 14, 2014 7:00 PM, "mmahrle@... [vantage]" <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p><p>Thanks.  Found BL Tester.  Now I have another problem.  I&#39;ve got the parameters set up (as far as I know) but when I try to assign the results of the ExecuteByID() method (which BL Tester indicates returns a DataSet) to a DataSet  I get a compile error:</p>

Â

Error: CS0029 - line 148 (567) - Cannot implicitly convert type 'void' to 'System.Data.DataSet'

which says to me that ExecuteByID() is a void function.

Â

Here's the code

 // Add Custom Module Level Variables Here ** DynamicQueryAdapter dqAdapter; DynamicQueryAdapter dqAdapter2; Ice.BO.QueryExecutionDataSet dqds; DataSet ds;

and in private void ShipDtl_AfterFieldChange(object sender, DataColumnChangeEventArgs args)

Â

  dqAdapter = new DynamicQueryAdapter(oTrans);  dqAdapter.BOConnect(); // DynamicQueryDataSet dqds = null;  dqds = new Ice.BO.QueryExecutionDataSet();   EpiNumericEditor OrderNumText = new EpiNumericEditor();  EpiTextBox LineNumText = new EpiTextBox();  EpiTextBox JobNumText = new EpiTextBox();  DataRow testrow = null;  OrderNumText = (EpiNumericEditor)csm.GetNativeControlReference("7881ca23-0a34-49b7-9f30-e54e26e42a35");  LineNumText = (EpiTextBox)csm.GetNativeControlReference("965a2b7b-2c34-4736-a9e9-f6aa06dfe76d");  JobNumText = (EpiTextBox)csm.GetNativeControlReference("f4b95c15-4710-4b35-8c7b-bf89fbee53ac");

  if (!string.IsNullOrEmpty(JobNumText.Text)) {   dqds.ExecutionParameter.AddExecutionParameterRow("OrderNum", OrderNumText.Text, "Int", false, Guid.NewGuid(), "U");   dqds.ExecutionParameter.AddExecutionParameterRow("OrderLine", LineNumText.Text, "Int", false, Guid.NewGuid(), "U");    dqds.ExecutionParameter.AddExecutionParameterRow("JobNum", JobNumText.Text, "nvarchar", false, Guid.NewGuid(), "U");    // execute the BAQ    ds = dqAdapter.ExecuteByID("ATP-CheckShippingJob", dqds);    if ((ds != null)) {    if (ds.Tables[0].Rows.Count == 0) {     MessageBox.Show("Job number " + JobNumText.Text + " not linked to sales order");    }   }  }

I know the BAQ works, at least to the extent I've tested it in the BAQ designer. So, if ExecuteByID returns void, where do I see the results of the query?

</div>
 


<div style="color:#fff;min-height:0;"></div>
While Business Objects, which you can run from the BL tester, may return a dataset, adapters don't return datasets.The dataset is either part of the adapter or passed back and forth as a parameter.  In the case of the dynamic adapter the data will be in dqAdapter.QueryResults.Tables["Results"].Jim KinnemanEncompass Solutions, Inc