Versions Compared

Key

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

...

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.IJiwaCustomFieldValuesIJiwaLineCustomFieldValues HostObjectHostItem, 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;
  }
}

...

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

ButtonClicked

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

...

This is used most typically to map an ID from a custom field contents to a display value - such as an InventoryID to a Part No and / or Description, for example:

Code Block
languagec#
public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
{
  // ReadData handler for a lookup custom field for an inventory item
  if (CustomField.PluginCustomField.Name == "MyCustomFieldName") 
  {
		if (CustomFieldValue.Contents.Trim().Length > 0) 
		{
			JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory inventoryItem = CustomField.Manager.EntityFactory.CreateEntity<JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory>();
			try
			{
				inventoryItem.ReadRecord(CustomFieldValue.Contents);
				CustomFieldValue.DisplayContents = String.Format("{0} - {1}", inventoryItem.PartNo, inventoryItem.Description);
			}
			catch(JiwaFinancials.Jiwa.JiwaApplication.Exceptions.RecordNotFoundException notFoundEx)
			{
				CustomFieldValue.DisplayContents = "";
			}
		}
		else
		{
			CustomFieldValue.DisplayContents = "";
		}
  }
}

ButtonClicked

Identical in nature to the ButtonClicked method of the CustomFieldPlugin class, typically used to react to a button click of the lookup button to the right of the custom field contents for Lookup type custom fields - usually to display a search window - for example:

Code Block
languagec#
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)
{
  // ButtonClicked handler for a lookup custom field for an inventory item
  if (CustomField.PluginCustomField.Name == "MyCustomFieldName") 
  {
		JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory inventoryItem = CustomField.Manager.EntityFactory.CreateEntity<JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory>();
		inventoryItem.Search(FormObject.Form, "", "");
		CustomFieldValue.Contents = inventoryItem.RecID;
		CustomFieldValue.DisplayContents = String.Format("{0} - {1}", inventoryItem.PartNo, inventoryItem.Description);
  }
}

SystemSettingPlugin class

Similar to the custom field classes, this class has methods used for the display and interaction with system settings.

ScheduledExecutionPlugin class

...