Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You should also change the Author name to your own name when you copy a plugin.

Use XML Export / Import

Use the XML Export and XML Import function of the Utilities tab of the Plugin Maintenance form to transport plugins.

Name

The plugin name should be concise and convey some meaning as to what the purpose of the plugin is.

...

Code Block
languagec#
public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
{
  // FormatCell handler for a combo custom field
  if (CustomField.PluginCustomField.Name == "MyCustomFieldName") 
  {
		var typeCell = new FarPoint.Win.Spread.CellType.ComboBoxCellType();			
		typeCell.Items = new string[] { "Option 1", "Option 2", "Option 3"};
		typeCell.ItemData = new string[] { "1", "2", "3"};
		typeCell.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;                  
		GridObject.ActiveSheet.Cells[Row, GridObject.ActiveSheet.GetColumnFromTag(null, "Contents"").Index].CellType = typeCell;
  }
}

...

LineCustomFieldPlugin class

Much like the CustomFieldPlugin class, the LineCustomFieldPlugin class is used for the display and interaction with custom fields - but for custom fields on lines (grids) - such as sales order lines. It uses the following methods:

FormatCell

This is used to format the Spread grid cell of the custom field contents. Often used for setting combo-box items, for example:

Code Block
languagec#
public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
{
  // FormatCell handler for a combo custom field
  if (CustomField.PluginCustomField.Name == "MyCustomFieldName") 
  {
		var typeCell = new FarPoint.Win.Spread.CellType.ComboBoxCellType();			
		typeCell.Items = new string[] { "Option 1", "Option 2", "Option 3"};
		typeCell.ItemData = new string[] { "1", "2", "3"};
		typeCell.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;                  
		GridObject.ActiveSheet.Cells[Row, GridObject.ActiveSheet.GetColumnFromTag(null, CustomField.PluginCustomField.GridColumnName).Index].CellType = typeCell;
  }
}

Note that the only difference between the FormatCell of the LineCustomFieldPlugin class and the FormatCell if the CustomFieldPlugin class is the column tag is CustomField.PluginCustomField.GridColumnName instead of “Contents”.

ReadData

Identical in nature to the ReadData method of the CustomFieldPlugin class.

ButtonClicked

Identical in nature to the ButtonClicked method of the CustomFieldPlugin class.

SystemSettingPlugin class

...