Using the DynamicQyeryAdapter

you should be able to trap on Getnew for the sales order and new part adapters, use the wizard to add an after adapter event and then check for the getnew method. You can put in a messagebox to show the exact name of the method. In 8 I forget if there is a wizard to add it but you should be able add an event to trap toolbar manager toolclick via hand entered code or wizard if available and then check args.tool.key for "cleartool".

JK

--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
> Dele,
>
> Your solution worked like a charm. There is definitely a problem somewhere in the design.
>
> Now I have to figure out how to clear my ultragrid when a new sales order created, a new part is added and the Clear button on the toolbar is pressed.
>
> Anybody know what events these are?
>
> _ Scott
>
>
>
> --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> >
> > Good thinking outside the box. Probably confirms at least a design flaw.
> >
> > Thanks,
> > JK
> >
> > --- In vantage@yahoogroups.com, "deleoye" <deleoye@> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > I've got it working on v8.0.409 after studying the differences in the way BL Tester (i.e. the Business Objects) and the adapter code handled the QueryDesignData and DynamicQueryData datasets. Even though it was a bit "brute-forcish", I simply copied the tables from the QueryDesignData and DynamicQueryData after the AddWhereItem has been run. The code is used to drive one of the most commonly used screens in my company and seems to work OK. (Enclose in a Try/Catch construct for robustness.)
> > >
> > > Dim baqID as String = "BAQName"
> > > Dim dynQryAD As DynamicQueryAdapter = New DynamicQueryAdapter(oTrans.EpiBaseForm)
> > > Dim pcTable As String = ""
> > > Dim pcField As String = ""
> > > Dim pcValue As String = ""
> > > Dim pbIsConst as Boolean = True
> > > Dim pbNeg as Boolean = False
> > > Dim pbSucceed as Boolean = False
> > > Dim pcLeftParentheses as String = "("
> > > Dim pcRightParentheses as String = ")"
> > > Dim pcCondition as String = "="
> > >
> > > pcTable = "Part"
> > > pcField = "PartNum"
> > > pcValue = QueryFieldValue
> > > dynQryAD.BOConnect()
> > > dynQryAD.GetByID(baqID) '
> > > dynQryAD.AddWhereItem(dynQryAD.QueryDesignData, baqID, pcTable, pcField, pcCondition, pbIsConst, pcValue, "", "", pcLeftParentheses, pcRightParentheses, "", pbNeg)
> > > dynQryAD.Update()
> > >
> > > '//copy all data from QueryDesignData tables to DynamicQueryData tables (only for tables that exist in both datasets)
> > > Dim targetRow as DataRow
> > > For each table as DataTable in dynQryAD.DynamicQueryData.Tables
> > > For Each sourceRow as DataRow in dynQryAD.QueryDesignData.Tables(table.ToString()).Rows
> > > targetRow = table.NewRow()
> > > targetRow.ItemArray = sourceRow.ItemArray
> > > table.Rows.Add(targetRow)
> > > Next
> > > Next
> > > dynQryAD.Execute(dynQryAD.DynamicQueryData)
> > > Dim ds As DataSet = dynQryAD.QueryResults
> > >
> > >
> > > Dele Oyebande
> > > Autac Products
> > >
> > > --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> > > >
> > > > I am beginning to believe it is a version issue as I do interact with this bo/adapter all the time in 9 but as several of us have tried can not get the same in 8. I implemented the same code in 8 and get the error that the datasets are not right as seen by others. Since this BO is not used by many there may very well be an undiscovered/unreported bug in 8 that was fixed along the way in 9.
> > > >
> > > > Jim Kinneman
> > > > Senior Consultant
> > > > Encompass Solutions Inc
> > > >
> > >
> >
>
I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.

What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.

I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:

Dim PartNum as string = args.ProposedValue
Dim strWhereClause as string
Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
dqa.BOConnect()

Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")

Dim MorePages As Boolean
strWhereClause = "PartNum = '" & PartNum & "'"
Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
ugdEpiCustom1.DataSource = SearchResults

Any ideas?
Maybe I am way off, but could you look for the specific thing you want
in the result set by using "If Available"?



Tim Dines

ERP Analyst

Steel Parts Manufacturing, Inc.

801 Berryman Pike

Tipton, IN 46072

765-675-5201



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of thedemondamian
Sent: Wednesday, July 28, 2010 10:06 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Using the DynamicQyeryAdapter





I don't have a problem using the DynamicQueryAdapter to run a BAQ and
get results from within the script editor of a form.

What I do want to know is how to add a WHERE clause to the query adapter
in order to filter the results of the BAQ.

I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults
methods with no luck. Here is my latest code:

Dim PartNum as string = args.ProposedValue
Dim strWhereClause as string
Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
dqa.BOConnect()

Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")

Dim MorePages As Boolean
strWhereClause = "PartNum = '" & PartNum & "'"
Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
ugdEpiCustom1.DataSource = SearchResults

Any ideas?





[Non-text portions of this message have been removed]
Thanks for the suggestion.

I could filter the results after the fact, but I would much rather it be done before the BAQ execution. The BAQ returns records for every part in every plant and I would like to cut down on the process time.

--- In vantage@yahoogroups.com, "Dines, Tim" <tdines@...> wrote:
>
> Maybe I am way off, but could you look for the specific thing you want
> in the result set by using "If Available"?
>
>
>
> Tim Dines
>
> ERP Analyst
>
> Steel Parts Manufacturing, Inc.
>
> 801 Berryman Pike
>
> Tipton, IN 46072
>
> 765-675-5201
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of thedemondamian
> Sent: Wednesday, July 28, 2010 10:06 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Using the DynamicQyeryAdapter
>
>
>
>
>
> I don't have a problem using the DynamicQueryAdapter to run a BAQ and
> get results from within the script editor of a form.
>
> What I do want to know is how to add a WHERE clause to the query adapter
> in order to filter the results of the BAQ.
>
> I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults
> methods with no luck. Here is my latest code:
>
> Dim PartNum as string = args.ProposedValue
> Dim strWhereClause as string
> Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> dqa.BOConnect()
>
> Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
>
> Dim MorePages As Boolean
> strWhereClause = "PartNum = '" & PartNum & "'"
> Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> ugdEpiCustom1.DataSource = SearchResults
>
> Any ideas?
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
To add a where item
Dim ds as New QueryDesignDataSet()
ds = New QueryDesignDataSet()

Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
ds = dqa.QueryDesignData

Dim pcQueryID as String = "MMI-PartAvailable"
Dim pcTable as String = "WhatTable"
Dim pcField as String = "WhatField"
Dim pcCondition as String = "=" ' could <> > < etc
Dim pbIsConst as Boolean = true
Dim pcValue as String = "whatvaluetolookfor"
Dim pcToTable as String = String.Empty
Dim pcToField as String = String.Empty
Dim pcLeftParentheses as String = String.Empty
Dim pcRightParentheses as String = String.Empty
Dim pcAndOr as String = String.Empty
Dim pbNeg as Boolean = false


dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
// repeat as needed to add all your where clauses, you can use parentheses and "AND" and "OR" if you need to.

Jim Kinneman
Senior Consultant
Encompass Solutions Inc

--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
> I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.
>
> What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.
>
> I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:
>
> Dim PartNum as string = args.ProposedValue
> Dim strWhereClause as string
> Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> dqa.BOConnect()
>
> Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
>
> Dim MorePages As Boolean
> strWhereClause = "PartNum = '" & PartNum & "'"
> Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> ugdEpiCustom1.DataSource = SearchResults
>
> Any ideas?
>
Excellent, I knew it was a simple solution, I just could not see all of the pieces.

The two diferent dataset types were throwing me off.

Thanks

--- In vantage@yahoogroups.com, "jckinneman" <jckinneman@...> wrote:
>
>
>
> To add a where item
> Dim ds as New QueryDesignDataSet()
> ds = New QueryDesignDataSet()
>
> Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> ds = dqa.QueryDesignData
>
> Dim pcQueryID as String = "MMI-PartAvailable"
> Dim pcTable as String = "WhatTable"
> Dim pcField as String = "WhatField"
> Dim pcCondition as String = "=" ' could <> > < etc
> Dim pbIsConst as Boolean = true
> Dim pcValue as String = "whatvaluetolookfor"
> Dim pcToTable as String = String.Empty
> Dim pcToField as String = String.Empty
> Dim pcLeftParentheses as String = String.Empty
> Dim pcRightParentheses as String = String.Empty
> Dim pcAndOr as String = String.Empty
> Dim pbNeg as Boolean = false
>
>
> dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> // repeat as needed to add all your where clauses, you can use parentheses and "AND" and "OR" if you need to.
>
> Jim Kinneman
> Senior Consultant
> Encompass Solutions Inc
>
> --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> >
> > I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.
> >
> > What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.
> >
> > I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:
> >
> > Dim PartNum as string = args.ProposedValue
> > Dim strWhereClause as string
> > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > dqa.BOConnect()
> >
> > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> >
> > Dim MorePages As Boolean
> > strWhereClause = "PartNum = '" & PartNum & "'"
> > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> > Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> > ugdEpiCustom1.DataSource = SearchResults
> >
> > Any ideas?
> >
>
Jim,

I got a chance to test out your solution and I am receiving a Foreign Key Constraint error from the AddWhereItem method.


Error Detail
============
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Table: QueryWhereItem
Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable' DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint QueryTableQueryWhereItem requires the child key values (MMI, sheath, MMI-PartAvailable, Part) to exist in the parent table.


Stack Trace
===========
at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters, DataSet ds, Int32 paramPos)
at Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
at Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)

Inner Exception
===============
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Inner Stack Trace
=================
at System.Data.DataSet.FailedEnableConstraints()
at System.Data.DataSet.EnableConstraints()
at System.Data.DataSet.set_EnforceConstraints(Boolean value)
at System.Data.DataTable.EndLoadData()
at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)


Here is my code:


Dim strValue as string = args.ProposedValue

Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
dqa.BOConnect()

Dim ds as New QueryDesignDataSet()
ds = New QueryDesignDataSet()

Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
ds = dqa.QueryDesignData

Dim pcQueryID as String = "MMI-PartAvailable"
Dim pcTable as String = "Part"
Dim pcField as String = "PartNum"
Dim pcCondition as String = "="
Dim pbIsConst as Boolean = true
Dim pcValue as String = strValue
Dim pcToTable as String = String.Empty
Dim pcToField as String = String.Empty
Dim pcLeftParentheses as String = String.Empty
Dim pcRightParentheses as String = String.Empty
Dim pcAndOr as String = String.Empty
Dim pbNeg as Boolean = false

dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)

dqa.Executebyid("MMI-PartAvailable")
Dim results As DataSet = dqa.QueryResults
ugdEpiCustom1.DataSource = results


Thanks for your help,
Scott

--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
> Excellent, I knew it was a simple solution, I just could not see all of the pieces.
>
> The two diferent dataset types were throwing me off.
>
> Thanks
>
> --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> >
> >
> >
> > To add a where item
> > Dim ds as New QueryDesignDataSet()
> > ds = New QueryDesignDataSet()
> >
> > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > ds = dqa.QueryDesignData
> >
> > Dim pcQueryID as String = "MMI-PartAvailable"
> > Dim pcTable as String = "WhatTable"
> > Dim pcField as String = "WhatField"
> > Dim pcCondition as String = "=" ' could <> > < etc
> > Dim pbIsConst as Boolean = true
> > Dim pcValue as String = "whatvaluetolookfor"
> > Dim pcToTable as String = String.Empty
> > Dim pcToField as String = String.Empty
> > Dim pcLeftParentheses as String = String.Empty
> > Dim pcRightParentheses as String = String.Empty
> > Dim pcAndOr as String = String.Empty
> > Dim pbNeg as Boolean = false
> >
> >
> > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > // repeat as needed to add all your where clauses, you can use parentheses and "AND" and "OR" if you need to.
> >
> > Jim Kinneman
> > Senior Consultant
> > Encompass Solutions Inc
> >
> > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > >
> > > I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.
> > >
> > > What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.
> > >
> > > I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:
> > >
> > > Dim PartNum as string = args.ProposedValue
> > > Dim strWhereClause as string
> > > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > > dqa.BOConnect()
> > >
> > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > >
> > > Dim MorePages As Boolean
> > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > > opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> > > ugdEpiCustom1.DataSource = SearchResults
> > >
> > > Any ideas?
> > >
> >
>
What does your BAQ look like? What tables are included? What version of Epicor are you running on? The example I provided is based on Epicor 9, the BO signature may be different for 8.

The primary way I explore how to call BOs is via the Business Logic Tester. All the systems I have worked on have it but I have also seen discussions that you might only be able to get it if you have the SDK. If you have the BL tester you can easily look at and test the signature for calling the BO. If you don't have the BL tester you can also, when in customization mode, use the Object Explorer to look at the signatures on the BO. If this is 8 we may have to adjust the signature on the call to whereitem.

While the error prevents you from getting to it when you are ready to run your query you will want to use dqa.Execute(ds) ExecuteByID will run the BAQ as it exists in the db without the whereitems.

Jim Kinneman
Senior Consultant
Encompass Solutions

--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
>
>
>
>
>
> Jim,
>
> I got a chance to test out your solution and I am receiving a Foreign Key Constraint error from the AddWhereItem method.
>
>
> Error Detail
> ============
> Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
>
> Table: QueryWhereItem
> Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable' DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint QueryTableQueryWhereItem requires the child key values (MMI, sheath, MMI-PartAvailable, Part) to exist in the parent table.
>
>
> Stack Trace
> ===========
> at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
> at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters, DataSet ds, Int32 paramPos)
> at Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
> at Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
>
> Inner Exception
> ===============
> Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
>
> Inner Stack Trace
> =================
> at System.Data.DataSet.FailedEnableConstraints()
> at System.Data.DataSet.EnableConstraints()
> at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> at System.Data.DataTable.EndLoadData()
> at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
>
>
> Here is my code:
>
>
> Dim strValue as string = args.ProposedValue
>
> Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> dqa.BOConnect()
>
> Dim ds as New QueryDesignDataSet()
> ds = New QueryDesignDataSet()
>
> Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> ds = dqa.QueryDesignData
>
> Dim pcQueryID as String = "MMI-PartAvailable"
> Dim pcTable as String = "Part"
> Dim pcField as String = "PartNum"
> Dim pcCondition as String = "="
> Dim pbIsConst as Boolean = true
> Dim pcValue as String = strValue
> Dim pcToTable as String = String.Empty
> Dim pcToField as String = String.Empty
> Dim pcLeftParentheses as String = String.Empty
> Dim pcRightParentheses as String = String.Empty
> Dim pcAndOr as String = String.Empty
> Dim pbNeg as Boolean = false
>
> dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
>
> dqa.Executebyid("MMI-PartAvailable")
> Dim results As DataSet = dqa.QueryResults
> ugdEpiCustom1.DataSource = results
>
>
> Thanks for your help,
> Scott
>
> --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> >
> > Excellent, I knew it was a simple solution, I just could not see all of the pieces.
> >
> > The two diferent dataset types were throwing me off.
> >
> > Thanks
> >
> > --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> > >
> > >
> > >
> > > To add a where item
> > > Dim ds as New QueryDesignDataSet()
> > > ds = New QueryDesignDataSet()
> > >
> > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > ds = dqa.QueryDesignData
> > >
> > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > Dim pcTable as String = "WhatTable"
> > > Dim pcField as String = "WhatField"
> > > Dim pcCondition as String = "=" ' could <> > < etc
> > > Dim pbIsConst as Boolean = true
> > > Dim pcValue as String = "whatvaluetolookfor"
> > > Dim pcToTable as String = String.Empty
> > > Dim pcToField as String = String.Empty
> > > Dim pcLeftParentheses as String = String.Empty
> > > Dim pcRightParentheses as String = String.Empty
> > > Dim pcAndOr as String = String.Empty
> > > Dim pbNeg as Boolean = false
> > >
> > >
> > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > // repeat as needed to add all your where clauses, you can use parentheses and "AND" and "OR" if you need to.
> > >
> > > Jim Kinneman
> > > Senior Consultant
> > > Encompass Solutions Inc
> > >
> > > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > > >
> > > > I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.
> > > >
> > > > What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.
> > > >
> > > > I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:
> > > >
> > > > Dim PartNum as string = args.ProposedValue
> > > > Dim strWhereClause as string
> > > > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > > > dqa.BOConnect()
> > > >
> > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > >
> > > > Dim MorePages As Boolean
> > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > > > opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> > > > ugdEpiCustom1.DataSource = SearchResults
> > > >
> > > > Any ideas?
> > > >
> > >
> >
>
Jim,

We are running on 8.03.409c.

Here is my BAQ......................................................

for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company = PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part where (PlantWhse.Company = Part.Company and PlantWhse.PartNum = Part.PartNum) no-lock , each Warehse where (PartWhse.Company = Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode) no-lock


I am using the object explorer to verify my signatures. As far as I can see it matches your solution.

Here is the method signature from my version.........................

