maverick
(Nancy)
March 9, 2023, 4:23pm
1
I created a button on a dashboard “btnQuoteSeach” that when you click should allow you to search for a quote/asm (similar to the one used by engineering workbench → get details → Quote). Problem is when I click the “Seach” I get the error: “GetList is not supported”
This is the code I am using. I cannot figure out why the GetList isn’t working. I see Erp.Adapters.QuoteAsmSearch does have a “GetList” method. Why would I be getting a “GetList” error.
private void btnQuoteSearch_Click(object sender, System.EventArgs args)
{
bool recSelected;
string whereClause = "(AssemblySeq = 0 AND Template = 1 BY PartNum) AND PartNum >= 'TEST'";
System.Data.DataSet dsQuoteAsmAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "QuoteAsmSearchAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsQuoteAsmAdapter.Tables[0].Rows[0];
//map search fields to application fields
EpiDataView edvQuoteAsm = ((EpiDataView)(this.oTrans.EpiDataViews["V__ENG_GETDTL_1View"]));
System.Data.DataRow edvQuoteAsmRow = edvQuoteAsm.CurrentDataRow;
if((edvQuoteAsmRow != null))
{
edvQuoteAsmRow.BeginEdit();
edvQuoteAsmRow["numCalculated_cFromQuoteNum"] = adapterRow["QuoteNum"];
edvQuoteAsmRow["numCalculated_cFromQuoteLine"] = adapterRow["QuoteLine"];
edvQuoteAsmRow.EndEdit();
}
}
}
klincecum
(Kevin Lincecum)
March 9, 2023, 5:14pm
2
QuoteAsmSearchAdapter has a GetRows, not a GetList
klincecum
(Kevin Lincecum)
March 9, 2023, 5:15pm
3
public QuoteAsmSearchDataSet GetRows(string whereClauseQuoteAsmSearch, int pageSize, int absolutePage, out bool morePages)
No GetList in the dll
klincecum
(Kevin Lincecum)
March 9, 2023, 5:29pm
4
This thread may be of interest to you.
In a Nutshell,
In Epicor 9:
System.Data.DataSet dsPartRevSearchAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "PartRevSearchAdapter", out recSelected, false, whereClause);
In Epicor 10:
listLookup only gets the “core columns” it no longer gets the UD Columns by design.
So you have a few options… I use the BOReader instead of listLookup when doing simple reads… but there is also a catch.
GetList: WORKS! - BRINGS IN THE PART REV INFO WITH MY UD FIELDS POPULATED!
Syst…
maverick
(Nancy)
March 9, 2023, 5:46pm
6
I added:
using Ice.Proxy.Lib; //BO Reader
using Ice.Core;
using Erp.BO;
using Ice.BO;
public class Script
{
BOReaderImpl _bor;
public void InitializeCustomCode()
{
_bor = WCFServiceSupport.CreateImpl<Ice.Proxy.Lib.BOReaderImpl>((Ice.Core.Session)oTrans.Session, Ice.Contracts.BOReaderSvcContract.UriPath);
}
But I am getting the error now:
‘Ice.Contracts.BOReaderSvcContract’ does not contain a definition for ‘UriPath’
maverick
(Nancy)
March 9, 2023, 6:50pm
7
I still want the QuoteAsmSearchAdapter to open up and allow me to select the quotenum/line and return back to the dashboard.
maverick
(Nancy)
March 9, 2023, 7:03pm
8
I just changed my code to use the QuoteDtlSearchAdapter - and that one will work. The QuoteAsmSearchAdapter is being used from Engineering Workbench → Get Details … so not sure why it works from there, but I can’t see the code Epicor is using to call the QuoteAsmSearchAdapter.
maverick
(Nancy)
March 9, 2023, 7:27pm
9
Thank you klincecum for your thoughts and help.
klincecum
(Kevin Lincecum)
March 9, 2023, 8:09pm
10
Here is how Epicor does your first question on the engineering workbench.
//references
//Erp.Adapters.QuoteAsm.dll
//Erp.Adapters.QuoteAsmSearch.dll
//Erp.Contracts.BO.QuoteAsm.dll
//Erp.Contracts.BO.QuoteAsmSearch.dll
using Erp.UI.Searches;
using Erp.Adapters;
private void epiButtonC1_Click(object sender, System.EventArgs args)
{
QuoteAsmSearchAdapter quoteAsmAdapter = new QuoteAsmSearchAdapter(this.oTrans);
string text = "AssemblySeq = 0";
text += " AND Template = 1 BY PartNum";
SearchOptions searchOptions = new SearchOptions(SearchMode.ShowDialog);
searchOptions.PrimaryTableName = "QuoteAsmSearch";
searchOptions.PreLoadSearchFilter = text;
searchOptions.DataSetMode = DataSetMode.RowsDataSet;
searchOptions.SelectMode = SelectMode.SingleSelect;
QuoteAsmSearchForm quoteAsmSearchForm = new QuoteAsmSearchForm();
quoteAsmSearchForm.BasicPanelWhoCalled = "Erp.UI.GetDetailsEntry";
quoteAsmAdapter.SearchForm = quoteAsmSearchForm;
//quoteAsmSearchForm.StartWithText = "";
quoteAsmAdapter.InvokeSearch(searchOptions);
if (quoteAsmAdapter.QuoteAsmSearchData.QuoteAsmSearch.Rows.Count > 0)
{
string quoteLine = quoteAsmAdapter.QuoteAsmSearchData.QuoteAsmSearch.Rows[0]["QuoteLine"].ToString();
string quoteAssemblySeq = quoteAsmAdapter.QuoteAsmSearchData.QuoteAsmSearch.Rows[0]["AssemblySeq"].ToString();
string quoteNum = quoteAsmAdapter.QuoteAsmSearchData.QuoteAsmSearch.Rows[0]["QuoteNum"].ToString();
}
}
maverick
(Nancy)
March 9, 2023, 9:41pm
11
Thanks, going to try it tomorrow.
Is there a decompiler/tool that you use to see the Epicor logic behind the Eng WrkBench → Get Details → Quote button?
klincecum
(Kevin Lincecum)
March 9, 2023, 9:57pm
12
I turned on customization mode so I could see what form it was calling, and traced from there.
I used DNSpy, but I don’t recommend it as it’s no longer in development, and there were
some hacks not long ago that put out bad downloads of it.
I don’t know what the best is now. @josecgomez ?
josecgomez
(Jose C Gomez)
March 9, 2023, 10:12pm
13
RedGate Reflector is “legit” and Professionally Maintained
Dot Peak is “free” (as in beer) and pretty good dotPeek: Free .NET Decompiler & Assembly Browser by JetBrains
I still like DNSpy (the revival) I even contributed to it a few months back to fix a Bug that prevented Debugging in IIS
1 Like
klincecum
(Kevin Lincecum)
March 9, 2023, 10:17pm
14
yep, I see you…
Introduce a workaround for a .NET 6.0 bug that occurred when a debugger was attached to a process that utilized dynamic modules. (by @josegomez)
josecgomez
(Jose C Gomez)
March 9, 2023, 10:29pm
15
LMAO how’d you find that so fast I couldn’t even find it haha
klincecum
(Kevin Lincecum)
March 9, 2023, 10:33pm
16
1, I have extremely good pattern matching skills.
I look at a page, and I see patterns, kind of like those freaks with photographic
memories, except I don’t retain it, nor read it that fast.
2, I went to the download page, and I’m on here so much, when I scrolled down
an immediate pattern stood out … “@josegomez ”
maverick
(Nancy)
March 21, 2023, 1:06pm
17
klincecum:
Here is how Epicor does your first question on the engineering workbench.
//references
//Erp.Adapters.QuoteAsm.dll
//Erp.Adapters.QuoteAsmSearch.dll
//Erp.Contracts.BO.QuoteAsm.dll
//Erp.Contracts.BO.QuoteAsmSearch.dll
using Erp.UI.Searches;
using Erp.Adapters;
private void epiButtonC1_Click(object sender, System.EventArgs args)
{
QuoteAsmSearchAdapter quoteAsmAdapter = new QuoteAsmSearchAdapter(this.oTrans);
string text = "AssemblySeq = 0";
text += " AND Template = 1 BY PartNum";
SearchOptions searchOptions = new SearchOptions(SearchMode.ShowDialog);
searchOptions.PrimaryTableName = "QuoteAsmSearch";
searchOptions.PreLoadSearchFilter = text;
searchOptions.DataSetMode = DataSetMode.RowsDataSet;
searchOptions.SelectMode = SelectMode.SingleSelect;
QuoteAsmSearchForm quoteAsmSearchForm = new QuoteAsmSearchForm();
quoteAsmSearchForm.BasicPanelWhoCalled = "Erp.UI.GetDetailsEntry";
quoteAsmAdapter.SearchForm = quoteAsmSearchForm;
//quoteAsmSearchForm.StartWithText = "";
quoteAsmAdapter.InvokeSearch(searchOptions);
Thank you - I found what you were referring to with DNSpy