Curses - Foiled Again - CustShip Adapter WhereClause Issues in 2022.1.8

“Upgraded” to 2022.1.8 over the weekend from 10.2.500.9. Mostly went as expected with the lack of testing by the day to day users.
Any way, the problem that has me banging my head on my desk currently is an error calling the CustShip adapter. Code that worked in 10.2.500.9 is now returning an error that I can’t seem to get past :frowning:
Error: Exception caught in: Erp.Adapters.CustShip

Error Detail

Message: Number of parameters specified does not match the expected number.
Program: Erp.Adapters.CustShip.dll
Method: OnGetRows

Code:

string whereClause = "ShipDate = " + dteDateShipped.Text + " AND Voided = No";
		bool morePages;
		SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
		opts.NamedSearch.WhereClauses.Add("ShipHead", whereClause);
		CustShipAdapter adapterCustShip = new CustShipAdapter(UD40Form);
		adapterCustShip.BOConnect();
		DataSet ds = adapterCustShip.GetRows(opts, out morePages);

Does anyone have any clues on how to get the “GetRows” working in Kinetic 2022.1 ?

Thats a big jump.
You can try to rebuild part of the UD form Customization with the Wizard and see if there are any obvious differences.

I used the BPM Workflow Designer to pull in a BO method widget. I loaded in CustShip.GetRows, and looked at the parameter list. See below.

1 Like

In 10.2 it had 19 where clauses (and I only needed to provide the first one)
in 2022.1 it now has 20 where clauses. I have tried using just the first one and adding the other 19 as empty strings and neither way works

Both outputs need variables created, and each string needs to be a ‘’ blank string except for the one you want to use. the Integers don’t need anything if I recall correctly.

I was just working on something similar in 2021.1.25 - so maybe it’s the same.

2 Likes

It’s a bug in the adapter.

In Pre-Kinetic world, here is the list of whereClauses:

ShipHead
ShipHeadAttch
CartonTrkDtl
ShipDtl
ShipDtlAttch
ShipCOO
ShipDtlPackaging
ShipDtlTax
ShipMisc
ReplicatedPacks
ShipUPS
LegalNumberGenerate
LegalNumGenOpts
SalesKitCompIssue
SelectedIDNumbers
SelectedSerialNumbers
ShipTaxSum
SNFormat

A total of 18

The logic in OnGetRows is there has to be 18 whereClauses or it throws the error you see. This list is automatically generated and what you put in is “merged”.

In Kinetic world, here is the list of the whereClauses:

ShipHead
ShipHeadAttch
CartonTrkDtl
ShipDtl
ShipDtlAttch
ShipCOO
ShipDtlPackaging
ShipDtlTax
ShipHeadInsurance [+]
ShipMisc
ReplicatedPacks
ShipHeadTrailer [+]
ShipUPS
LegalNumberGenerate
LegalNumGenOpts
SalesKitCompIssue
SelectedIDNumbers
SelectedSerialNumbers
ShipTaxSum
SNFormat

A total of 20

The logic in OnGetRows is there has to be 19 whereClauses or it throws the error you see. This list is automatically generated and what you put in is “merged”.

There is no way you can call GetRows on this adapter because the logic in the DLL will never work. It should be testing in the OnGetRows that there has to be 20 whereClauses.

The truly maddening thing is, it works in the BLTester.

How am I supposed to get Support involved to fix this as a mere mortal?

@bw2868bond, I would create a ticket for the Ice Tools module with the Customization category and reference case CS0003217938. I submitted the details.

I would just tell them that no matter what you do, you cannot get the GetRows adapter method to work in your customization. It is a bug in their Erp.Adapters.CustShip.dll

The BL-Tester uses the Erp.Contracts.CustShip.BO.dll which the Adapter calls after it “passes” the whereClauses length test. Just changing that number to 20 will solve everything…

UPDATE: It got assigned a problem number: PRB0250521

2 Likes

I created a case and got added to the Problem Number.

with no ETA on fixing, I spent all day muddling through creating a web application to do the task as the REST service GetRows works.
Many thanks to all who have worked on the EpicorRest helper!!!

On my dev box, I was able to edit the DLL and change the test to 20. It works perfectly. It’s a simple fix, hopefully they will get it in .10?

Glad you got the REST service working.