My problem is when doing
- Code: Select all
CustomFieldValue.Contents = MyValue
Shouldn't that be passed in as a parameter to the ButtonClicked event in the plugin?
Is there another way I can get CustomFieldValue to set the contents?
CustomFieldValue.Contents = MyValue

(why does nobody tell us the version?)
provide a sample plugin which exhibits the problem (another thing nobody seems to do!)
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();
}
}
}
DannyC wrote: to strip out that irrelevant code is just more trouble than it's worth

- Code: Select all
CustomFieldValue.Contents = MyValue
- 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();
}
}
}


I don't see the line you said is giving the error:
CustomFieldValue.Contents = idField.FieldValue.ToString();CustomFieldValue.Contents = MyValue;
If you still can't work it out, then provide a sample plugin which exhibits the problem

- Code: Select all
CustomFieldValue.Contents = idField.FieldValue.ToString();

the least you can do now is reciprocate and provide a plugin which demonstrates the problem

Return to Technical and or Programming
Users browsing this forum: No registered users and 3 guests