' Imports Epicor.Mfg.UI.Adapters

Dim [varAdapterName] As DynamicQueryAdapter = New DynamicQueryAdapter([UIForm])
[varAdapterName].BOConnect()

[varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)

[varAdapterName].Dispose()


Thanks Again,
Scott

--- In vantage@yahoogroups.com, "jckinneman" <jckinneman@...> wrote:
>
> What does your BAQ look like? What tables are included? What version of Epicor are you running on? The example I provided is based on Epicor 9, the BO signature may be different for 8.
>
> The primary way I explore how to call BOs is via the Business Logic Tester. All the systems I have worked on have it but I have also seen discussions that you might only be able to get it if you have the SDK. If you have the BL tester you can easily look at and test the signature for calling the BO. If you don't have the BL tester you can also, when in customization mode, use the Object Explorer to look at the signatures on the BO. If this is 8 we may have to adjust the signature on the call to whereitem.
>
> While the error prevents you from getting to it when you are ready to run your query you will want to use dqa.Execute(ds) ExecuteByID will run the BAQ as it exists in the db without the whereitems.
>
> Jim Kinneman
> Senior Consultant
> Encompass Solutions
>
> --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> >
> >
> >
> >
> >
> >
> > Jim,
> >
> > I got a chance to test out your solution and I am receiving a Foreign Key Constraint error from the AddWhereItem method.
> >
> >
> > Error Detail
> > ============
> > Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
> >
> > Table: QueryWhereItem
> > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable' DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint QueryTableQueryWhereItem requires the child key values (MMI, sheath, MMI-PartAvailable, Part) to exist in the parent table.
> >
> >
> > Stack Trace
> > ===========
> > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
> > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters, DataSet ds, Int32 paramPos)
> > at Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
> > at Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
> >
> > Inner Exception
> > ===============
> > Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
> >
> > Inner Stack Trace
> > =================
> > at System.Data.DataSet.FailedEnableConstraints()
> > at System.Data.DataSet.EnableConstraints()
> > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > at System.Data.DataTable.EndLoadData()
> > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
> >
> >
> > Here is my code:
> >
> >
> > Dim strValue as string = args.ProposedValue
> >
> > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > dqa.BOConnect()
> >
> > Dim ds as New QueryDesignDataSet()
> > ds = New QueryDesignDataSet()
> >
> > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > ds = dqa.QueryDesignData
> >
> > Dim pcQueryID as String = "MMI-PartAvailable"
> > Dim pcTable as String = "Part"
> > Dim pcField as String = "PartNum"
> > Dim pcCondition as String = "="
> > Dim pbIsConst as Boolean = true
> > Dim pcValue as String = strValue
> > Dim pcToTable as String = String.Empty
> > Dim pcToField as String = String.Empty
> > Dim pcLeftParentheses as String = String.Empty
> > Dim pcRightParentheses as String = String.Empty
> > Dim pcAndOr as String = String.Empty
> > Dim pbNeg as Boolean = false
> >
> > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> >
> > dqa.Executebyid("MMI-PartAvailable")
> > Dim results As DataSet = dqa.QueryResults
> > ugdEpiCustom1.DataSource = results
> >
> >
> > Thanks for your help,
> > Scott
> >
> > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > >
> > > Excellent, I knew it was a simple solution, I just could not see all of the pieces.
> > >
> > > The two diferent dataset types were throwing me off.
> > >
> > > Thanks
> > >
> > > --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> > > >
> > > >
> > > >
> > > > To add a where item
> > > > Dim ds as New QueryDesignDataSet()
> > > > ds = New QueryDesignDataSet()
> > > >
> > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > ds = dqa.QueryDesignData
> > > >
> > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > Dim pcTable as String = "WhatTable"
> > > > Dim pcField as String = "WhatField"
> > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > Dim pbIsConst as Boolean = true
> > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > Dim pcToTable as String = String.Empty
> > > > Dim pcToField as String = String.Empty
> > > > Dim pcLeftParentheses as String = String.Empty
> > > > Dim pcRightParentheses as String = String.Empty
> > > > Dim pcAndOr as String = String.Empty
> > > > Dim pbNeg as Boolean = false
> > > >
> > > >
> > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > > // repeat as needed to add all your where clauses, you can use parentheses and "AND" and "OR" if you need to.
> > > >
> > > > Jim Kinneman
> > > > Senior Consultant
> > > > Encompass Solutions Inc
> > > >
> > > > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > > > >
> > > > > I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.
> > > > >
> > > > > What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.
> > > > >
> > > > > I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:
> > > > >
> > > > > Dim PartNum as string = args.ProposedValue
> > > > > Dim strWhereClause as string
> > > > > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > > > > dqa.BOConnect()
> > > > >
> > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > >
> > > > > Dim MorePages As Boolean
> > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > >
> > > > > Any ideas?
> > > > >
> > > >
> > >
> >
>
I duplicated your issue in an 8 environment, there is something different about 8 with this BO that I haven't figured out. I do the exact same thing many times in 9 without any issues. Of course the BL tester in my 8 environment is not setup correctly and haven't had a chance to resolve that yet. When i get a few minutes I will dig into this deeper.

Jim Kinneman
Senior Consultant
Encompass Solutions, Inc

--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
>
>
>
>
>
> Jim,
>
> We are running on 8.03.409c.
>
> Here is my BAQ......................................................
>
> for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company = PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part where (PlantWhse.Company = Part.Company and PlantWhse.PartNum = Part.PartNum) no-lock , each Warehse where (PartWhse.Company = Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode) no-lock
>
>
> I am using the object explorer to verify my signatures. As far as I can see it matches your solution.
>
> Here is the method signature from my version.........................
>
> ' Imports Epicor.Mfg.UI.Adapters
>
> Dim [varAdapterName] As DynamicQueryAdapter = New DynamicQueryAdapter([UIForm])
> [varAdapterName].BOConnect()
>
> [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
>
> [varAdapterName].Dispose()
>
>
> Thanks Again,
> Scott
>
> --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> >
> > What does your BAQ look like? What tables are included? What version of Epicor are you running on? The example I provided is based on Epicor 9, the BO signature may be different for 8.
> >
> > The primary way I explore how to call BOs is via the Business Logic Tester. All the systems I have worked on have it but I have also seen discussions that you might only be able to get it if you have the SDK. If you have the BL tester you can easily look at and test the signature for calling the BO. If you don't have the BL tester you can also, when in customization mode, use the Object Explorer to look at the signatures on the BO. If this is 8 we may have to adjust the signature on the call to whereitem.
> >
> > While the error prevents you from getting to it when you are ready to run your query you will want to use dqa.Execute(ds) ExecuteByID will run the BAQ as it exists in the db without the whereitems.
> >
> > Jim Kinneman
> > Senior Consultant
> > Encompass Solutions
> >
> > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > Jim,
> > >
> > > I got a chance to test out your solution and I am receiving a Foreign Key Constraint error from the AddWhereItem method.
> > >
> > >
> > > Error Detail
> > > ============
> > > Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
> > >
> > > Table: QueryWhereItem
> > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable' DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint QueryTableQueryWhereItem requires the child key values (MMI, sheath, MMI-PartAvailable, Part) to exist in the parent table.
> > >
> > >
> > > Stack Trace
> > > ===========
> > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
> > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters, DataSet ds, Int32 paramPos)
> > > at Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
> > > at Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataSet ds, String pcQueryID, String pcTable, String pcField, String pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String pcToField, String pcLeftParentheses, String pcRightParentheses, String pcAndOr, Boolean pbNeg)
> > >
> > > Inner Exception
> > > ===============
> > > Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
> > >
> > > Inner Stack Trace
> > > =================
> > > at System.Data.DataSet.FailedEnableConstraints()
> > > at System.Data.DataSet.EnableConstraints()
> > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > at System.Data.DataTable.EndLoadData()
> > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT, DataTable targetDT)
> > >
> > >
> > > Here is my code:
> > >
> > >
> > > Dim strValue as string = args.ProposedValue
> > >
> > > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > > dqa.BOConnect()
> > >
> > > Dim ds as New QueryDesignDataSet()
> > > ds = New QueryDesignDataSet()
> > >
> > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > ds = dqa.QueryDesignData
> > >
> > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > Dim pcTable as String = "Part"
> > > Dim pcField as String = "PartNum"
> > > Dim pcCondition as String = "="
> > > Dim pbIsConst as Boolean = true
> > > Dim pcValue as String = strValue
> > > Dim pcToTable as String = String.Empty
> > > Dim pcToField as String = String.Empty
> > > Dim pcLeftParentheses as String = String.Empty
> > > Dim pcRightParentheses as String = String.Empty
> > > Dim pcAndOr as String = String.Empty
> > > Dim pbNeg as Boolean = false
> > >
> > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > >
> > > dqa.Executebyid("MMI-PartAvailable")
> > > Dim results As DataSet = dqa.QueryResults
> > > ugdEpiCustom1.DataSource = results
> > >
> > >
> > > Thanks for your help,
> > > Scott
> > >
> > > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > > >
> > > > Excellent, I knew it was a simple solution, I just could not see all of the pieces.
> > > >
> > > > The two diferent dataset types were throwing me off.
> > > >
> > > > Thanks
> > > >
> > > > --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> > > > >
> > > > >
> > > > >
> > > > > To add a where item
> > > > > Dim ds as New QueryDesignDataSet()
> > > > > ds = New QueryDesignDataSet()
> > > > >
> > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > ds = dqa.QueryDesignData
> > > > >
> > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > Dim pcTable as String = "WhatTable"
> > > > > Dim pcField as String = "WhatField"
> > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > Dim pbIsConst as Boolean = true
> > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > Dim pcToTable as String = String.Empty
> > > > > Dim pcToField as String = String.Empty
> > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > Dim pcRightParentheses as String = String.Empty
> > > > > Dim pcAndOr as String = String.Empty
> > > > > Dim pbNeg as Boolean = false
> > > > >
> > > > >
> > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > > > // repeat as needed to add all your where clauses, you can use parentheses and "AND" and "OR" if you need to.
> > > > >
> > > > > Jim Kinneman
> > > > > Senior Consultant
> > > > > Encompass Solutions Inc
> > > > >
> > > > > --- In vantage@yahoogroups.com, "thedemondamian" <sheath@> wrote:
> > > > > >
> > > > > > I don't have a problem using the DynamicQueryAdapter to run a BAQ and get results from within the script editor of a form.
> > > > > >
> > > > > > What I do want to know is how to add a WHERE clause to the query adapter in order to filter the results of the BAQ.
> > > > > >
> > > > > > I have tried the built in AddWhereItem, InvokeSearch and LoadUserResults methods with no luck. Here is my latest code:
> > > > > >
> > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > Dim strWhereClause as string
> > > > > > Dim dqa As DynamicQueryAdapter = New DynamicQueryAdapter(SalesOrderForm)
> > > > > > dqa.BOConnect()
> > > > > >
> > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > >
> > > > > > Dim MorePages As Boolean
> > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse", strWhereClause)
> > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts, MorePages)
> > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > >
> > > > > > Any ideas?
> > > > > >
> > > > >
> > > >
> > >
> >
>
I was following this thread because I need this same functionality for
one of my customizations.

I'm on E9.04 and I'm getting the same issue as Scott.



I've been debugging for several hours and it looks like the problem is
related to the line that reads: ds = dqa.QueryDesignData

It looks like once this line executes, that there is no data in "ds". So
when you try to use the AddWhereItem method, it's puking because there
is no existing data that defines the BAQ.

It essential saying that there is no information related to the
AddWhereItem that your trying to add so I can't add it.



What I find equally confusing is that the BL Tester states that the
GetQueryByID should be returning a QueryDesignDataSet not a Boolean.

To me, the line should read: ds = dqa.GetQueryByID("IDNAME")

Of course you can't do that because the script editor insists that it is
going to return a Boolean.



Maybe someone else can chime in with an answer.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of jckinneman
Sent: Tuesday, August 03, 2010 7:05 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Using the DynamicQyeryAdapter







I duplicated your issue in an 8 environment, there is something
different about 8 with this BO that I haven't figured out. I do the
exact same thing many times in 9 without any issues. Of course the BL
tester in my 8 environment is not setup correctly and haven't had a
chance to resolve that yet. When i get a few minutes I will dig into
this deeper.

Jim Kinneman
Senior Consultant
Encompass Solutions, Inc

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"thedemondamian" <sheath@...> wrote:
>
>
>
>
>
>
> Jim,
>
> We are running on 8.03.409c.
>
> Here is my BAQ......................................................
>
> for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company =
PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part
where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode)
no-lock
>
>
> I am using the object explorer to verify my signatures. As far as I
can see it matches your solution.
>
> Here is the method signature from my version.........................
>
> ' Imports Epicor.Mfg.UI.Adapters
>
> Dim [varAdapterName] As DynamicQueryAdapter = New
DynamicQueryAdapter([UIForm])
> [varAdapterName].BOConnect()
>
> [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
>
> [varAdapterName].Dispose()
>
>
> Thanks Again,
> Scott
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"jckinneman" <jckinneman@> wrote:
> >
> > What does your BAQ look like? What tables are included? What version
of Epicor are you running on? The example I provided is based on Epicor
9, the BO signature may be different for 8.
> >
> > The primary way I explore how to call BOs is via the Business Logic
Tester. All the systems I have worked on have it but I have also seen
discussions that you might only be able to get it if you have the SDK.
If you have the BL tester you can easily look at and test the signature
for calling the BO. If you don't have the BL tester you can also, when
in customization mode, use the Object Explorer to look at the signatures
on the BO. If this is 8 we may have to adjust the signature on the call
to whereitem.
> >
> > While the error prevents you from getting to it when you are ready
to run your query you will want to use dqa.Execute(ds) ExecuteByID will
run the BAQ as it exists in the db without the whereitems.
> >
> > Jim Kinneman
> > Senior Consultant
> > Encompass Solutions
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"thedemondamian" <sheath@> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > Jim,
> > >
> > > I got a chance to test out your solution and I am receiving a
Foreign Key Constraint error from the AddWhereItem method.
> > >
> > >
> > > Error Detail
> > > ============
> > > Failed to enable constraints. One or more rows contain values
violating non-null, unique, or foreign-key constraints.
> > >
> > > Table: QueryWhereItem
> > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable'
DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
QueryTableQueryWhereItem requires the child key values (MMI, sheath,
MMI-PartAvailable, Part) to exist in the parent table.
> > >
> > >
> > > Stack Trace
> > > ===========
> > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
DataTable targetDT)
> > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters,
DataSet ds, Int32 paramPos)
> > > at
Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
String pcQueryID, String pcTable, String pcField, String pcCondition,
Boolean pbIsConst, String pcValue, String pcToTable, String pcToField,
String pcLeftParentheses, String pcRightParentheses, String pcAndOr,
Boolean pbNeg)
> > > at
Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
et ds, String pcQueryID, String pcTable, String pcField, String
pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String
pcToField, String pcLeftParentheses, String pcRightParentheses, String
pcAndOr, Boolean pbNeg)
> > >
> > > Inner Exception
> > > ===============
> > > Failed to enable constraints. One or more rows contain values
violating non-null, unique, or foreign-key constraints.
> > >
> > > Inner Stack Trace
> > > =================
> > > at System.Data.DataSet.FailedEnableConstraints()
> > > at System.Data.DataSet.EnableConstraints()
> > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > at System.Data.DataTable.EndLoadData()
> > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
DataTable targetDT)
> > >
> > >
> > > Here is my code:
> > >
> > >
> > > Dim strValue as string = args.ProposedValue
> > >
> > > Dim dqa As DynamicQueryAdapter = New
DynamicQueryAdapter(SalesOrderForm)
> > > dqa.BOConnect()
> > >
> > > Dim ds as New QueryDesignDataSet()
> > > ds = New QueryDesignDataSet()
> > >
> > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > ds = dqa.QueryDesignData
> > >
> > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > Dim pcTable as String = "Part"
> > > Dim pcField as String = "PartNum"
> > > Dim pcCondition as String = "="
> > > Dim pbIsConst as Boolean = true
> > > Dim pcValue as String = strValue
> > > Dim pcToTable as String = String.Empty
> > > Dim pcToField as String = String.Empty
> > > Dim pcLeftParentheses as String = String.Empty
> > > Dim pcRightParentheses as String = String.Empty
> > > Dim pcAndOr as String = String.Empty
> > > Dim pbNeg as Boolean = false
> > >
> > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
pcRightParentheses, pcAndOr, pbNeg)
> > >
> > > dqa.Executebyid("MMI-PartAvailable")
> > > Dim results As DataSet = dqa.QueryResults
> > > ugdEpiCustom1.DataSource = results
> > >
> > >
> > > Thanks for your help,
> > > Scott
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
, "thedemondamian" <sheath@> wrote:
> > > >
> > > > Excellent, I knew it was a simple solution, I just could not see
all of the pieces.
> > > >
> > > > The two diferent dataset types were throwing me off.
> > > >
> > > > Thanks
> > > >
> > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@> wrote:
> > > > >
> > > > >
> > > > >
> > > > > To add a where item
> > > > > Dim ds as New QueryDesignDataSet()
> > > > > ds = New QueryDesignDataSet()
> > > > >
> > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > ds = dqa.QueryDesignData
> > > > >
> > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > Dim pcTable as String = "WhatTable"
> > > > > Dim pcField as String = "WhatField"
> > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > Dim pbIsConst as Boolean = true
> > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > Dim pcToTable as String = String.Empty
> > > > > Dim pcToField as String = String.Empty
> > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > Dim pcRightParentheses as String = String.Empty
> > > > > Dim pcAndOr as String = String.Empty
> > > > > Dim pbNeg as Boolean = false
> > > > >
> > > > >
> > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
pcRightParentheses, pcAndOr, pbNeg)
> > > > > // repeat as needed to add all your where clauses, you can use
parentheses and "AND" and "OR" if you need to.
> > > > >
> > > > > Jim Kinneman
> > > > > Senior Consultant
> > > > > Encompass Solutions Inc
> > > > >
> > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@> wrote:
> > > > > >
> > > > > > I don't have a problem using the DynamicQueryAdapter to run
a BAQ and get results from within the script editor of a form.
> > > > > >
> > > > > > What I do want to know is how to add a WHERE clause to the
query adapter in order to filter the results of the BAQ.
> > > > > >
> > > > > > I have tried the built in AddWhereItem, InvokeSearch and
LoadUserResults methods with no luck. Here is my latest code:
> > > > > >
> > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > Dim strWhereClause as string
> > > > > > Dim dqa As DynamicQueryAdapter = New
DynamicQueryAdapter(SalesOrderForm)
> > > > > > dqa.BOConnect()
> > > > > >
> > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > >
> > > > > > Dim MorePages As Boolean
> > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > Dim opts As SearchOptions = New
SearchOptions(SearchMode.AutoSearch)
> > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
strWhereClause)
> > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts,
MorePages)
> > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > >
> > > > > > Any ideas?
> > > > > >
> > > > >
> > > >
> > >
> >
>





