(why does nobody tell us the version?)
Because if there's a latest version (and there's always a latest version) why mention it? I'd assume your own dev environment would be patched to the latest. If it's me who's writing a plugin for an older version and ask I question via these forums, I'll mention the version as it's more relevant.
provide a sample plugin which exhibits the problem (another thing nobody seems to do!)
Because often the plugin contain client-identifying information or other confidential information and to strip out that irrelevant code is just more trouble than it's worth and wouldn't contribute to the question in point.
But seeing as you've asked, this is my ButtonClicked code (the relevant bit!). Still not sure why my code is getting a null for CustomFieldValue but I'll replace the code below with yours.
- Code: Select all
public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
{
if (CustomField.PluginCustomField.Name == "Extra1")
{
var search = FormObject.Manager.Search;
search.Clear();
search.CurrentOption = 1;
JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.clsSearch.SearchModes searchMode = JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.clsSearch.SearchModes.jswInventory;
search.SetDefaultSearch(ref searchMode);
search.UsePinBoard = false;
if (search.Show(FormObject.Form) == System.Windows.Forms.DialogResult.OK)
{
if (search.Results.Count > 0)
{
var idField = (JiwaFinancials.Jiwa.JiwaApplication.JiwaSearch.Field)search.get_Fields(2);
//MessageBox.Show(idField.FieldValue.ToString());
//System.Diagnostics.Debugger.Launch();
CustomFieldValue.Contents = idField.FieldValue.ToString();
//CustomFieldValue.DisplayContents = string.Format("{0}", idField.FieldValue.ToString());
}
else
{
throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();
}
}
else
{
throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();
}
}
}