Custom C# Code Need a Second set of eyes; Erp.Proxy.BO.SerialMatchingImpl

I am hitting a wall here. Thought maybe someone might be able to guide me.

I am creating a custom form to help folks in the manufacturing with serial matching. The new form have a grid and button. The grid returns a BAQ from the parent serialnumber to show all available items that could be matched. The user then selects the row and clicks a button to match the selected row to the parent serialnumber.

The code I have stops working when I am trying to call SMsvc.UpdateSMMtl(“J”);

The following error occurs:
Error: CS1501 - line 2502 (4297) - No overload for method ‘UpdateSMMtl’ takes 1 arguments

Anyone familiar with this BO? Any ideas to try? Please excuse the code it is still a bit rough around the edges.

private void  msProcessMatch()
	{
		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 = (system.SerialNumber);
			System.String arg02 = (arg01.Substring(0, 7));
			System.String arg03 = ("");
			System.String arg04 = (system.JobNumber);
			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 = ""; 
			
			if (SMds != null)
			{
				 
			    SMds.SerialMatchHdr[0].RowMod = "U";
				SMds.SerialMatchAsmbl[0].RowMod = "U";
				SMsvc.GetAvailableToMatch(("mtl"), SMds);

				Erp.BO.SerialMatchingDataSet.AvailToMatchDataTable smavailable = SMds.AvailToMatch;
				Erp.BO.SerialMatchingDataSet.SerialMatchMtlDataTable smMtl = SMds.SerialMatchMtl;								
								
				//test message to show count of items available to be matched
				//MessageBox.Show(smavailable.Count.ToString());
				
				// loop through each selected item in the grid
				foreach (UltraGridRow grdRow in grdAvailableToMatch.Rows)
				{
					if (grdRow.Selected == true)
					{
						string strGrdSerialNumber = grdRow.Cells["snParts_SerialNumber"].Value.ToString();
						string strGridPart =  grdRow.Cells["JobMtl1_PartNum"].Value.ToString();
						
						//MessageBox.Show(strGrdSerialNumber);
						//MessageBox.Show(strGridPart);
						// loop through each item available to be selected 
						foreach (Erp.BO.SerialMatchingDataSet.AvailToMatchRow arow in smavailable.Rows)
						{									
							if (arow.SerialNumber == strGrdSerialNumber && arow.PartNum == strGridPart)
							{
								MessageBox.Show("This Record Item should be Matched!!");
								arow.Matched = true;	
								arow.Selected = true;	
								 
								foreach (Erp.BO.SerialMatchingDataSet.SerialMatchMtlRow rowMtl in smMtl.Rows)
								{
									
									if (rowMtl.MtlPartNum == arow.PartNum && (!string.IsNullOrEmpty(rowMtl.MtlSerialNo.ToString())) )
									{
											rowMtl.MtlSerialNo = arow.SerialNumber;
											break;
									}
									
								}
								
								break;								
							}
						}
					}	
					
				}
				
				SMsvc.UpdateSMMtl("J");
				
				strOut1 = "";
			}
		}
	}
1 Like

Please look at the UpdateSMMtl method, you are only passing in 1 variable the “J”, and make sure that method doesn’t require more inputs. It would help to paste that method here also.

public void UpdateSMMtl(string ipMode, SerialMatchingDataSet ds)

You gotta pass it your dataset as well.

If I had to guess, you were looking at the code for the adapter not the BO. The adapter has a built in dataset so it takes care of that for you.

Thanks Chris. Where did you grab that code from?

I used ILSpy and looked in the file:
Erp.Contracts.BO.SerialMatching.dll

Namespace Erp.Proxy.BO -> SerialMatchingImpl

1 Like