Is it my code or the Adapter failing here?

You need to modify this a bit to match what you did but it will return the correct results and you can note the differences

            bool more;
            JobPartAdapter jpAdapter = new JobPartAdapter(oTrans);
            jpAdapter.BOConnect();
            SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
			opts.DataSetMode = DataSetMode.RowsDataSet;
            opts.PageSize = 20; //return this many
            string where = "jobnum = '2000003-1-1'"; 
            opts.NamedSearch.WhereClauses.Add("JobPart",where);
			opts.PageSize = 0;
			opts.AbsolutePage = 1;
			var jobs = jpAdapter.GetRows(opts, out more);
1 Like

I think its the name of the HashTable is screwing you.

1 Like

Thanks - I think Jose is right about the HashTable name - I suppose I’ve been very lucky up to this point with them so far.

I made a change based off of Dan’s suggestion - changed Job to JobPart for the hash name. Bingo!

Thanks to all - any other thoughts on that BL Tester issue? I’d love to get it working on my PC.

Well JobPart moves the search to the JobPart (JobProd) table… So you may want to change it to JobHead
According to this other post the name of the Hash is indeed JobHead

JobHead did not work.

Oh wait, I didn’t even notice you were using the JobPartAdapter I thought it was JobEntryAdapter LoL… Carry on

1 Like

I’ll forgive you if you can find where I can reference:
JobPartDataSet

Should be Erp.BO but it’s not working.

  • NM - Erp.Contracts.BO.JobPart.dll

You need Erp.Contracts.BO.JobPart.dll

Haha you’re getting slow in your old age :smile:

Here is the final modified code for anyone interested. I’ll mark it as solution but it was @josecgomez @danbedwards that get the credit

        public JobPartDataSet GetJob(string jobNum)
        {
            bool more;
            JobPartAdapter jpAdapter = new JobPartAdapter(oTrans);
            jpAdapter.BOConnect();
            SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
            opts.DataSetMode = DataSetMode.RowsDataSet;

            opts.PageSize = 20; //return this many
            string where = string.Format("JobNum = '{0}'", jobNum); 
            opts.NamedSearch.WhereClauses.Add("JobPart", where);
            JobPartDataSet trans = (JobPartDataSet)jpAdapter.GetRows(opts, out more);
            jpAdapter.Dispose();
            return trans;
  
        }

I’m about at this point now! I’m trying for the first time to run the BL Tester from my desktop after copying the BL Tester folder to my system, and I’m getting the same error as above. Anyone have any luck resolving this?

Sorry, I should have clarified that the error I’m getting is the SSPI error. I can run it from the server, just not from my desktop.

Add a windows credential to the machine you are working from for the server

So this leaves my wondering, what is the best way to determine what the Hash table name for the whereClause search options should be?
I am struggling to get the whereClause to apply with a Corrective Action search.
I have tried DMRCorAction, CorrectiveAction, but every time it runs it returns all records and when I run a trace it does not show any whereClause set.

How about DMRCorAct and DMRCorActAttch?

Chris, yes tried those as well (actually I had tried DMRCorAct first as it was the table name). I tried CorrectiveAction as it was the adapter prefix. Both do not seem to be applying any filter as all rows are being returned.

What does your code look like? Are you referencing the parameter(s) below?

    <parameter name="whereClauseDMRCorAct" type="System.String"><![CDATA[ BY ActionID]]></parameter>
    <parameter name="whereClauseDMRCorActAttch" type="System.String"><![CDATA[]]></parameter>

@danbedwards thanks, I tried using the parameter name as well, that didn’t work, first 20 rows still return. Here is my code snippet, everything works except I don’t get the ActionID I am setting no where in the list.

CorrectiveActionAdapter adapterCorAct = new CorrectiveActionAdapter(this.oTrans);
adapterCorAct.BOConnect();

// Set whereClause
SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
String whereCls = "ActionID = '" + ActionID + "'";
opts.NamedSearch.WhereClauses.Add("whereClauseDMRCorAct", whereCls);
opts.PageSize = 20; //return this many rows
var x = true;

// Querying Corrective Action by Action ID (GetList)
grdCorAct.DataSource = adapterCorAct.GetList(opts, out x);

adapterCorAct.Dispose();

Thanks!

1 hour of decomp:
opts.NamedSearch.WhereClauses.Add( “BaseList”, whereCls);

2 Likes

Thanks @Chris_Conn that was it. Unbelievable, I would not have tried that in a million years! Any idea if BaseList is like a default or something? Or is a decompile needed to be sure? Why isn’t there any consistency?
I have another search adapter I’ve been struggling with too for Projects I’m going to try ‘BaseList’ on that too.

1 Like