[Non-text portions of this message have been removed]
I haven't had a chance to get back in and look at this further but one thing to remember when working with the BL tester this works directly with the BO. The example we are working with is supposed to be the adapter approach. In a customization you can use the adapter approach or the BO direct method. Your comment and thinking about things I may have mixed and matched some of the two approaches in writing things from memory and grabbing snippets of code from here and there.

I should be able to grab a few minutes tomorrow and start from scratch and put together a clean example.

Jim Kinneman

--- In vantage@yahoogroups.com, Joe Rojas <jrojas@...> wrote:
>
> I was following this thread because I need this same functionality for
> one of my customizations.
>
> I'm on E9.04 and I'm getting the same issue as Scott.
>
>
>
> I've been debugging for several hours and it looks like the problem is
> related to the line that reads: ds = dqa.QueryDesignData
>
> It looks like once this line executes, that there is no data in "ds". So
> when you try to use the AddWhereItem method, it's puking because there
> is no existing data that defines the BAQ.
>
> It essential saying that there is no information related to the
> AddWhereItem that your trying to add so I can't add it.
>
>
>
> What I find equally confusing is that the BL Tester states that the
> GetQueryByID should be returning a QueryDesignDataSet not a Boolean.
>
> To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
>
> Of course you can't do that because the script editor insists that it is
> going to return a Boolean.
>
>
>
> Maybe someone else can chime in with an answer.
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of jckinneman
> Sent: Tuesday, August 03, 2010 7:05 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Using the DynamicQyeryAdapter
>
>
>
>
>
>
>
> I duplicated your issue in an 8 environment, there is something
> different about 8 with this BO that I haven't figured out. I do the
> exact same thing many times in 9 without any issues. Of course the BL
> tester in my 8 environment is not setup correctly and haven't had a
> chance to resolve that yet. When i get a few minutes I will dig into
> this deeper.
>
> Jim Kinneman
> Senior Consultant
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> "thedemondamian" <sheath@> wrote:
> >
> >
> >
> >
> >
> >
> > Jim,
> >
> > We are running on 8.03.409c.
> >
> > Here is my BAQ......................................................
> >
> > for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company =
> PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part
> where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode)
> no-lock
> >
> >
> > I am using the object explorer to verify my signatures. As far as I
> can see it matches your solution.
> >
> > Here is the method signature from my version.........................
> >
> > ' Imports Epicor.Mfg.UI.Adapters
> >
> > Dim [varAdapterName] As DynamicQueryAdapter = New
> DynamicQueryAdapter([UIForm])
> > [varAdapterName].BOConnect()
> >
> > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> >
> > [varAdapterName].Dispose()
> >
> >
> > Thanks Again,
> > Scott
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> "jckinneman" <jckinneman@> wrote:
> > >
> > > What does your BAQ look like? What tables are included? What version
> of Epicor are you running on? The example I provided is based on Epicor
> 9, the BO signature may be different for 8.
> > >
> > > The primary way I explore how to call BOs is via the Business Logic
> Tester. All the systems I have worked on have it but I have also seen
> discussions that you might only be able to get it if you have the SDK.
> If you have the BL tester you can easily look at and test the signature
> for calling the BO. If you don't have the BL tester you can also, when
> in customization mode, use the Object Explorer to look at the signatures
> on the BO. If this is 8 we may have to adjust the signature on the call
> to whereitem.
> > >
> > > While the error prevents you from getting to it when you are ready
> to run your query you will want to use dqa.Execute(ds) ExecuteByID will
> run the BAQ as it exists in the db without the whereitems.
> > >
> > > Jim Kinneman
> > > Senior Consultant
> > > Encompass Solutions
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> "thedemondamian" <sheath@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Jim,
> > > >
> > > > I got a chance to test out your solution and I am receiving a
> Foreign Key Constraint error from the AddWhereItem method.
> > > >
> > > >
> > > > Error Detail
> > > > ============
> > > > Failed to enable constraints. One or more rows contain values
> violating non-null, unique, or foreign-key constraints.
> > > >
> > > > Table: QueryWhereItem
> > > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable'
> DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> QueryTableQueryWhereItem requires the child key values (MMI, sheath,
> MMI-PartAvailable, Part) to exist in the parent table.
> > > >
> > > >
> > > > Stack Trace
> > > > ===========
> > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> DataTable targetDT)
> > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters,
> DataSet ds, Int32 paramPos)
> > > > at
> Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> String pcQueryID, String pcTable, String pcField, String pcCondition,
> Boolean pbIsConst, String pcValue, String pcToTable, String pcToField,
> String pcLeftParentheses, String pcRightParentheses, String pcAndOr,
> Boolean pbNeg)
> > > > at
> Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> et ds, String pcQueryID, String pcTable, String pcField, String
> pcCondition, Boolean pbIsConst, String pcValue, String pcToTable, String
> pcToField, String pcLeftParentheses, String pcRightParentheses, String
> pcAndOr, Boolean pbNeg)
> > > >
> > > > Inner Exception
> > > > ===============
> > > > Failed to enable constraints. One or more rows contain values
> violating non-null, unique, or foreign-key constraints.
> > > >
> > > > Inner Stack Trace
> > > > =================
> > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > at System.Data.DataSet.EnableConstraints()
> > > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > > at System.Data.DataTable.EndLoadData()
> > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> DataTable targetDT)
> > > >
> > > >
> > > > Here is my code:
> > > >
> > > >
> > > > Dim strValue as string = args.ProposedValue
> > > >
> > > > Dim dqa As DynamicQueryAdapter = New
> DynamicQueryAdapter(SalesOrderForm)
> > > > dqa.BOConnect()
> > > >
> > > > Dim ds as New QueryDesignDataSet()
> > > > ds = New QueryDesignDataSet()
> > > >
> > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > ds = dqa.QueryDesignData
> > > >
> > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > Dim pcTable as String = "Part"
> > > > Dim pcField as String = "PartNum"
> > > > Dim pcCondition as String = "="
> > > > Dim pbIsConst as Boolean = true
> > > > Dim pcValue as String = strValue
> > > > Dim pcToTable as String = String.Empty
> > > > Dim pcToField as String = String.Empty
> > > > Dim pcLeftParentheses as String = String.Empty
> > > > Dim pcRightParentheses as String = String.Empty
> > > > Dim pcAndOr as String = String.Empty
> > > > Dim pbNeg as Boolean = false
> > > >
> > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> pcRightParentheses, pcAndOr, pbNeg)
> > > >
> > > > dqa.Executebyid("MMI-PartAvailable")
> > > > Dim results As DataSet = dqa.QueryResults
> > > > ugdEpiCustom1.DataSource = results
> > > >
> > > >
> > > > Thanks for your help,
> > > > Scott
> > > >
> > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> , "thedemondamian" <sheath@> wrote:
> > > > >
> > > > > Excellent, I knew it was a simple solution, I just could not see
> all of the pieces.
> > > > >
> > > > > The two diferent dataset types were throwing me off.
> > > > >
> > > > > Thanks
> > > > >
> > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > To add a where item
> > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > ds = New QueryDesignDataSet()
> > > > > >
> > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > ds = dqa.QueryDesignData
> > > > > >
> > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > Dim pcTable as String = "WhatTable"
> > > > > > Dim pcField as String = "WhatField"
> > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > Dim pbIsConst as Boolean = true
> > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > Dim pcToTable as String = String.Empty
> > > > > > Dim pcToField as String = String.Empty
> > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > Dim pcAndOr as String = String.Empty
> > > > > > Dim pbNeg as Boolean = false
> > > > > >
> > > > > >
> > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> pcRightParentheses, pcAndOr, pbNeg)
> > > > > > // repeat as needed to add all your where clauses, you can use
> parentheses and "AND" and "OR" if you need to.
> > > > > >
> > > > > > Jim Kinneman
> > > > > > Senior Consultant
> > > > > > Encompass Solutions Inc
> > > > > >
> > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@> wrote:
> > > > > > >
> > > > > > > I don't have a problem using the DynamicQueryAdapter to run
> a BAQ and get results from within the script editor of a form.
> > > > > > >
> > > > > > > What I do want to know is how to add a WHERE clause to the
> query adapter in order to filter the results of the BAQ.
> > > > > > >
> > > > > > > I have tried the built in AddWhereItem, InvokeSearch and
> LoadUserResults methods with no luck. Here is my latest code:
> > > > > > >
> > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > Dim strWhereClause as string
> > > > > > > Dim dqa As DynamicQueryAdapter = New
> DynamicQueryAdapter(SalesOrderForm)
> > > > > > > dqa.BOConnect()
> > > > > > >
> > > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > >
> > > > > > > Dim MorePages As Boolean
> > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > Dim opts As SearchOptions = New
> SearchOptions(SearchMode.AutoSearch)
> > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> strWhereClause)
> > > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts,
> MorePages)
> > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > >
> > > > > > > Any ideas?
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Well, after banging my head against the wall on how to use the
DynamicQueryAdapter, I called Epicor and asked for a coding example of
how to add a runtime criteria before executing the BAQ. I am waiting for
a response.



In the meantime, I noticed how Jim said that you can either use the
adapter or use the BO directly.

I had luck using the BL Tester so I gave the BO approach a try with
success.

Below is my code.

I didn't know how to access the existing session object so I had to
create a new one, which required me to add Epicor.Mfg.Core.Session and
Epicor.Mfg.Core.BLConnectionPool as references.

Anyone know how to access the current session?



Dim episession As Session = New Session(<username>, <password>,
"AppServerDC://<server name>:<port>", Session.LicenseType.Default)

Dim dqa As DynamicQuery = New DynamicQuery(episession.ConnectionPool)

Dim ds As QueryDesignDataSet = dqa.GetByID("MATS-ProjectInfluencers")



Dim pcQueryID as String = "MATS-ProjectInfluencers"

Dim pcTable as String = "UD04"

Dim pcField as String = "Key1"

Dim pcCondition as String = "="

Dim pbIsConst as Boolean = true

Dim pcValue as String = "2010-0"

Dim pcToTable as String = String.Empty

Dim pcToField as String = String.Empty

Dim pcLeftParentheses as String = String.Empty

Dim pcRightParentheses as String = String.Empty

Dim pcAndOr as String = String.Empty

Dim pbNeg as Boolean = false

dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
pcRightParentheses, pcAndOr, pbNeg)

Dim DQResults As DataSet = dqa.Execute(ds)

ugInfluencers.DataSource = DQResults



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of jckinneman
Sent: Wednesday, August 04, 2010 7:26 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Using the DynamicQyeryAdapter





I haven't had a chance to get back in and look at this further but one
thing to remember when working with the BL tester this works directly
with the BO. The example we are working with is supposed to be the
adapter approach. In a customization you can use the adapter approach or
the BO direct method. Your comment and thinking about things I may have
mixed and matched some of the two approaches in writing things from
memory and grabbing snippets of code from here and there.

I should be able to grab a few minutes tomorrow and start from scratch
and put together a clean example.

