SerialMatching Adapter

Need a bit of help here. I am not able to see why the adapter is not returning any items. Here is the code along with the trace files. The good one is when I go into Serial Matching screen and click through. The idea is to do this all via code, process improvement task.

Here is my test function. I am just hard coding a ton of this to get it to work the first time.

The line that is not returning anything is
SMAdapter.ValidateAssembly(“014176-13-1”, intAssembly, out strOut1);

What am I missing to get my call from the function below to return an object vs. Epicor that is?

private void bntSerialMatch_Click(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **
	bool blnReturn = false;
	string strJob = string.Empty;
	int intAssembly = 0;
	string strSerialNum = string.Empty;
	string strPartNum = string.Empty;
	string strRevNum = string.Empty;
	string strOut1 = string.Empty;
	string strOut2 = string.Empty;
	
	string ipType = "mtl";

	SerialMatchingAdapter SMAdapter = new SerialMatchingAdapter(oTrans);
	SMAdapter.BOConnect();
		
	//blnReturn = SMAdapter.ChangeSerialNum(strSerialNum, strPartNum, strRevNum, strJob, intAssembly, out strOut1, out strOut2);
	blnReturn = SMAdapter.ChangeSerialNum("003-5332357", "003-533", "", "014176-13-1", 0, out strOut1, out strOut2);
	blnReturn = false;

	SerialMatchingDataSet SMData = SMAdapter.SerialMatchingData;
	SMData.SerialMatchHdr[0].RowMod = "U";


	SMAdapter.ValidateAssembly("014176-13-1", intAssembly, out strOut1);
	blnReturn = false;
			// Dispose of item
	SMAdapter.Dispose();
}

EpicorTraceNoReturn.xml (9.4 KB)
EpicorTraceGood.xml (18.1 KB)

any help? I am going to try the WCFService route. Just thought the adapter was the way epcior wanted us to go.

After a day of playing around. I feel like I am closer. Now When I call GetAvailableToMatch, I am only getting Items to match for the first SerialMatchMtl record.

Any trick I can try to get all of the AvailToMatch records for every SerialMatchMtl items to be returned?

private void msSerialMatchingTest()
{
//ready to submit
using ( SerialMatchingImpl SMsvc = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.SerialMatchingImpl>(FormFunctions.getILaunchSession(oTrans), Erp.Proxy.BO.SerialMatchingImpl.UriPath))
{
Erp.BO.SerialMatchingDataSet SMds = new Erp.BO.SerialMatchingDataSet();
System.String arg01 = (“003-5332357”);
System.String arg02 = (“003-533”);
System.String arg03 = ("");
System.String arg04 = (“014176-13-1”);
System.Int32 arg05 = (0);
System.String strOut1 = default(System.String);
System.String strOut2 = default(System.String);

		SMds = SMsvc.ChangeSerialNum(arg01, arg02, arg03, arg04, arg05, out strOut1, out strOut2);  
        strOut1 = ""; 

		SMsvc.ValidateAssembly(arg04, arg05, out strOut1, SMds);

		SMds.SerialMatchHdr[0].RowMod = "U";
		SMsvc.GetAvailableToMatch( "mtl", SMds);
		
		Erp.BO.SerialMatchingDataSet.AvailToMatchDataTable smavailable = SMds.AvailToMatch;
        
		foreach (Erp.BO.SerialMatchingDataSet.AvailToMatchRow row in smavailable.Rows)
        {
           if (row.SerialNumber == "A20216000374")
            {
                MessageBox.Show(row.PartNum);
            }
        }
		
		strOut1 = "";

	}
}
1 Like