I have a company and a plant and I need to get the default warehouse for that plant. What Method or adapter can I use to get this? I’ve already tried this…
private string GetSiteDefaultWhse(string sSite, string sCompany)
{
// Wizard Generated Search Method
// You will need to call this method from another method in custom code
// For example, [Form]_Load or [Button]_Click
bool recSelected;
string whereClause = string.Format("Company = '{0}' AND Plant = '{1}'", sCompany, sSite);
System.Data.DataSet dsPlantConfCtrlAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "PlantConfCtrlAdapter", out recSelected, false, whereClause);
//we found a record
if (recSelected)
{
System.Data.DataRow adapterRow = dsPlantConfCtrlAdapter.Tables[0].Rows[0];
return String.Empty;
}
return String.Empty;
}
//we found a record
if (recSelected)
{
System.Data.DataRow adapterRow = dsPlantConfCtrlAdapter.Tables[0].Rows[0];
**return adapterRow["DefaultWhse"].ToString();**
}
return String.Empty;
You need to switch to a RowsDataSet GetList() doesn’t include all the columns.
Here’s an example (not using the same adpter) but the syntax is what you need
Yeah so the listLookup gets the most essential columns. Rows lookup gets you all of them. You could switch to what Jose gave you it will work, another option is to use GetRows Method.