Jim Kinneman

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , Joe
Rojas <jrojas@...> wrote:
>
> I was following this thread because I need this same functionality for
> one of my customizations.
>
> I'm on E9.04 and I'm getting the same issue as Scott.
>
>
>
> I've been debugging for several hours and it looks like the problem is
> related to the line that reads: ds = dqa.QueryDesignData
>
> It looks like once this line executes, that there is no data in "ds".
So
> when you try to use the AddWhereItem method, it's puking because there
> is no existing data that defines the BAQ.
>
> It essential saying that there is no information related to the
> AddWhereItem that your trying to add so I can't add it.
>
>
>
> What I find equally confusing is that the BL Tester states that the
> GetQueryByID should be returning a QueryDesignDataSet not a Boolean.
>
> To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
>
> Of course you can't do that because the script editor insists that it
is
> going to return a Boolean.
>
>
>
> Maybe someone else can chime in with an answer.
>
>
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
> Of jckinneman
> Sent: Tuesday, August 03, 2010 7:05 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Re: Using the DynamicQyeryAdapter
>
>
>
>
>
>
>
> I duplicated your issue in an 8 environment, there is something
> different about 8 with this BO that I haven't figured out. I do the
> exact same thing many times in 9 without any issues. Of course the BL
> tester in my 8 environment is not setup correctly and haven't had a
> chance to resolve that yet. When i get a few minutes I will dig into
> this deeper.
>
> Jim Kinneman
> Senior Consultant
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ,
> "thedemondamian" <sheath@> wrote:
> >
> >
> >
> >
> >
> >
> > Jim,
> >
> > We are running on 8.03.409c.
> >
> > Here is my BAQ......................................................
> >
> > for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company
=
> PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part
> where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode)
> no-lock
> >
> >
> > I am using the object explorer to verify my signatures. As far as I
> can see it matches your solution.
> >
> > Here is the method signature from my
version.........................
> >
> > ' Imports Epicor.Mfg.UI.Adapters
> >
> > Dim [varAdapterName] As DynamicQueryAdapter = New
> DynamicQueryAdapter([UIForm])
> > [varAdapterName].BOConnect()
> >
> > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> >
> > [varAdapterName].Dispose()
> >
> >
> > Thanks Again,
> > Scott
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ,
> "jckinneman" <jckinneman@> wrote:
> > >
> > > What does your BAQ look like? What tables are included? What
version
> of Epicor are you running on? The example I provided is based on
Epicor
> 9, the BO signature may be different for 8.
> > >
> > > The primary way I explore how to call BOs is via the Business
Logic
> Tester. All the systems I have worked on have it but I have also seen
> discussions that you might only be able to get it if you have the SDK.
> If you have the BL tester you can easily look at and test the
signature
> for calling the BO. If you don't have the BL tester you can also, when
> in customization mode, use the Object Explorer to look at the
signatures
> on the BO. If this is 8 we may have to adjust the signature on the
call
> to whereitem.
> > >
> > > While the error prevents you from getting to it when you are ready
> to run your query you will want to use dqa.Execute(ds) ExecuteByID
will
> run the BAQ as it exists in the db without the whereitems.
> > >
> > > Jim Kinneman
> > > Senior Consultant
> > > Encompass Solutions
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ,
> "thedemondamian" <sheath@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Jim,
> > > >
> > > > I got a chance to test out your solution and I am receiving a
> Foreign Key Constraint error from the AddWhereItem method.
> > > >
> > > >
> > > > Error Detail
> > > > ============
> > > > Failed to enable constraints. One or more rows contain values
> violating non-null, unique, or foreign-key constraints.
> > > >
> > > > Table: QueryWhereItem
> > > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable'
> DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> QueryTableQueryWhereItem requires the child key values (MMI, sheath,
> MMI-PartAvailable, Part) to exist in the parent table.
> > > >
> > > >
> > > > Stack Trace
> > > > ===========
> > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> DataTable targetDT)
> > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters,
> DataSet ds, Int32 paramPos)
> > > > at
> Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> String pcQueryID, String pcTable, String pcField, String pcCondition,
> Boolean pbIsConst, String pcValue, String pcToTable, String pcToField,
> String pcLeftParentheses, String pcRightParentheses, String pcAndOr,
> Boolean pbNeg)
> > > > at
>
Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> et ds, String pcQueryID, String pcTable, String pcField, String
> pcCondition, Boolean pbIsConst, String pcValue, String pcToTable,
String
> pcToField, String pcLeftParentheses, String pcRightParentheses, String
> pcAndOr, Boolean pbNeg)
> > > >
> > > > Inner Exception
> > > > ===============
> > > > Failed to enable constraints. One or more rows contain values
> violating non-null, unique, or foreign-key constraints.
> > > >
> > > > Inner Stack Trace
> > > > =================
> > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > at System.Data.DataSet.EnableConstraints()
> > > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > > at System.Data.DataTable.EndLoadData()
> > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> DataTable targetDT)
> > > >
> > > >
> > > > Here is my code:
> > > >
> > > >
> > > > Dim strValue as string = args.ProposedValue
> > > >
> > > > Dim dqa As DynamicQueryAdapter = New
> DynamicQueryAdapter(SalesOrderForm)
> > > > dqa.BOConnect()
> > > >
> > > > Dim ds as New QueryDesignDataSet()
> > > > ds = New QueryDesignDataSet()
> > > >
> > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > ds = dqa.QueryDesignData
> > > >
> > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > Dim pcTable as String = "Part"
> > > > Dim pcField as String = "PartNum"
> > > > Dim pcCondition as String = "="
> > > > Dim pbIsConst as Boolean = true
> > > > Dim pcValue as String = strValue
> > > > Dim pcToTable as String = String.Empty
> > > > Dim pcToField as String = String.Empty
> > > > Dim pcLeftParentheses as String = String.Empty
> > > > Dim pcRightParentheses as String = String.Empty
> > > > Dim pcAndOr as String = String.Empty
> > > > Dim pbNeg as Boolean = false
> > > >
> > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> pcRightParentheses, pcAndOr, pbNeg)
> > > >
> > > > dqa.Executebyid("MMI-PartAvailable")
> > > > Dim results As DataSet = dqa.QueryResults
> > > > ugdEpiCustom1.DataSource = results
> > > >
> > > >
> > > > Thanks for your help,
> > > > Scott
> > > >
> > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> , "thedemondamian" <sheath@> wrote:
> > > > >
> > > > > Excellent, I knew it was a simple solution, I just could not
see
> all of the pieces.
> > > > >
> > > > > The two diferent dataset types were throwing me off.
> > > > >
> > > > > Thanks
> > > > >
> > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > To add a where item
> > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > ds = New QueryDesignDataSet()
> > > > > >
> > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > ds = dqa.QueryDesignData
> > > > > >
> > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > Dim pcTable as String = "WhatTable"
> > > > > > Dim pcField as String = "WhatField"
> > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > Dim pbIsConst as Boolean = true
> > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > Dim pcToTable as String = String.Empty
> > > > > > Dim pcToField as String = String.Empty
> > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > Dim pcAndOr as String = String.Empty
> > > > > > Dim pbNeg as Boolean = false
> > > > > >
> > > > > >
> > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
pcCondition,
> pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> pcRightParentheses, pcAndOr, pbNeg)
> > > > > > // repeat as needed to add all your where clauses, you can
use
> parentheses and "AND" and "OR" if you need to.
> > > > > >
> > > > > > Jim Kinneman
> > > > > > Senior Consultant
> > > > > > Encompass Solutions Inc
> > > > > >
> > > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@> wrote:
> > > > > > >
> > > > > > > I don't have a problem using the DynamicQueryAdapter to
run
> a BAQ and get results from within the script editor of a form.
> > > > > > >
> > > > > > > What I do want to know is how to add a WHERE clause to the
> query adapter in order to filter the results of the BAQ.
> > > > > > >
> > > > > > > I have tried the built in AddWhereItem, InvokeSearch and
> LoadUserResults methods with no luck. Here is my latest code:
> > > > > > >
> > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > Dim strWhereClause as string
> > > > > > > Dim dqa As DynamicQueryAdapter = New
> DynamicQueryAdapter(SalesOrderForm)
> > > > > > > dqa.BOConnect()
> > > > > > >
> > > > > > > Dim test As Boolean =
dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > >
> > > > > > > Dim MorePages As Boolean
> > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > Dim opts As SearchOptions = New
> SearchOptions(SearchMode.AutoSearch)
> > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> strWhereClause)
> > > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts,
> MorePages)
> > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > >
> > > > > > > Any ideas?
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>




[Non-text portions of this message have been removed]
Sorry haven't had a chance to get into this deeper.

Supposedly from the object explorer you can do this.
SalesOrderTrackerForm.Session.ConnectionPool

In Epicor 9 you have to cast the session object first and then refer to the connectionpool, in 8 you may be able to reference it directly.

Epicor.Mfg.Core.Session s = (Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;

SchedulingBoardBO = new Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);

JK.

--- In vantage@yahoogroups.com, Joe Rojas <jrojas@...> wrote:
>
> Well, after banging my head against the wall on how to use the
> DynamicQueryAdapter, I called Epicor and asked for a coding example of
> how to add a runtime criteria before executing the BAQ. I am waiting for
> a response.
>
>
>
> In the meantime, I noticed how Jim said that you can either use the
> adapter or use the BO directly.
>
> I had luck using the BL Tester so I gave the BO approach a try with
> success.
>
> Below is my code.
>
> I didn't know how to access the existing session object so I had to
> create a new one, which required me to add Epicor.Mfg.Core.Session and
> Epicor.Mfg.Core.BLConnectionPool as references.
>
> Anyone know how to access the current session?
>
>
>
> Dim episession As Session = New Session(<username>, <password>,
> "AppServerDC://<server name>:<port>", Session.LicenseType.Default)
>
> Dim dqa As DynamicQuery = New DynamicQuery(episession.ConnectionPool)
>
> Dim ds As QueryDesignDataSet = dqa.GetByID("MATS-ProjectInfluencers")
>
>
>
> Dim pcQueryID as String = "MATS-ProjectInfluencers"
>
> Dim pcTable as String = "UD04"
>
> Dim pcField as String = "Key1"
>
> Dim pcCondition as String = "="
>
> Dim pbIsConst as Boolean = true
>
> Dim pcValue as String = "2010-0"
>
> Dim pcToTable as String = String.Empty
>
> Dim pcToField as String = String.Empty
>
> Dim pcLeftParentheses as String = String.Empty
>
> Dim pcRightParentheses as String = String.Empty
>
> Dim pcAndOr as String = String.Empty
>
> Dim pbNeg as Boolean = false
>
> dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> pcRightParentheses, pcAndOr, pbNeg)
>
> Dim DQResults As DataSet = dqa.Execute(ds)
>
> ugInfluencers.DataSource = DQResults
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of jckinneman
> Sent: Wednesday, August 04, 2010 7:26 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Using the DynamicQyeryAdapter
>
>
>
>
>
> I haven't had a chance to get back in and look at this further but one
> thing to remember when working with the BL tester this works directly
> with the BO. The example we are working with is supposed to be the
> adapter approach. In a customization you can use the adapter approach or
> the BO direct method. Your comment and thinking about things I may have
> mixed and matched some of the two approaches in writing things from
> memory and grabbing snippets of code from here and there.
>
> I should be able to grab a few minutes tomorrow and start from scratch
> and put together a clean example.
>
> Jim Kinneman
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , Joe
> Rojas <jrojas@> wrote:
> >
> > I was following this thread because I need this same functionality for
> > one of my customizations.
> >
> > I'm on E9.04 and I'm getting the same issue as Scott.
> >
> >
> >
> > I've been debugging for several hours and it looks like the problem is
> > related to the line that reads: ds = dqa.QueryDesignData
> >
> > It looks like once this line executes, that there is no data in "ds".
> So
> > when you try to use the AddWhereItem method, it's puking because there
> > is no existing data that defines the BAQ.
> >
> > It essential saying that there is no information related to the
> > AddWhereItem that your trying to add so I can't add it.
> >
> >
> >
> > What I find equally confusing is that the BL Tester states that the
> > GetQueryByID should be returning a QueryDesignDataSet not a Boolean.
> >
> > To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
> >
> > Of course you can't do that because the script editor insists that it
> is
> > going to return a Boolean.
> >
> >
> >
> > Maybe someone else can chime in with an answer.
> >
> >
> >
> > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> Behalf
> > Of jckinneman
> > Sent: Tuesday, August 03, 2010 7:05 PM
> > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> >
> >
> >
> >
> >
> >
> >
> > I duplicated your issue in an 8 environment, there is something
> > different about 8 with this BO that I haven't figured out. I do the
> > exact same thing many times in 9 without any issues. Of course the BL
> > tester in my 8 environment is not setup correctly and haven't had a
> > chance to resolve that yet. When i get a few minutes I will dig into
> > this deeper.
> >
> > Jim Kinneman
> > Senior Consultant
> > Encompass Solutions, Inc
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ,
> > "thedemondamian" <sheath@> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > Jim,
> > >
> > > We are running on 8.03.409c.
> > >
> > > Here is my BAQ......................................................
> > >
> > > for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company
> =
> > PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> > PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part
> > where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> > Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> > Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode)
> > no-lock
> > >
> > >
> > > I am using the object explorer to verify my signatures. As far as I
> > can see it matches your solution.
> > >
> > > Here is the method signature from my
> version.........................
> > >
> > > ' Imports Epicor.Mfg.UI.Adapters
> > >
> > > Dim [varAdapterName] As DynamicQueryAdapter = New
> > DynamicQueryAdapter([UIForm])
> > > [varAdapterName].BOConnect()
> > >
> > > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> > pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > >
> > > [varAdapterName].Dispose()
> > >
> > >
> > > Thanks Again,
> > > Scott
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ,
> > "jckinneman" <jckinneman@> wrote:
> > > >
> > > > What does your BAQ look like? What tables are included? What
> version
> > of Epicor are you running on? The example I provided is based on
> Epicor
> > 9, the BO signature may be different for 8.
> > > >
> > > > The primary way I explore how to call BOs is via the Business
> Logic
> > Tester. All the systems I have worked on have it but I have also seen
> > discussions that you might only be able to get it if you have the SDK.
> > If you have the BL tester you can easily look at and test the
> signature
> > for calling the BO. If you don't have the BL tester you can also, when
> > in customization mode, use the Object Explorer to look at the
> signatures
> > on the BO. If this is 8 we may have to adjust the signature on the
> call
> > to whereitem.
> > > >
> > > > While the error prevents you from getting to it when you are ready
> > to run your query you will want to use dqa.Execute(ds) ExecuteByID
> will
> > run the BAQ as it exists in the db without the whereitems.
> > > >
> > > > Jim Kinneman
> > > > Senior Consultant
> > > > Encompass Solutions
> > > >
> > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ,
> > "thedemondamian" <sheath@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Jim,
> > > > >
> > > > > I got a chance to test out your solution and I am receiving a
> > Foreign Key Constraint error from the AddWhereItem method.
> > > > >
> > > > >
> > > > > Error Detail
> > > > > ============
> > > > > Failed to enable constraints. One or more rows contain values
> > violating non-null, unique, or foreign-key constraints.
> > > > >
> > > > > Table: QueryWhereItem
> > > > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable'
> > DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> > QueryTableQueryWhereItem requires the child key values (MMI, sheath,
> > MMI-PartAvailable, Part) to exist in the parent table.
> > > > >
> > > > >
> > > > > Stack Trace
> > > > > ===========
> > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> > DataTable targetDT)
> > > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters,
> > DataSet ds, Int32 paramPos)
> > > > > at
> > Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> > String pcQueryID, String pcTable, String pcField, String pcCondition,
> > Boolean pbIsConst, String pcValue, String pcToTable, String pcToField,
> > String pcLeftParentheses, String pcRightParentheses, String pcAndOr,
> > Boolean pbNeg)
> > > > > at
> >
> Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> > et ds, String pcQueryID, String pcTable, String pcField, String
> > pcCondition, Boolean pbIsConst, String pcValue, String pcToTable,
> String
> > pcToField, String pcLeftParentheses, String pcRightParentheses, String
> > pcAndOr, Boolean pbNeg)
> > > > >
> > > > > Inner Exception
> > > > > ===============
> > > > > Failed to enable constraints. One or more rows contain values
> > violating non-null, unique, or foreign-key constraints.
> > > > >
> > > > > Inner Stack Trace
> > > > > =================
> > > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > > at System.Data.DataSet.EnableConstraints()
> > > > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > > > at System.Data.DataTable.EndLoadData()
> > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> > DataTable targetDT)
> > > > >
> > > > >
> > > > > Here is my code:
> > > > >
> > > > >
> > > > > Dim strValue as string = args.ProposedValue
> > > > >
> > > > > Dim dqa As DynamicQueryAdapter = New
> > DynamicQueryAdapter(SalesOrderForm)
> > > > > dqa.BOConnect()
> > > > >
> > > > > Dim ds as New QueryDesignDataSet()
> > > > > ds = New QueryDesignDataSet()
> > > > >
> > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > ds = dqa.QueryDesignData
> > > > >
> > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > Dim pcTable as String = "Part"
> > > > > Dim pcField as String = "PartNum"
> > > > > Dim pcCondition as String = "="
> > > > > Dim pbIsConst as Boolean = true
> > > > > Dim pcValue as String = strValue
> > > > > Dim pcToTable as String = String.Empty
> > > > > Dim pcToField as String = String.Empty
> > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > Dim pcRightParentheses as String = String.Empty
> > > > > Dim pcAndOr as String = String.Empty
> > > > > Dim pbNeg as Boolean = false
> > > > >
> > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > pcRightParentheses, pcAndOr, pbNeg)
> > > > >
> > > > > dqa.Executebyid("MMI-PartAvailable")
> > > > > Dim results As DataSet = dqa.QueryResults
> > > > > ugdEpiCustom1.DataSource = results
> > > > >
> > > > >
> > > > > Thanks for your help,
> > > > > Scott
> > > > >
> > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > , "thedemondamian" <sheath@> wrote:
> > > > > >
> > > > > > Excellent, I knew it was a simple solution, I just could not
> see
> > all of the pieces.
> > > > > >
> > > > > > The two diferent dataset types were throwing me off.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com>
> > <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > To add a where item
> > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > ds = New QueryDesignDataSet()
> > > > > > >
> > > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > ds = dqa.QueryDesignData
> > > > > > >
> > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > Dim pcTable as String = "WhatTable"
> > > > > > > Dim pcField as String = "WhatField"
> > > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > Dim pcToField as String = String.Empty
> > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > Dim pbNeg as Boolean = false
> > > > > > >
> > > > > > >
> > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
> pcCondition,
> > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > > // repeat as needed to add all your where clauses, you can
> use
> > parentheses and "AND" and "OR" if you need to.
> > > > > > >
> > > > > > > Jim Kinneman
> > > > > > > Senior Consultant
> > > > > > > Encompass Solutions Inc
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com>
> > <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@> wrote:
> > > > > > > >
> > > > > > > > I don't have a problem using the DynamicQueryAdapter to
> run
> > a BAQ and get results from within the script editor of a form.
> > > > > > > >
> > > > > > > > What I do want to know is how to add a WHERE clause to the
> > query adapter in order to filter the results of the BAQ.
> > > > > > > >
> > > > > > > > I have tried the built in AddWhereItem, InvokeSearch and
> > LoadUserResults methods with no luck. Here is my latest code:
> > > > > > > >
> > > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > > Dim strWhereClause as string
> > > > > > > > Dim dqa As DynamicQueryAdapter = New
> > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > > dqa.BOConnect()
> > > > > > > >
> > > > > > > > Dim test As Boolean =
> dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > >
> > > > > > > > Dim MorePages As Boolean
> > > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > > Dim opts As SearchOptions = New
> > SearchOptions(SearchMode.AutoSearch)
> > > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> > strWhereClause)
> > > > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts,
> > MorePages)
> > > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > > >
> > > > > > > > Any ideas?
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
> [Non-text portions of this message have been removed]
>
Thank you guys for your continued work on this. I also broke down and submitted a call to Epicor for a code sample last week. I will post the results here as soon as I get them.

In the mean time I have downloaded the BL Tester, set it up, and have been learning to use it. So far i have been able to duplicate there error that i am getting from the script editor.

Joe, I will try to implement your solution and see what i get.

