Oh No More Simple searching guys

I am working with a simple search to connect to the industry class bo. I have text field storing the id for the industry type. Im also trying to pass said type to the industry class simple search. When I select on the the search I get all of the records in the in search screen. no filter need to put something on the where clause but not sure here. When I select the record I need not getting the information stored in the correct ud fields. Let me know what I can do to get this working correctly.

here is my simple search code.

private void btnIndySearch_Click(object sender, System.EventArgs args)
{
		bool recSelected;
		string whereClause = string.Empty;	
		System.Data.DataSet dsIndClassCodeSearchAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "IndClassCodeSearchAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			
			System.Data.DataRow adapterRow = dsIndClassCodeSearchAdapter.Tables[0].Rows[0];

			// Map Search Fields to Application Fields
			EpiDataView edvUD02 = ((EpiDataView)(this.oTrans.EpiDataViews["UD02"]));
			System.Data.DataRow edvUD02Row = edvUD02.CurrentDataRow;
			if ((edvUD02Row != null))
			{
			//edvUD02Row.BeginEdit();
			//edvUD02Row["Character07"] = adapterRow["ICTypeID"];
			//edvUD02Row["Character08"] = adapterRow["Description"];
			edvUD02Row.BeginEdit();
			edvUD02Row["Character07"] = adapterRow["ICCode"];
			edvUD02Row["Character08"] = adapterRow["Description"];
			edvUD02Row.EndEdit();
			
			//edvUD02Row.EndEdit();
			}
		}

}

This should read something like
string whereClause = "ICTypeID = 'SomeValue'";

thanks Jason that got me on to the right path but I would like some value position be a filed in my current data set in the udtable called character06

Try this:
string whereClause = "ICTypeID = '" + (string)edvUD02.CurrentDataRow["Character06"] + "'"

thanks that worked flawlessly thanks again for support.

One Last questions im missing some as the information is not being pulled from search screen and putting it in the application.

here is where I think it is failing

if ((edvRow != null))
{
edvRow.BeginEdit();
edvRow[“Character07”] = “TEST1”;
//edvRow[“Character07”] = adapterRow[“ICCode”].ToString();
//edvRow[“Character08”] = adapterRow[“Description”].ToString();
edvRow.EndEdit();
}

is there a way to test my simple search adapter to pull in the correct data im using the search bo for the industry class and it is not putting the information in to the application as I have selected the record in the search here is my attached code and it does not like this code for some reason.

private void SearchOnIndClassCodeSearchAdapterShowDialog()
{
// Wizard Generated Search Method
// You will need to call this method from another method in custom code
// For example, [Form]_Load or [Button]_Click
EpiDataView edv1 = ((EpiDataView)(this.oTrans.EpiDataViews[“UD02”]));
bool recSelected;
string whereClause = “ICTypeID = '” + (string)edv1.CurrentDataRow[“Character06”] + “'”;
//string whereClause = string.Empty;
//MessageBox.Show(“Character06”);
//System.Data.DataSet dsIndClassCodeSearchAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, “IndustryClassAdapter”, out recSelected, true, whereClause);
System.Data.DataSet dsIndClassCodeSearchAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, “IndClassCodeSearchAdapter”, out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsIndClassCodeSearchAdapter.Tables[0].Rows[0];

		// Map Search Fields to Application Fields
		EpiDataView edvUD02 = ((EpiDataView)(this.oTrans.EpiDataViews["UD02"]));
		System.Data.DataRow edvUD02Row = edvUD02.CurrentDataRow;
		if ((edvUD02Row != null))
		{
			edvUD02Row.BeginEdit();
			edvUD02Row["Character07"] = adapterRow["ICCode"];
			edvUD02Row["Character08"] = adapterRow["Description"];
			edvUD02Row.EndEdit();
			MessageBox.Show("ICCode");
		}
	}
}

IndClassCodeSearchAdapter this is the adapter im using if I use the other business object im able to pull some of the data but not the record I need out of the other business object.

im open to other suggestions

What other data are you looking for?

Im looking for this information so I can add it to my ud table. not sure if that helps or not let me know

That data should be pulled across in the list lookup. What does this do if you place in your code above:

MessageBox.Show(adapterRow["ICCode"].ToString());

Also are there any errors being thrown now?

there currenlly does not have errors but when my search runs and I select the record It is not putting the information in the ud table columns. Or showing anything in the message box.

Are you talking about the MessageBox code I just posted? It shows up blank?

Also, you need to save your UD record. If you hit save after running your code, you are saying it doesnt populate? Personally, in this case, I dont think I’d use the Begin\EndEdit.

Why do you make two refs to your UD edv?

EpiDataView edv1 = ((EpiDataView)(this.oTrans.EpiDataViews[“UD02”]));
EpiDataView edvUD02 = ((EpiDataView)(this.oTrans.EpiDataViews["UD02"]));

noting is showing up in the message box in your code. It does not even show up after I have selected and clicked ok on my search box.

Just a typo I had when testing I have cleaned it up a and Im only reference it once now.

Nothing shows up in the box, or the box doesnt show?

sorry box does not show at all.

Do you have an edv named UD02 on your form? You can check in Object Explorer.

If you do, then it doesnt have a row. Perhaps you need to GetANewUD02()?

im not sure what you mean by need to get a newud02 dataset I have one currently that im trying to add records to maybe I need to update those fields.

I have the current data row in my code but the data is not populating in current data set. Also this is a sub search other than the one I have I have with ud02 here is screen shot of my entry screen. My issues is with the search on the bottom industry class search. my code is below the code for my search I can click on the search button and pulls up my information but when I click on the data I want It does not populate in the character filed I have listed.

private void SearchOnIndClassCodeSearchAdapterShowDialog()
{
	// Wizard Generated Search Method
	// You will need to call this method from another method in custom code
	// For example, [Form]_Load or [Button]_Click
	EpiDataView edvUD02 = ((EpiDataView)(this.oTrans.EpiDataViews["UD02"]));
	bool recSelected;
	string whereClause = "ICTypeID = '" + (string)edvUD02.CurrentDataRow["Character06"] + "'";
	System.Data.DataSet dsIndClassCodeSearchAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "IndClassCodeSearchAdapter", out recSelected, true, whereClause);
	if (recSelected)
	{
		System.Data.DataRow adapterRow = dsIndClassCodeSearchAdapter.Tables[0].Rows[0];

		// Map Search Fields to Application Fields
		System.Data.DataRow edvUD02Row = edvUD02.CurrentDataRow;
		if ((edvUD02Row != null))
		{
			edvUD02Row.BeginEdit();
			edvUD02Row["Character07"] = adapterRow["ICCode"];
			edvUD02Row["Character08"] = adapterRow["Description"];
			MessageBox.Show(adapterRow["ICCode"].ToString());
			edvUD02Row.EndEdit();
		}
	}
}