--- In vantage@yahoogroups.com, "jckinneman" <jckinneman@...> wrote:
>
> Sorry haven't had a chance to get into this deeper.
>
> Supposedly from the object explorer you can do this.
> SalesOrderTrackerForm.Session.ConnectionPool
>
> In Epicor 9 you have to cast the session object first and then refer to the connectionpool, in 8 you may be able to reference it directly.
>
> Epicor.Mfg.Core.Session s = (Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;
>
> SchedulingBoardBO = new Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);
>
> JK.
>
> --- In vantage@yahoogroups.com, Joe Rojas <jrojas@> wrote:
> >
> > Well, after banging my head against the wall on how to use the
> > DynamicQueryAdapter, I called Epicor and asked for a coding example of
> > how to add a runtime criteria before executing the BAQ. I am waiting for
> > a response.
> >
> >
> >
> > In the meantime, I noticed how Jim said that you can either use the
> > adapter or use the BO directly.
> >
> > I had luck using the BL Tester so I gave the BO approach a try with
> > success.
> >
> > Below is my code.
> >
> > I didn't know how to access the existing session object so I had to
> > create a new one, which required me to add Epicor.Mfg.Core.Session and
> > Epicor.Mfg.Core.BLConnectionPool as references.
> >
> > Anyone know how to access the current session?
> >
> >
> >
> > Dim episession As Session = New Session(<username>, <password>,
> > "AppServerDC://<server name>:<port>", Session.LicenseType.Default)
> >
> > Dim dqa As DynamicQuery = New DynamicQuery(episession.ConnectionPool)
> >
> > Dim ds As QueryDesignDataSet = dqa.GetByID("MATS-ProjectInfluencers")
> >
> >
> >
> > Dim pcQueryID as String = "MATS-ProjectInfluencers"
> >
> > Dim pcTable as String = "UD04"
> >
> > Dim pcField as String = "Key1"
> >
> > Dim pcCondition as String = "="
> >
> > Dim pbIsConst as Boolean = true
> >
> > Dim pcValue as String = "2010-0"
> >
> > Dim pcToTable as String = String.Empty
> >
> > Dim pcToField as String = String.Empty
> >
> > Dim pcLeftParentheses as String = String.Empty
> >
> > Dim pcRightParentheses as String = String.Empty
> >
> > Dim pcAndOr as String = String.Empty
> >
> > Dim pbNeg as Boolean = false
> >
> > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > pcRightParentheses, pcAndOr, pbNeg)
> >
> > Dim DQResults As DataSet = dqa.Execute(ds)
> >
> > ugInfluencers.DataSource = DQResults
> >
> >
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> > Of jckinneman
> > Sent: Wednesday, August 04, 2010 7:26 PM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> >
> >
> >
> >
> >
> > I haven't had a chance to get back in and look at this further but one
> > thing to remember when working with the BL tester this works directly
> > with the BO. The example we are working with is supposed to be the
> > adapter approach. In a customization you can use the adapter approach or
> > the BO direct method. Your comment and thinking about things I may have
> > mixed and matched some of the two approaches in writing things from
> > memory and grabbing snippets of code from here and there.
> >
> > I should be able to grab a few minutes tomorrow and start from scratch
> > and put together a clean example.
> >
> > Jim Kinneman
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , Joe
> > Rojas <jrojas@> wrote:
> > >
> > > I was following this thread because I need this same functionality for
> > > one of my customizations.
> > >
> > > I'm on E9.04 and I'm getting the same issue as Scott.
> > >
> > >
> > >
> > > I've been debugging for several hours and it looks like the problem is
> > > related to the line that reads: ds = dqa.QueryDesignData
> > >
> > > It looks like once this line executes, that there is no data in "ds".
> > So
> > > when you try to use the AddWhereItem method, it's puking because there
> > > is no existing data that defines the BAQ.
> > >
> > > It essential saying that there is no information related to the
> > > AddWhereItem that your trying to add so I can't add it.
> > >
> > >
> > >
> > > What I find equally confusing is that the BL Tester states that the
> > > GetQueryByID should be returning a QueryDesignDataSet not a Boolean.
> > >
> > > To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
> > >
> > > Of course you can't do that because the script editor insists that it
> > is
> > > going to return a Boolean.
> > >
> > >
> > >
> > > Maybe someone else can chime in with an answer.
> > >
> > >
> > >
> > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> > Behalf
> > > Of jckinneman
> > > Sent: Tuesday, August 03, 2010 7:05 PM
> > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > I duplicated your issue in an 8 environment, there is something
> > > different about 8 with this BO that I haven't figured out. I do the
> > > exact same thing many times in 9 without any issues. Of course the BL
> > > tester in my 8 environment is not setup correctly and haven't had a
> > > chance to resolve that yet. When i get a few minutes I will dig into
> > > this deeper.
> > >
> > > Jim Kinneman
> > > Senior Consultant
> > > Encompass Solutions, Inc
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > <mailto:vantage%40yahoogroups.com> ,
> > > "thedemondamian" <sheath@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Jim,
> > > >
> > > > We are running on 8.03.409c.
> > > >
> > > > Here is my BAQ......................................................
> > > >
> > > > for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company
> > =
> > > PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> > > PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part
> > > where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> > > Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> > > Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode)
> > > no-lock
> > > >
> > > >
> > > > I am using the object explorer to verify my signatures. As far as I
> > > can see it matches your solution.
> > > >
> > > > Here is the method signature from my
> > version.........................
> > > >
> > > > ' Imports Epicor.Mfg.UI.Adapters
> > > >
> > > > Dim [varAdapterName] As DynamicQueryAdapter = New
> > > DynamicQueryAdapter([UIForm])
> > > > [varAdapterName].BOConnect()
> > > >
> > > > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> > > pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > >
> > > > [varAdapterName].Dispose()
> > > >
> > > >
> > > > Thanks Again,
> > > > Scott
> > > >
> > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > <mailto:vantage%40yahoogroups.com> ,
> > > "jckinneman" <jckinneman@> wrote:
> > > > >
> > > > > What does your BAQ look like? What tables are included? What
> > version
> > > of Epicor are you running on? The example I provided is based on
> > Epicor
> > > 9, the BO signature may be different for 8.
> > > > >
> > > > > The primary way I explore how to call BOs is via the Business
> > Logic
> > > Tester. All the systems I have worked on have it but I have also seen
> > > discussions that you might only be able to get it if you have the SDK.
> > > If you have the BL tester you can easily look at and test the
> > signature
> > > for calling the BO. If you don't have the BL tester you can also, when
> > > in customization mode, use the Object Explorer to look at the
> > signatures
> > > on the BO. If this is 8 we may have to adjust the signature on the
> > call
> > > to whereitem.
> > > > >
> > > > > While the error prevents you from getting to it when you are ready
> > > to run your query you will want to use dqa.Execute(ds) ExecuteByID
> > will
> > > run the BAQ as it exists in the db without the whereitems.
> > > > >
> > > > > Jim Kinneman
> > > > > Senior Consultant
> > > > > Encompass Solutions
> > > > >
> > > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > <mailto:vantage%40yahoogroups.com> ,
> > > "thedemondamian" <sheath@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Jim,
> > > > > >
> > > > > > I got a chance to test out your solution and I am receiving a
> > > Foreign Key Constraint error from the AddWhereItem method.
> > > > > >
> > > > > >
> > > > > > Error Detail
> > > > > > ============
> > > > > > Failed to enable constraints. One or more rows contain values
> > > violating non-null, unique, or foreign-key constraints.
> > > > > >
> > > > > > Table: QueryWhereItem
> > > > > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable'
> > > DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> > > QueryTableQueryWhereItem requires the child key values (MMI, sheath,
> > > MMI-PartAvailable, Part) to exist in the parent table.
> > > > > >
> > > > > >
> > > > > > Stack Trace
> > > > > > ===========
> > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> > > DataTable targetDT)
> > > > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters,
> > > DataSet ds, Int32 paramPos)
> > > > > > at
> > > Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> > > String pcQueryID, String pcTable, String pcField, String pcCondition,
> > > Boolean pbIsConst, String pcValue, String pcToTable, String pcToField,
> > > String pcLeftParentheses, String pcRightParentheses, String pcAndOr,
> > > Boolean pbNeg)
> > > > > > at
> > >
> > Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> > > et ds, String pcQueryID, String pcTable, String pcField, String
> > > pcCondition, Boolean pbIsConst, String pcValue, String pcToTable,
> > String
> > > pcToField, String pcLeftParentheses, String pcRightParentheses, String
> > > pcAndOr, Boolean pbNeg)
> > > > > >
> > > > > > Inner Exception
> > > > > > ===============
> > > > > > Failed to enable constraints. One or more rows contain values
> > > violating non-null, unique, or foreign-key constraints.
> > > > > >
> > > > > > Inner Stack Trace
> > > > > > =================
> > > > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > > > at System.Data.DataSet.EnableConstraints()
> > > > > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > > > > at System.Data.DataTable.EndLoadData()
> > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> > > DataTable targetDT)
> > > > > >
> > > > > >
> > > > > > Here is my code:
> > > > > >
> > > > > >
> > > > > > Dim strValue as string = args.ProposedValue
> > > > > >
> > > > > > Dim dqa As DynamicQueryAdapter = New
> > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > dqa.BOConnect()
> > > > > >
> > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > ds = New QueryDesignDataSet()
> > > > > >
> > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > ds = dqa.QueryDesignData
> > > > > >
> > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > Dim pcTable as String = "Part"
> > > > > > Dim pcField as String = "PartNum"
> > > > > > Dim pcCondition as String = "="
> > > > > > Dim pbIsConst as Boolean = true
> > > > > > Dim pcValue as String = strValue
> > > > > > Dim pcToTable as String = String.Empty
> > > > > > Dim pcToField as String = String.Empty
> > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > Dim pcAndOr as String = String.Empty
> > > > > > Dim pbNeg as Boolean = false
> > > > > >
> > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > >
> > > > > > dqa.Executebyid("MMI-PartAvailable")
> > > > > > Dim results As DataSet = dqa.QueryResults
> > > > > > ugdEpiCustom1.DataSource = results
> > > > > >
> > > > > >
> > > > > > Thanks for your help,
> > > > > > Scott
> > > > > >
> > > > > > --- In vantage@yahoogroups.com
> > <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > , "thedemondamian" <sheath@> wrote:
> > > > > > >
> > > > > > > Excellent, I knew it was a simple solution, I just could not
> > see
> > > all of the pieces.
> > > > > > >
> > > > > > > The two diferent dataset types were throwing me off.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com
> > <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > To add a where item
> > > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > > ds = New QueryDesignDataSet()
> > > > > > > >
> > > > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > ds = dqa.QueryDesignData
> > > > > > > >
> > > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > > Dim pcTable as String = "WhatTable"
> > > > > > > > Dim pcField as String = "WhatField"
> > > > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > > Dim pcToField as String = String.Empty
> > > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > > Dim pbNeg as Boolean = false
> > > > > > > >
> > > > > > > >
> > > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > pcCondition,
> > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > > > // repeat as needed to add all your where clauses, you can
> > use
> > > parentheses and "AND" and "OR" if you need to.
> > > > > > > >
> > > > > > > > Jim Kinneman
> > > > > > > > Senior Consultant
> > > > > > > > Encompass Solutions Inc
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com
> > <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@> wrote:
> > > > > > > > >
> > > > > > > > > I don't have a problem using the DynamicQueryAdapter to
> > run
> > > a BAQ and get results from within the script editor of a form.
> > > > > > > > >
> > > > > > > > > What I do want to know is how to add a WHERE clause to the
> > > query adapter in order to filter the results of the BAQ.
> > > > > > > > >
> > > > > > > > > I have tried the built in AddWhereItem, InvokeSearch and
> > > LoadUserResults methods with no luck. Here is my latest code:
> > > > > > > > >
> > > > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > > > Dim strWhereClause as string
> > > > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > > > dqa.BOConnect()
> > > > > > > > >
> > > > > > > > > Dim test As Boolean =
> > dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > >
> > > > > > > > > Dim MorePages As Boolean
> > > > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > > > Dim opts As SearchOptions = New
> > > SearchOptions(SearchMode.AutoSearch)
> > > > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> > > strWhereClause)
> > > > > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts,
> > > MorePages)
> > > > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > > > >
> > > > > > > > > Any ideas?
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
Ok, I tried using the BO object instead of the adapter and here are the results.

-----------------Code---------------------------

Dim strValue as string = args.ProposedValue

Dim s as Epicor.Mfg.Core.Session = SalesOrderForm.Session

Dim dqa As DynamicQuery = New DynamicQuery(s.ConnectionPool)

Dim ds As QueryDesignDataSet = dqa.GetByID("MMI-PartAvailable")

Dim pcQueryID as String = "MMI-PartAvailable"
Dim pcTable as String = "Part"
Dim pcField as String = "PartNum"
Dim pcCondition as String = "="
Dim pbIsConst as Boolean = true
Dim pcValue as String = strValue
Dim pcToTable as String = String.Empty
Dim pcToField as String = String.Empty
Dim pcLeftParentheses as String = String.Empty
Dim pcRightParentheses as String = String.Empty
Dim pcAndOr as String = String.Empty
Dim pbNeg as Boolean = false

dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)


Dim results As DataSet = dqa.Execute(ds)
ugdEpiCustom1.DataSource = results

----------------End------------------------------

With the above code I end up with the error "Value of type 'Epicor.Mfg.BO.QueryDesignDataSet' cannot be converted to 'Epicor.Mfg.BO.DynamicQueryDataSet'"

When I change it to try and extract the 'DynamicQueryDataSet' from the 'DynamicQuery' object with the following line.

Dim results As DataSet = dqa.Execute(dqa.DynamicQueryDataset)

I get the error "'DynamicQueryDataset' is not a member of 'Epicor.Mfg.BO.DynamicQuery'"

I can't win for losing on this one.




--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
>
>
> Thank you guys for your continued work on this. I also broke down and submitted a call to Epicor for a code sample last week. I will post the results here as soon as I get them.
>
> In the mean time I have downloaded the BL Tester, set it up, and have been learning to use it. So far i have been able to duplicate there error that i am getting from the script editor.
>
> Joe, I will try to implement your solution and see what i get.
>
> --- In vantage@yahoogroups.com, "jckinneman" <jckinneman@> wrote:
> >
> > Sorry haven't had a chance to get into this deeper.
> >
> > Supposedly from the object explorer you can do this.
> > SalesOrderTrackerForm.Session.ConnectionPool
> >
> > In Epicor 9 you have to cast the session object first and then refer to the connectionpool, in 8 you may be able to reference it directly.
> >
> > Epicor.Mfg.Core.Session s = (Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;
> >
> > SchedulingBoardBO = new Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);
> >
> > JK.
> >
> > --- In vantage@yahoogroups.com, Joe Rojas <jrojas@> wrote:
> > >
> > > Well, after banging my head against the wall on how to use the
> > > DynamicQueryAdapter, I called Epicor and asked for a coding example of
> > > how to add a runtime criteria before executing the BAQ. I am waiting for
> > > a response.
> > >
> > >
> > >
> > > In the meantime, I noticed how Jim said that you can either use the
> > > adapter or use the BO directly.
> > >
> > > I had luck using the BL Tester so I gave the BO approach a try with
> > > success.
> > >
> > > Below is my code.
> > >
> > > I didn't know how to access the existing session object so I had to
> > > create a new one, which required me to add Epicor.Mfg.Core.Session and
> > > Epicor.Mfg.Core.BLConnectionPool as references.
> > >
> > > Anyone know how to access the current session?
> > >
> > >
> > >
> > > Dim episession As Session = New Session(<username>, <password>,
> > > "AppServerDC://<server name>:<port>", Session.LicenseType.Default)
> > >
> > > Dim dqa As DynamicQuery = New DynamicQuery(episession.ConnectionPool)
> > >
> > > Dim ds As QueryDesignDataSet = dqa.GetByID("MATS-ProjectInfluencers")
> > >
> > >
> > >
> > > Dim pcQueryID as String = "MATS-ProjectInfluencers"
> > >
> > > Dim pcTable as String = "UD04"
> > >
> > > Dim pcField as String = "Key1"
> > >
> > > Dim pcCondition as String = "="
> > >
> > > Dim pbIsConst as Boolean = true
> > >
> > > Dim pcValue as String = "2010-0"
> > >
> > > Dim pcToTable as String = String.Empty
> > >
> > > Dim pcToField as String = String.Empty
> > >
> > > Dim pcLeftParentheses as String = String.Empty
> > >
> > > Dim pcRightParentheses as String = String.Empty
> > >
> > > Dim pcAndOr as String = String.Empty
> > >
> > > Dim pbNeg as Boolean = false
> > >
> > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > pcRightParentheses, pcAndOr, pbNeg)
> > >
> > > Dim DQResults As DataSet = dqa.Execute(ds)
> > >
> > > ugInfluencers.DataSource = DQResults
> > >
> > >
> > >
> > > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> > > Of jckinneman
> > > Sent: Wednesday, August 04, 2010 7:26 PM
> > > To: vantage@yahoogroups.com
> > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > >
> > >
> > >
> > >
> > >
> > > I haven't had a chance to get back in and look at this further but one
> > > thing to remember when working with the BL tester this works directly
> > > with the BO. The example we are working with is supposed to be the
> > > adapter approach. In a customization you can use the adapter approach or
> > > the BO direct method. Your comment and thinking about things I may have
> > > mixed and matched some of the two approaches in writing things from
> > > memory and grabbing snippets of code from here and there.
> > >
> > > I should be able to grab a few minutes tomorrow and start from scratch
> > > and put together a clean example.
> > >
> > > Jim Kinneman
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , Joe
> > > Rojas <jrojas@> wrote:
> > > >
> > > > I was following this thread because I need this same functionality for
> > > > one of my customizations.
> > > >
> > > > I'm on E9.04 and I'm getting the same issue as Scott.
> > > >
> > > >
> > > >
> > > > I've been debugging for several hours and it looks like the problem is
> > > > related to the line that reads: ds = dqa.QueryDesignData
> > > >
> > > > It looks like once this line executes, that there is no data in "ds".
> > > So
> > > > when you try to use the AddWhereItem method, it's puking because there
> > > > is no existing data that defines the BAQ.
> > > >
> > > > It essential saying that there is no information related to the
> > > > AddWhereItem that your trying to add so I can't add it.
> > > >
> > > >
> > > >
> > > > What I find equally confusing is that the BL Tester states that the
> > > > GetQueryByID should be returning a QueryDesignDataSet not a Boolean.
> > > >
> > > > To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
> > > >
> > > > Of course you can't do that because the script editor insists that it
> > > is
> > > > going to return a Boolean.
> > > >
> > > >
> > > >
> > > > Maybe someone else can chime in with an answer.
> > > >
> > > >
> > > >
> > > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> > > Behalf
> > > > Of jckinneman
> > > > Sent: Tuesday, August 03, 2010 7:05 PM
> > > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I duplicated your issue in an 8 environment, there is something
> > > > different about 8 with this BO that I haven't figured out. I do the
> > > > exact same thing many times in 9 without any issues. Of course the BL
> > > > tester in my 8 environment is not setup correctly and haven't had a
> > > > chance to resolve that yet. When i get a few minutes I will dig into
> > > > this deeper.
> > > >
> > > > Jim Kinneman
> > > > Senior Consultant
> > > > Encompass Solutions, Inc
> > > >
> > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> ,
> > > > "thedemondamian" <sheath@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Jim,
> > > > >
> > > > > We are running on 8.03.409c.
> > > > >
> > > > > Here is my BAQ......................................................
> > > > >
> > > > > for each PlantWhse no-lock , each PartWhse where (PlantWhse.Company
> > > =
> > > > PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> > > > PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each Part
> > > > where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> > > > Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> > > > Warehse.Company and PartWhse.WarehouseCode = Warehse.WarehouseCode)
> > > > no-lock
> > > > >
> > > > >
> > > > > I am using the object explorer to verify my signatures. As far as I
> > > > can see it matches your solution.
> > > > >
> > > > > Here is the method signature from my
> > > version.........................
> > > > >
> > > > > ' Imports Epicor.Mfg.UI.Adapters
> > > > >
> > > > > Dim [varAdapterName] As DynamicQueryAdapter = New
> > > > DynamicQueryAdapter([UIForm])
> > > > > [varAdapterName].BOConnect()
> > > > >
> > > > > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > > pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> > > > pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > > >
> > > > > [varAdapterName].Dispose()
> > > > >
> > > > >
> > > > > Thanks Again,
> > > > > Scott
> > > > >
> > > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> ,
> > > > "jckinneman" <jckinneman@> wrote:
> > > > > >
> > > > > > What does your BAQ look like? What tables are included? What
> > > version
> > > > of Epicor are you running on? The example I provided is based on
> > > Epicor
> > > > 9, the BO signature may be different for 8.
> > > > > >
> > > > > > The primary way I explore how to call BOs is via the Business
> > > Logic
> > > > Tester. All the systems I have worked on have it but I have also seen
> > > > discussions that you might only be able to get it if you have the SDK.
> > > > If you have the BL tester you can easily look at and test the
> > > signature
> > > > for calling the BO. If you don't have the BL tester you can also, when
> > > > in customization mode, use the Object Explorer to look at the
> > > signatures
> > > > on the BO. If this is 8 we may have to adjust the signature on the
> > > call
> > > > to whereitem.
> > > > > >
> > > > > > While the error prevents you from getting to it when you are ready
> > > > to run your query you will want to use dqa.Execute(ds) ExecuteByID
> > > will
> > > > run the BAQ as it exists in the db without the whereitems.
> > > > > >
> > > > > > Jim Kinneman
> > > > > > Senior Consultant
> > > > > > Encompass Solutions
> > > > > >
> > > > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> ,
> > > > "thedemondamian" <sheath@> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Jim,
> > > > > > >
> > > > > > > I got a chance to test out your solution and I am receiving a
> > > > Foreign Key Constraint error from the AddWhereItem method.
> > > > > > >
> > > > > > >
> > > > > > > Error Detail
> > > > > > > ============
> > > > > > > Failed to enable constraints. One or more rows contain values
> > > > violating non-null, unique, or foreign-key constraints.
> > > > > > >
> > > > > > > Table: QueryWhereItem
> > > > > > > Company='MMI' DCDUserID='sheath' ExportID='MMI-PartAvailable'
> > > > DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> > > > QueryTableQueryWhereItem requires the child key values (MMI, sheath,
> > > > MMI-PartAvailable, Part) to exist in the parent table.
> > > > > > >
> > > > > > >
> > > > > > > Stack Trace
> > > > > > > ===========
> > > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> > > > DataTable targetDT)
> > > > > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet parameters,
> > > > DataSet ds, Int32 paramPos)
> > > > > > > at
> > > > Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> > > > String pcQueryID, String pcTable, String pcField, String pcCondition,
> > > > Boolean pbIsConst, String pcValue, String pcToTable, String pcToField,
> > > > String pcLeftParentheses, String pcRightParentheses, String pcAndOr,
> > > > Boolean pbNeg)
> > > > > > > at
> > > >
> > > Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> > > > et ds, String pcQueryID, String pcTable, String pcField, String
> > > > pcCondition, Boolean pbIsConst, String pcValue, String pcToTable,
> > > String
> > > > pcToField, String pcLeftParentheses, String pcRightParentheses, String
> > > > pcAndOr, Boolean pbNeg)
> > > > > > >
> > > > > > > Inner Exception
> > > > > > > ===============
> > > > > > > Failed to enable constraints. One or more rows contain values
> > > > violating non-null, unique, or foreign-key constraints.
> > > > > > >
> > > > > > > Inner Stack Trace
> > > > > > > =================
> > > > > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > > > > at System.Data.DataSet.EnableConstraints()
> > > > > > > at System.Data.DataSet.set_EnforceConstraints(Boolean value)
> > > > > > > at System.Data.DataTable.EndLoadData()
> > > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable sourceDT,
> > > > DataTable targetDT)
> > > > > > >
> > > > > > >
> > > > > > > Here is my code:
> > > > > > >
> > > > > > >
> > > > > > > Dim strValue as string = args.ProposedValue
> > > > > > >
> > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > dqa.BOConnect()
> > > > > > >
> > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > ds = New QueryDesignDataSet()
> > > > > > >
> > > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > ds = dqa.QueryDesignData
> > > > > > >
> > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > Dim pcTable as String = "Part"
> > > > > > > Dim pcField as String = "PartNum"
> > > > > > > Dim pcCondition as String = "="
> > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > Dim pcValue as String = strValue
> > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > Dim pcToField as String = String.Empty
> > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > Dim pbNeg as Boolean = false
> > > > > > >
> > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > >
> > > > > > > dqa.Executebyid("MMI-PartAvailable")
> > > > > > > Dim results As DataSet = dqa.QueryResults
> > > > > > > ugdEpiCustom1.DataSource = results
> > > > > > >
> > > > > > >
> > > > > > > Thanks for your help,
> > > > > > > Scott
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com
> > > <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > > , "thedemondamian" <sheath@> wrote:
> > > > > > > >
> > > > > > > > Excellent, I knew it was a simple solution, I just could not
> > > see
> > > > all of the pieces.
> > > > > > > >
> > > > > > > > The two diferent dataset types were throwing me off.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com
> > > <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > To add a where item
> > > > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > > > ds = New QueryDesignDataSet()
> > > > > > > > >
> > > > > > > > > Dim test As Boolean = dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > > ds = dqa.QueryDesignData
> > > > > > > > >
> > > > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > > > Dim pcTable as String = "WhatTable"
> > > > > > > > > Dim pcField as String = "WhatField"
> > > > > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > > > Dim pcToField as String = String.Empty
> > > > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > > > Dim pbNeg as Boolean = false
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > pcCondition,
> > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > > > > // repeat as needed to add all your where clauses, you can
> > > use
> > > > parentheses and "AND" and "OR" if you need to.
> > > > > > > > >
> > > > > > > > > Jim Kinneman
> > > > > > > > > Senior Consultant
> > > > > > > > > Encompass Solutions Inc
> > > > > > > > >
> > > > > > > > > --- In vantage@yahoogroups.com
> > > <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@> wrote:
> > > > > > > > > >
> > > > > > > > > > I don't have a problem using the DynamicQueryAdapter to
> > > run
> > > > a BAQ and get results from within the script editor of a form.
> > > > > > > > > >
> > > > > > > > > > What I do want to know is how to add a WHERE clause to the
> > > > query adapter in order to filter the results of the BAQ.
> > > > > > > > > >
> > > > > > > > > > I have tried the built in AddWhereItem, InvokeSearch and
> > > > LoadUserResults methods with no luck. Here is my latest code:
> > > > > > > > > >
> > > > > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > > > > Dim strWhereClause as string
> > > > > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > > > > dqa.BOConnect()
> > > > > > > > > >
> > > > > > > > > > Dim test As Boolean =
> > > dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > > >
> > > > > > > > > > Dim MorePages As Boolean
> > > > > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > > > > Dim opts As SearchOptions = New
> > > > SearchOptions(SearchMode.AutoSearch)
> > > > > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> > > > strWhereClause)
> > > > > > > > > > Dim SearchResults as Data.Dataset = dqa.GetRows(opts,
> > > > MorePages)
> > > > > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > > > > >
> > > > > > > > > > Any ideas?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>
Forgive me for butting in......

What exactly are you trying to retrieve using a dynamic query?

When I need data from other tables that can not be brought in using FKVs and LTVs I can usually get a listlookup to work. And when the field is not in a list dataset I resort to using the adapter and getting the whole dataset.

- just asking......

Bernie.

--- In vantage@yahoogroups.com, "thedemondamian" <sheath@...> wrote:
>
>
>
>
>
>
>
> Ok, I tried using the BO object instead of the adapter and here are the results.
>
> -----------------Code---------------------------
>
> Dim strValue as string = args.ProposedValue
>
> Dim s as Epicor.Mfg.Core.Session = SalesOrderForm.Session
>
> Dim dqa As DynamicQuery = New DynamicQuery(s.ConnectionPool)
>
> Dim ds As QueryDesignDataSet = dqa.GetByID("MMI-PartAvailable")
>
> Dim pcQueryID as String = "MMI-PartAvailable"
> Dim pcTable as String = "Part"
> Dim pcField as String = "PartNum"
> Dim pcCondition as String = "="
> Dim pbIsConst as Boolean = true
> Dim pcValue as String = strValue
> Dim pcToTable as String = String.Empty
> Dim pcToField as String = String.Empty
> Dim pcLeftParentheses as String = String.Empty
> Dim pcRightParentheses as String = String.Empty
> Dim pcAndOr as String = String.Empty
> Dim pbNeg as Boolean = false
>
> dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition, pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
>
>
> Dim results As DataSet = dqa.Execute(ds)
> ugdEpiCustom1.DataSource = results
>
> ----------------End------------------------------
>
> With the above code I end up with the error "Value of type 'Epicor.Mfg.BO.QueryDesignDataSet' cannot be converted to 'Epicor.Mfg.BO.DynamicQueryDataSet'"
>
> When I change it to try and extract the 'DynamicQueryDataSet' from the 'DynamicQuery' object with the following line.
>
> Dim results As DataSet = dqa.Execute(dqa.DynamicQueryDataset)
>
> I get the error "'DynamicQueryDataset' is not a member of 'Epicor.Mfg.BO.DynamicQuery'"
>
> I can't win for losing on this one.
>
>
>
>
I'm my case, I am trying to pull data from a BAQ. My BAQ has several
tables joined together and I don't know of another way to achieve this.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of bw2868bond
Sent: Thursday, August 12, 2010 9:31 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Using the DynamicQyeryAdapter





Forgive me for butting in......

What exactly are you trying to retrieve using a dynamic query?

When I need data from other tables that can not be brought in using FKVs
and LTVs I can usually get a listlookup to work. And when the field is
not in a list dataset I resort to using the adapter and getting the
whole dataset.

- just asking......

Bernie.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"thedemondamian" <sheath@...> wrote:
>
>
>
>
>
>
>
> Ok, I tried using the BO object instead of the adapter and here are
the results.
>
> -----------------Code---------------------------
>
> Dim strValue as string = args.ProposedValue
>
> Dim s as Epicor.Mfg.Core.Session = SalesOrderForm.Session
>
> Dim dqa As DynamicQuery = New DynamicQuery(s.ConnectionPool)
>
> Dim ds As QueryDesignDataSet = dqa.GetByID("MMI-PartAvailable")
>
> Dim pcQueryID as String = "MMI-PartAvailable"
> Dim pcTable as String = "Part"
> Dim pcField as String = "PartNum"
> Dim pcCondition as String = "="
> Dim pbIsConst as Boolean = true
> Dim pcValue as String = strValue
> Dim pcToTable as String = String.Empty
> Dim pcToField as String = String.Empty
> Dim pcLeftParentheses as String = String.Empty
> Dim pcRightParentheses as String = String.Empty
> Dim pcAndOr as String = String.Empty
> Dim pbNeg as Boolean = false
>
> dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
pcRightParentheses, pcAndOr, pbNeg)
>
>
> Dim results As DataSet = dqa.Execute(ds)
> ugdEpiCustom1.DataSource = results
>
> ----------------End------------------------------
>
> With the above code I end up with the error "Value of type
'Epicor.Mfg.BO.QueryDesignDataSet' cannot be converted to
'Epicor.Mfg.BO.DynamicQueryDataSet'"
>
> When I change it to try and extract the 'DynamicQueryDataSet' from the
'DynamicQuery' object with the following line.
>
> Dim results As DataSet = dqa.Execute(dqa.DynamicQueryDataset)
>
> I get the error "'DynamicQueryDataset' is not a member of
'Epicor.Mfg.BO.DynamicQuery'"
>
> I can't win for losing on this one.
>
>
>
>












Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-1264 | fax: 781-341-5694
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


[Non-text portions of this message have been removed]
I wonder how much of a difference there is between 8.03 and 9.04?

Do you have the BL Tester loaded?

If yes, what is the return type for DynamicQuery.GetByID()?



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of thedemondamian
Sent: Thursday, August 12, 2010 9:08 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Using the DynamicQyeryAdapter







Ok, I tried using the BO object instead of the adapter and here are the
results.

-----------------Code---------------------------

Dim strValue as string = args.ProposedValue

Dim s as Epicor.Mfg.Core.Session = SalesOrderForm.Session

Dim dqa As DynamicQuery = New DynamicQuery(s.ConnectionPool)

Dim ds As QueryDesignDataSet = dqa.GetByID("MMI-PartAvailable")

Dim pcQueryID as String = "MMI-PartAvailable"
Dim pcTable as String = "Part"
Dim pcField as String = "PartNum"
Dim pcCondition as String = "="
Dim pbIsConst as Boolean = true
Dim pcValue as String = strValue
Dim pcToTable as String = String.Empty
Dim pcToField as String = String.Empty
Dim pcLeftParentheses as String = String.Empty
Dim pcRightParentheses as String = String.Empty
Dim pcAndOr as String = String.Empty
Dim pbNeg as Boolean = false

dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
pcRightParentheses, pcAndOr, pbNeg)

Dim results As DataSet = dqa.Execute(ds)
ugdEpiCustom1.DataSource = results

----------------End------------------------------

With the above code I end up with the error "Value of type
'Epicor.Mfg.BO.QueryDesignDataSet' cannot be converted to
'Epicor.Mfg.BO.DynamicQueryDataSet'"

When I change it to try and extract the 'DynamicQueryDataSet' from the
'DynamicQuery' object with the following line.

Dim results As DataSet = dqa.Execute(dqa.DynamicQueryDataset)

I get the error "'DynamicQueryDataset' is not a member of
'Epicor.Mfg.BO.DynamicQuery'"

I can't win for losing on this one.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"thedemondamian" <sheath@...> wrote:
>
>
>
> Thank you guys for your continued work on this. I also broke down and
submitted a call to Epicor for a code sample last week. I will post the
results here as soon as I get them.
>
> In the mean time I have downloaded the BL Tester, set it up, and have
been learning to use it. So far i have been able to duplicate there
error that i am getting from the script editor.
>
> Joe, I will try to implement your solution and see what i get.
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"jckinneman" <jckinneman@> wrote:
> >
> > Sorry haven't had a chance to get into this deeper.
> >
> > Supposedly from the object explorer you can do this.
> > SalesOrderTrackerForm.Session.ConnectionPool
> >
> > In Epicor 9 you have to cast the session object first and then refer
to the connectionpool, in 8 you may be able to reference it directly.
> >
> > Epicor.Mfg.Core.Session s =
(Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;
> >
> > SchedulingBoardBO = new
Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);
> >
> > JK.
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
Joe Rojas <jrojas@> wrote:
> > >
> > > Well, after banging my head against the wall on how to use the
> > > DynamicQueryAdapter, I called Epicor and asked for a coding
example of
> > > how to add a runtime criteria before executing the BAQ. I am
waiting for
> > > a response.
> > >
> > >
> > >
> > > In the meantime, I noticed how Jim said that you can either use
the
> > > adapter or use the BO directly.
> > >
> > > I had luck using the BL Tester so I gave the BO approach a try
with
> > > success.
> > >
> > > Below is my code.
> > >
> > > I didn't know how to access the existing session object so I had
to
> > > create a new one, which required me to add Epicor.Mfg.Core.Session
and
> > > Epicor.Mfg.Core.BLConnectionPool as references.
> > >
> > > Anyone know how to access the current session?
> > >
> > >
> > >
> > > Dim episession As Session = New Session(<username>, <password>,
> > > "AppServerDC://<server name>:<port>", Session.LicenseType.Default)
> > >
> > > Dim dqa As DynamicQuery = New
DynamicQuery(episession.ConnectionPool)
> > >
> > > Dim ds As QueryDesignDataSet =
dqa.GetByID("MATS-ProjectInfluencers")
> > >
> > >
> > >
> > > Dim pcQueryID as String = "MATS-ProjectInfluencers"
> > >
> > > Dim pcTable as String = "UD04"
> > >
> > > Dim pcField as String = "Key1"
> > >
> > > Dim pcCondition as String = "="
> > >
> > > Dim pbIsConst as Boolean = true
> > >
> > > Dim pcValue as String = "2010-0"
> > >
> > > Dim pcToTable as String = String.Empty
> > >
> > > Dim pcToField as String = String.Empty
> > >
> > > Dim pcLeftParentheses as String = String.Empty
> > >
> > > Dim pcRightParentheses as String = String.Empty
> > >
> > > Dim pcAndOr as String = String.Empty
> > >
> > > Dim pbNeg as Boolean = false
> > >
> > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > pcRightParentheses, pcAndOr, pbNeg)
> > >
> > > Dim DQResults As DataSet = dqa.Execute(ds)
> > >
> > > ugInfluencers.DataSource = DQResults
> > >
> > >
> > >
> > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
> > > Of jckinneman
> > > Sent: Wednesday, August 04, 2010 7:26 PM
> > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > >
> > >
> > >
> > >
> > >
> > > I haven't had a chance to get back in and look at this further but
one
> > > thing to remember when working with the BL tester this works
directly
> > > with the BO. The example we are working with is supposed to be the
> > > adapter approach. In a customization you can use the adapter
approach or
> > > the BO direct method. Your comment and thinking about things I may
have
> > > mixed and matched some of the two approaches in writing things
from
> > > memory and grabbing snippets of code from here and there.
> > >
> > > I should be able to grab a few minutes tomorrow and start from
scratch
> > > and put together a clean example.
> > >
> > > Jim Kinneman
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> , Joe
> > > Rojas <jrojas@> wrote:
> > > >
> > > > I was following this thread because I need this same
functionality for
> > > > one of my customizations.
> > > >
> > > > I'm on E9.04 and I'm getting the same issue as Scott.
> > > >
> > > >
> > > >
> > > > I've been debugging for several hours and it looks like the
problem is
> > > > related to the line that reads: ds = dqa.QueryDesignData
> > > >
> > > > It looks like once this line executes, that there is no data in
"ds".
> > > So
> > > > when you try to use the AddWhereItem method, it's puking because
there
> > > > is no existing data that defines the BAQ.
> > > >
> > > > It essential saying that there is no information related to the
> > > > AddWhereItem that your trying to add so I can't add it.
> > > >
> > > >
> > > >
> > > > What I find equally confusing is that the BL Tester states that
the
> > > > GetQueryByID should be returning a QueryDesignDataSet not a
Boolean.
> > > >
> > > > To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
> > > >
> > > > Of course you can't do that because the script editor insists
that it
> > > is
> > > > going to return a Boolean.
> > > >
> > > >
> > > >
> > > > Maybe someone else can chime in with an answer.
> > > >
> > > >
> > > >
> > > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> > > [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
> > > Behalf
> > > > Of jckinneman
> > > > Sent: Tuesday, August 03, 2010 7:05 PM
> > > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> > > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I duplicated your issue in an 8 environment, there is something
> > > > different about 8 with this BO that I haven't figured out. I do
the
> > > > exact same thing many times in 9 without any issues. Of course
the BL
> > > > tester in my 8 environment is not setup correctly and haven't
had a
> > > > chance to resolve that yet. When i get a few minutes I will dig
into
> > > > this deeper.
> > > >
> > > > Jim Kinneman
> > > > Senior Consultant
> > > > Encompass Solutions, Inc
> > > >
> > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> ,
> > > > "thedemondamian" <sheath@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Jim,
> > > > >
> > > > > We are running on 8.03.409c.
> > > > >
> > > > > Here is my
BAQ......................................................
> > > > >
> > > > > for each PlantWhse no-lock , each PartWhse where
(PlantWhse.Company
> > > =
> > > > PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> > > > PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each
Part
> > > > where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> > > > Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> > > > Warehse.Company and PartWhse.WarehouseCode =
Warehse.WarehouseCode)
> > > > no-lock
> > > > >
> > > > >
> > > > > I am using the object explorer to verify my signatures. As far
as I
> > > > can see it matches your solution.
> > > > >
> > > > > Here is the method signature from my
> > > version.........................
> > > > >
> > > > > ' Imports Epicor.Mfg.UI.Adapters
> > > > >
> > > > > Dim [varAdapterName] As DynamicQueryAdapter = New
> > > > DynamicQueryAdapter([UIForm])
> > > > > [varAdapterName].BOConnect()
> > > > >
> > > > > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > > pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> > > > pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > > >
> > > > > [varAdapterName].Dispose()
> > > > >
> > > > >
> > > > > Thanks Again,
> > > > > Scott
> > > > >
> > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> ,
> > > > "jckinneman" <jckinneman@> wrote:
> > > > > >
> > > > > > What does your BAQ look like? What tables are included? What
> > > version
> > > > of Epicor are you running on? The example I provided is based on
> > > Epicor
> > > > 9, the BO signature may be different for 8.
> > > > > >
> > > > > > The primary way I explore how to call BOs is via the
Business
> > > Logic
> > > > Tester. All the systems I have worked on have it but I have also
seen
> > > > discussions that you might only be able to get it if you have
the SDK.
> > > > If you have the BL tester you can easily look at and test the
> > > signature
> > > > for calling the BO. If you don't have the BL tester you can
also, when
> > > > in customization mode, use the Object Explorer to look at the
> > > signatures
> > > > on the BO. If this is 8 we may have to adjust the signature on
the
> > > call
> > > > to whereitem.
> > > > > >
> > > > > > While the error prevents you from getting to it when you are
ready
> > > > to run your query you will want to use dqa.Execute(ds)
ExecuteByID
> > > will
> > > > run the BAQ as it exists in the db without the whereitems.
> > > > > >
> > > > > > Jim Kinneman
> > > > > > Senior Consultant
> > > > > > Encompass Solutions
> > > > > >
> > > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com> ,
> > > > "thedemondamian" <sheath@> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Jim,
> > > > > > >
> > > > > > > I got a chance to test out your solution and I am
receiving a
> > > > Foreign Key Constraint error from the AddWhereItem method.
> > > > > > >
> > > > > > >
> > > > > > > Error Detail
> > > > > > > ============
> > > > > > > Failed to enable constraints. One or more rows contain
values
> > > > violating non-null, unique, or foreign-key constraints.
> > > > > > >
> > > > > > > Table: QueryWhereItem
> > > > > > > Company='MMI' DCDUserID='sheath'
ExportID='MMI-PartAvailable'
> > > > DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> > > > QueryTableQueryWhereItem requires the child key values (MMI,
sheath,
> > > > MMI-PartAvailable, Part) to exist in the parent table.
> > > > > > >
> > > > > > >
> > > > > > > Stack Trace
> > > > > > > ===========
> > > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable
sourceDT,
> > > > DataTable targetDT)
> > > > > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet
parameters,
> > > > DataSet ds, Int32 paramPos)
> > > > > > > at
> > > >
Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> > > > String pcQueryID, String pcTable, String pcField, String
pcCondition,
> > > > Boolean pbIsConst, String pcValue, String pcToTable, String
pcToField,
> > > > String pcLeftParentheses, String pcRightParentheses, String
pcAndOr,
> > > > Boolean pbNeg)
> > > > > > > at
> > > >
> > >
Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> > > > et ds, String pcQueryID, String pcTable, String pcField, String
> > > > pcCondition, Boolean pbIsConst, String pcValue, String
pcToTable,
> > > String
> > > > pcToField, String pcLeftParentheses, String pcRightParentheses,
String
> > > > pcAndOr, Boolean pbNeg)
> > > > > > >
> > > > > > > Inner Exception
> > > > > > > ===============
> > > > > > > Failed to enable constraints. One or more rows contain
values
> > > > violating non-null, unique, or foreign-key constraints.
> > > > > > >
> > > > > > > Inner Stack Trace
> > > > > > > =================
> > > > > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > > > > at System.Data.DataSet.EnableConstraints()
> > > > > > > at System.Data.DataSet.set_EnforceConstraints(Boolean
value)
> > > > > > > at System.Data.DataTable.EndLoadData()
> > > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable
sourceDT,
> > > > DataTable targetDT)
> > > > > > >
> > > > > > >
> > > > > > > Here is my code:
> > > > > > >
> > > > > > >
> > > > > > > Dim strValue as string = args.ProposedValue
> > > > > > >
> > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > dqa.BOConnect()
> > > > > > >
> > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > ds = New QueryDesignDataSet()
> > > > > > >
> > > > > > > Dim test As Boolean =
dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > ds = dqa.QueryDesignData
> > > > > > >
> > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > Dim pcTable as String = "Part"
> > > > > > > Dim pcField as String = "PartNum"
> > > > > > > Dim pcCondition as String = "="
> > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > Dim pcValue as String = strValue
> > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > Dim pcToField as String = String.Empty
> > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > Dim pbNeg as Boolean = false
> > > > > > >
> > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
pcCondition,
> > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > >
> > > > > > > dqa.Executebyid("MMI-PartAvailable")
> > > > > > > Dim results As DataSet = dqa.QueryResults
> > > > > > > ugdEpiCustom1.DataSource = results
> > > > > > >
> > > > > > >
> > > > > > > Thanks for your help,
> > > > > > > Scott
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> > > > , "thedemondamian" <sheath@> wrote:
> > > > > > > >
> > > > > > > > Excellent, I knew it was a simple solution, I just could
not
> > > see
> > > > all of the pieces.
> > > > > > > >
> > > > > > > > The two diferent dataset types were throwing me off.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@>
wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > To add a where item
> > > > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > > > ds = New QueryDesignDataSet()
> > > > > > > > >
> > > > > > > > > Dim test As Boolean =
dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > > ds = dqa.QueryDesignData
> > > > > > > > >
> > > > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > > > Dim pcTable as String = "WhatTable"
> > > > > > > > > Dim pcField as String = "WhatField"
> > > > > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > > > Dim pcToField as String = String.Empty
> > > > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > > > Dim pbNeg as Boolean = false
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > pcCondition,
> > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > > > > // repeat as needed to add all your where clauses, you
can
> > > use
> > > > parentheses and "AND" and "OR" if you need to.
> > > > > > > > >
> > > > > > > > > Jim Kinneman
> > > > > > > > > Senior Consultant
> > > > > > > > > Encompass Solutions Inc
> > > > > > > > >
> > > > > > > > > --- In vantage@yahoogroups.com
<mailto:vantage%40yahoogroups.com>
> > > <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@>
wrote:
> > > > > > > > > >
> > > > > > > > > > I don't have a problem using the DynamicQueryAdapter
to
> > > run
> > > > a BAQ and get results from within the script editor of a form.
> > > > > > > > > >
> > > > > > > > > > What I do want to know is how to add a WHERE clause
to the
> > > > query adapter in order to filter the results of the BAQ.
> > > > > > > > > >
> > > > > > > > > > I have tried the built in AddWhereItem, InvokeSearch
and
> > > > LoadUserResults methods with no luck. Here is my latest code:
> > > > > > > > > >
> > > > > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > > > > Dim strWhereClause as string
> > > > > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > > > > dqa.BOConnect()
> > > > > > > > > >
> > > > > > > > > > Dim test As Boolean =
> > > dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > > >
> > > > > > > > > > Dim MorePages As Boolean
> > > > > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > > > > Dim opts As SearchOptions = New
> > > > SearchOptions(SearchMode.AutoSearch)
> > > > > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> > > > strWhereClause)
> > > > > > > > > > Dim SearchResults as Data.Dataset =
dqa.GetRows(opts,
> > > > MorePages)
> > > > > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > > > > >
> > > > > > > > > > Any ideas?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>












Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-1264 | fax: 781-341-5694
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


[Non-text portions of this message have been removed]
This is the decription of the method from the methods list.

GetByID(System.String)
This method returns a dataset representing an existing query

Parameters:
pcQueryID: The Query(Exports) ID

Returns:
Returns the dataset representing the query

But, when I invoke the method in the BLtester it returns a QueryDesignDataSet.



--- In vantage@yahoogroups.com, Joe Rojas <jrojas@...> wrote:
>
> I wonder how much of a difference there is between 8.03 and 9.04?
>
> Do you have the BL Tester loaded?
>
> If yes, what is the return type for DynamicQuery.GetByID()?
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of thedemondamian
> Sent: Thursday, August 12, 2010 9:08 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Using the DynamicQyeryAdapter
>
>
>
>
>
>
>
> Ok, I tried using the BO object instead of the adapter and here are the
> results.
>
> -----------------Code---------------------------
>
> Dim strValue as string = args.ProposedValue
>
> Dim s as Epicor.Mfg.Core.Session = SalesOrderForm.Session
>
> Dim dqa As DynamicQuery = New DynamicQuery(s.ConnectionPool)
>
> Dim ds As QueryDesignDataSet = dqa.GetByID("MMI-PartAvailable")
>
> Dim pcQueryID as String = "MMI-PartAvailable"
> Dim pcTable as String = "Part"
> Dim pcField as String = "PartNum"
> Dim pcCondition as String = "="
> Dim pbIsConst as Boolean = true
> Dim pcValue as String = strValue
> Dim pcToTable as String = String.Empty
> Dim pcToField as String = String.Empty
> Dim pcLeftParentheses as String = String.Empty
> Dim pcRightParentheses as String = String.Empty
> Dim pcAndOr as String = String.Empty
> Dim pbNeg as Boolean = false
>
> dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> pcRightParentheses, pcAndOr, pbNeg)
>
> Dim results As DataSet = dqa.Execute(ds)
> ugdEpiCustom1.DataSource = results
>
> ----------------End------------------------------
>
> With the above code I end up with the error "Value of type
> 'Epicor.Mfg.BO.QueryDesignDataSet' cannot be converted to
> 'Epicor.Mfg.BO.DynamicQueryDataSet'"
>
> When I change it to try and extract the 'DynamicQueryDataSet' from the
> 'DynamicQuery' object with the following line.
>
> Dim results As DataSet = dqa.Execute(dqa.DynamicQueryDataset)
>
> I get the error "'DynamicQueryDataset' is not a member of
> 'Epicor.Mfg.BO.DynamicQuery'"
>
> I can't win for losing on this one.
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> "thedemondamian" <sheath@> wrote:
> >
> >
> >
> > Thank you guys for your continued work on this. I also broke down and
> submitted a call to Epicor for a code sample last week. I will post the
> results here as soon as I get them.
> >
> > In the mean time I have downloaded the BL Tester, set it up, and have
> been learning to use it. So far i have been able to duplicate there
> error that i am getting from the script editor.
> >
> > Joe, I will try to implement your solution and see what i get.
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> "jckinneman" <jckinneman@> wrote:
> > >
> > > Sorry haven't had a chance to get into this deeper.
> > >
> > > Supposedly from the object explorer you can do this.
> > > SalesOrderTrackerForm.Session.ConnectionPool
> > >
> > > In Epicor 9 you have to cast the session object first and then refer
> to the connectionpool, in 8 you may be able to reference it directly.
> > >
> > > Epicor.Mfg.Core.Session s =
> (Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;
> > >
> > > SchedulingBoardBO = new
> Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);
> > >
> > > JK.
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
> Joe Rojas <jrojas@> wrote:
> > > >
> > > > Well, after banging my head against the wall on how to use the
> > > > DynamicQueryAdapter, I called Epicor and asked for a coding
> example of
> > > > how to add a runtime criteria before executing the BAQ. I am
> waiting for
> > > > a response.
> > > >
> > > >
> > > >
> > > > In the meantime, I noticed how Jim said that you can either use
> the
> > > > adapter or use the BO directly.
> > > >
> > > > I had luck using the BL Tester so I gave the BO approach a try
> with
> > > > success.
> > > >
> > > > Below is my code.
> > > >
> > > > I didn't know how to access the existing session object so I had
> to
> > > > create a new one, which required me to add Epicor.Mfg.Core.Session
> and
> > > > Epicor.Mfg.Core.BLConnectionPool as references.
> > > >
> > > > Anyone know how to access the current session?
> > > >
> > > >
> > > >
> > > > Dim episession As Session = New Session(<username>, <password>,
> > > > "AppServerDC://<server name>:<port>", Session.LicenseType.Default)
> > > >
> > > > Dim dqa As DynamicQuery = New
> DynamicQuery(episession.ConnectionPool)
> > > >
> > > > Dim ds As QueryDesignDataSet =
> dqa.GetByID("MATS-ProjectInfluencers")
> > > >
> > > >
> > > >
> > > > Dim pcQueryID as String = "MATS-ProjectInfluencers"
> > > >
> > > > Dim pcTable as String = "UD04"
> > > >
> > > > Dim pcField as String = "Key1"
> > > >
> > > > Dim pcCondition as String = "="
> > > >
> > > > Dim pbIsConst as Boolean = true
> > > >
> > > > Dim pcValue as String = "2010-0"
> > > >
> > > > Dim pcToTable as String = String.Empty
> > > >
> > > > Dim pcToField as String = String.Empty
> > > >
> > > > Dim pcLeftParentheses as String = String.Empty
> > > >
> > > > Dim pcRightParentheses as String = String.Empty
> > > >
> > > > Dim pcAndOr as String = String.Empty
> > > >
> > > > Dim pbNeg as Boolean = false
> > > >
> > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField, pcCondition,
> > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > pcRightParentheses, pcAndOr, pbNeg)
> > > >
> > > > Dim DQResults As DataSet = dqa.Execute(ds)
> > > >
> > > > ugInfluencers.DataSource = DQResults
> > > >
> > > >
> > > >
> > > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> Behalf
> > > > Of jckinneman
> > > > Sent: Wednesday, August 04, 2010 7:26 PM
> > > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I haven't had a chance to get back in and look at this further but
> one
> > > > thing to remember when working with the BL tester this works
> directly
> > > > with the BO. The example we are working with is supposed to be the
> > > > adapter approach. In a customization you can use the adapter
> approach or
> > > > the BO direct method. Your comment and thinking about things I may
> have
> > > > mixed and matched some of the two approaches in writing things
> from
> > > > memory and grabbing snippets of code from here and there.
> > > >
> > > > I should be able to grab a few minutes tomorrow and start from
> scratch
> > > > and put together a clean example.
> > > >
> > > > Jim Kinneman
> > > >
> > > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> , Joe
> > > > Rojas <jrojas@> wrote:
> > > > >
> > > > > I was following this thread because I need this same
> functionality for
> > > > > one of my customizations.
> > > > >
> > > > > I'm on E9.04 and I'm getting the same issue as Scott.
> > > > >
> > > > >
> > > > >
> > > > > I've been debugging for several hours and it looks like the
> problem is
> > > > > related to the line that reads: ds = dqa.QueryDesignData
> > > > >
> > > > > It looks like once this line executes, that there is no data in
> "ds".
> > > > So
> > > > > when you try to use the AddWhereItem method, it's puking because
> there
> > > > > is no existing data that defines the BAQ.
> > > > >
> > > > > It essential saying that there is no information related to the
> > > > > AddWhereItem that your trying to add so I can't add it.
> > > > >
> > > > >
> > > > >
> > > > > What I find equally confusing is that the BL Tester states that
> the
> > > > > GetQueryByID should be returning a QueryDesignDataSet not a
> Boolean.
> > > > >
> > > > > To me, the line should read: ds = dqa.GetQueryByID("IDNAME")
> > > > >
> > > > > Of course you can't do that because the script editor insists
> that it
> > > > is
> > > > > going to return a Boolean.
> > > > >
> > > > >
> > > > >
> > > > > Maybe someone else can chime in with an answer.
> > > > >
> > > > >
> > > > >
> > > > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> > > > [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ] On
> > > > Behalf
> > > > > Of jckinneman
> > > > > Sent: Tuesday, August 03, 2010 7:05 PM
> > > > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> > > > > Subject: [Vantage] Re: Using the DynamicQyeryAdapter
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > I duplicated your issue in an 8 environment, there is something
> > > > > different about 8 with this BO that I haven't figured out. I do
> the
> > > > > exact same thing many times in 9 without any issues. Of course
> the BL
> > > > > tester in my 8 environment is not setup correctly and haven't
> had a
> > > > > chance to resolve that yet. When i get a few minutes I will dig
> into
> > > > > this deeper.
> > > > >
> > > > > Jim Kinneman
> > > > > Senior Consultant
> > > > > Encompass Solutions, Inc
> > > > >
> > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> ,
> > > > > "thedemondamian" <sheath@> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Jim,
> > > > > >
> > > > > > We are running on 8.03.409c.
> > > > > >
> > > > > > Here is my
> BAQ......................................................
> > > > > >
> > > > > > for each PlantWhse no-lock , each PartWhse where
> (PlantWhse.Company
> > > > =
> > > > > PartWhse.Company and PlantWhse.PartNum = PartWhse.PartNum and
> > > > > PlantWhse.WarehouseCode = PartWhse.WarehouseCode) no-lock , each
> Part
> > > > > where (PlantWhse.Company = Part.Company and PlantWhse.PartNum =
> > > > > Part.PartNum) no-lock , each Warehse where (PartWhse.Company =
> > > > > Warehse.Company and PartWhse.WarehouseCode =
> Warehse.WarehouseCode)
> > > > > no-lock
> > > > > >
> > > > > >
> > > > > > I am using the object explorer to verify my signatures. As far
> as I
> > > > > can see it matches your solution.
> > > > > >
> > > > > > Here is the method signature from my
> > > > version.........................
> > > > > >
> > > > > > ' Imports Epicor.Mfg.UI.Adapters
> > > > > >
> > > > > > Dim [varAdapterName] As DynamicQueryAdapter = New
> > > > > DynamicQueryAdapter([UIForm])
> > > > > > [varAdapterName].BOConnect()
> > > > > >
> > > > > > [varAdapterName].AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > > > pcCondition, pbIsConst, pcValue, pcToTable, pcToField,
> > > > > pcLeftParentheses, pcRightParentheses, pcAndOr, pbNeg)
> > > > > >
> > > > > > [varAdapterName].Dispose()
> > > > > >
> > > > > >
> > > > > > Thanks Again,
> > > > > > Scott
> > > > > >
> > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> ,
> > > > > "jckinneman" <jckinneman@> wrote:
> > > > > > >
> > > > > > > What does your BAQ look like? What tables are included? What
> > > > version
> > > > > of Epicor are you running on? The example I provided is based on
> > > > Epicor
> > > > > 9, the BO signature may be different for 8.
> > > > > > >
> > > > > > > The primary way I explore how to call BOs is via the
> Business
> > > > Logic
> > > > > Tester. All the systems I have worked on have it but I have also
> seen
> > > > > discussions that you might only be able to get it if you have
> the SDK.
> > > > > If you have the BL tester you can easily look at and test the
> > > > signature
> > > > > for calling the BO. If you don't have the BL tester you can
> also, when
> > > > > in customization mode, use the Object Explorer to look at the
> > > > signatures
> > > > > on the BO. If this is 8 we may have to adjust the signature on
> the
> > > > call
> > > > > to whereitem.
> > > > > > >
> > > > > > > While the error prevents you from getting to it when you are
> ready
> > > > > to run your query you will want to use dqa.Execute(ds)
> ExecuteByID
> > > > will
> > > > > run the BAQ as it exists in the db without the whereitems.
> > > > > > >
> > > > > > > Jim Kinneman
> > > > > > > Senior Consultant
> > > > > > > Encompass Solutions
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com> ,
> > > > > "thedemondamian" <sheath@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Jim,
> > > > > > > >
> > > > > > > > I got a chance to test out your solution and I am
> receiving a
> > > > > Foreign Key Constraint error from the AddWhereItem method.
> > > > > > > >
> > > > > > > >
> > > > > > > > Error Detail
> > > > > > > > ============
> > > > > > > > Failed to enable constraints. One or more rows contain
> values
> > > > > violating non-null, unique, or foreign-key constraints.
> > > > > > > >
> > > > > > > > Table: QueryWhereItem
> > > > > > > > Company='MMI' DCDUserID='sheath'
> ExportID='MMI-PartAvailable'
> > > > > DataTableID='Part' Seq='1' RowIdent='': ForeignKeyConstraint
> > > > > QueryTableQueryWhereItem requires the child key values (MMI,
> sheath,
> > > > > MMI-PartAvailable, Part) to exist in the parent table.
> > > > > > > >
> > > > > > > >
> > > > > > > > Stack Trace
> > > > > > > > ===========
> > > > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable
> sourceDT,
> > > > > DataTable targetDT)
> > > > > > > > at Epicor.Mfg.Pro.Convert.ToDataSet(ParameterSet
> parameters,
> > > > > DataSet ds, Int32 paramPos)
> > > > > > > > at
> > > > >
> Epicor.Mfg.Proxy.DynamicQueryImpl.AddWhereItem(QueryDesignDataSet ds,
> > > > > String pcQueryID, String pcTable, String pcField, String
> pcCondition,
> > > > > Boolean pbIsConst, String pcValue, String pcToTable, String
> pcToField,
> > > > > String pcLeftParentheses, String pcRightParentheses, String
> pcAndOr,
> > > > > Boolean pbNeg)
> > > > > > > > at
> > > > >
> > > >
> Epicor.Mfg.UI.Adapters.DynamicQueryAdapter.AddWhereItem(QueryDesignDataS
> > > > > et ds, String pcQueryID, String pcTable, String pcField, String
> > > > > pcCondition, Boolean pbIsConst, String pcValue, String
> pcToTable,
> > > > String
> > > > > pcToField, String pcLeftParentheses, String pcRightParentheses,
> String
> > > > > pcAndOr, Boolean pbNeg)
> > > > > > > >
> > > > > > > > Inner Exception
> > > > > > > > ===============
> > > > > > > > Failed to enable constraints. One or more rows contain
> values
> > > > > violating non-null, unique, or foreign-key constraints.
> > > > > > > >
> > > > > > > > Inner Stack Trace
> > > > > > > > =================
> > > > > > > > at System.Data.DataSet.FailedEnableConstraints()
> > > > > > > > at System.Data.DataSet.EnableConstraints()
> > > > > > > > at System.Data.DataSet.set_EnforceConstraints(Boolean
> value)
> > > > > > > > at System.Data.DataTable.EndLoadData()
> > > > > > > > at Epicor.Mfg.Pro.Convert.copyDataTable(DataTable
> sourceDT,
> > > > > DataTable targetDT)
> > > > > > > >
> > > > > > > >
> > > > > > > > Here is my code:
> > > > > > > >
> > > > > > > >
> > > > > > > > Dim strValue as string = args.ProposedValue
> > > > > > > >
> > > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > > dqa.BOConnect()
> > > > > > > >
> > > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > > ds = New QueryDesignDataSet()
> > > > > > > >
> > > > > > > > Dim test As Boolean =
> dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > ds = dqa.QueryDesignData
> > > > > > > >
> > > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > > Dim pcTable as String = "Part"
> > > > > > > > Dim pcField as String = "PartNum"
> > > > > > > > Dim pcCondition as String = "="
> > > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > > Dim pcValue as String = strValue
> > > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > > Dim pcToField as String = String.Empty
> > > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > > Dim pbNeg as Boolean = false
> > > > > > > >
> > > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
> pcCondition,
> > > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > > >
> > > > > > > > dqa.Executebyid("MMI-PartAvailable")
> > > > > > > > Dim results As DataSet = dqa.QueryResults
> > > > > > > > ugdEpiCustom1.DataSource = results
> > > > > > > >
> > > > > > > >
> > > > > > > > Thanks for your help,
> > > > > > > > Scott
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> > > > > , "thedemondamian" <sheath@> wrote:
> > > > > > > > >
> > > > > > > > > Excellent, I knew it was a simple solution, I just could
> not
> > > > see
> > > > > all of the pieces.
> > > > > > > > >
> > > > > > > > > The two diferent dataset types were throwing me off.
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com>
> > > > > <mailto:vantage%40yahoogroups.com> , "jckinneman" <jckinneman@>
> wrote:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > To add a where item
> > > > > > > > > > Dim ds as New QueryDesignDataSet()
> > > > > > > > > > ds = New QueryDesignDataSet()
> > > > > > > > > >
> > > > > > > > > > Dim test As Boolean =
> dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > > > ds = dqa.QueryDesignData
> > > > > > > > > >
> > > > > > > > > > Dim pcQueryID as String = "MMI-PartAvailable"
> > > > > > > > > > Dim pcTable as String = "WhatTable"
> > > > > > > > > > Dim pcField as String = "WhatField"
> > > > > > > > > > Dim pcCondition as String = "=" ' could <> > < etc
> > > > > > > > > > Dim pbIsConst as Boolean = true
> > > > > > > > > > Dim pcValue as String = "whatvaluetolookfor"
> > > > > > > > > > Dim pcToTable as String = String.Empty
> > > > > > > > > > Dim pcToField as String = String.Empty
> > > > > > > > > > Dim pcLeftParentheses as String = String.Empty
> > > > > > > > > > Dim pcRightParentheses as String = String.Empty
> > > > > > > > > > Dim pcAndOr as String = String.Empty
> > > > > > > > > > Dim pbNeg as Boolean = false
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > dqa.AddWhereItem(ds, pcQueryID, pcTable, pcField,
> > > > pcCondition,
> > > > > pbIsConst, pcValue, pcToTable, pcToField, pcLeftParentheses,
> > > > > pcRightParentheses, pcAndOr, pbNeg)
> > > > > > > > > > // repeat as needed to add all your where clauses, you
> can
> > > > use
> > > > > parentheses and "AND" and "OR" if you need to.
> > > > > > > > > >
> > > > > > > > > > Jim Kinneman
> > > > > > > > > > Senior Consultant
> > > > > > > > > > Encompass Solutions Inc
> > > > > > > > > >
> > > > > > > > > > --- In vantage@yahoogroups.com
> <mailto:vantage%40yahoogroups.com>
> > > > <mailto:vantage%40yahoogroups.com>
> > > > > <mailto:vantage%40yahoogroups.com> , "thedemondamian" <sheath@>
> wrote:
> > > > > > > > > > >
> > > > > > > > > > > I don't have a problem using the DynamicQueryAdapter
> to
> > > > run
> > > > > a BAQ and get results from within the script editor of a form.
> > > > > > > > > > >
> > > > > > > > > > > What I do want to know is how to add a WHERE clause
> to the
> > > > > query adapter in order to filter the results of the BAQ.
> > > > > > > > > > >
> > > > > > > > > > > I have tried the built in AddWhereItem, InvokeSearch
> and
> > > > > LoadUserResults methods with no luck. Here is my latest code:
> > > > > > > > > > >
> > > > > > > > > > > Dim PartNum as string = args.ProposedValue
> > > > > > > > > > > Dim strWhereClause as string
> > > > > > > > > > > Dim dqa As DynamicQueryAdapter = New
> > > > > DynamicQueryAdapter(SalesOrderForm)
> > > > > > > > > > > dqa.BOConnect()
> > > > > > > > > > >
> > > > > > > > > > > Dim test As Boolean =
> > > > dqa.GetQueryByID("MMI-PartAvailable")
> > > > > > > > > > >
> > > > > > > > > > > Dim MorePages As Boolean
> > > > > > > > > > > strWhereClause = "PartNum = '" & PartNum & "'"
> > > > > > > > > > > Dim opts As SearchOptions = New
> > > > > SearchOptions(SearchMode.AutoSearch)
> > > > > > > > > > > opts.NamedSearch.WhereClauses.Add("PlantWhse",
> > > > > strWhereClause)
> > > > > > > > > > > Dim SearchResults as Data.Dataset =
> dqa.GetRows(opts,
> > > > > MorePages)
> > > > > > > > > > > ugdEpiCustom1.DataSource = SearchResults
> > > > > > > > > > >
> > > > > > > > > > > Any ideas?
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > [Non-text portions of this message have been removed]
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> >
>
>
>
>
>
>
>
>
>
>
>
>
> Joe Rojas | Director of Information Technology | Mats Inc
> dir: 781-573-0291 | cell: 781-408-1264 | fax: 781-341-5694
> jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring
>
>
> This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
>
>
> [Non-text portions of this message have been removed]
>