There is a static (shared in VB) method of the JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValueCollection class called ReadCustomFieldValue.
You can use that to get the contents of any custom field.
It's overloaded, so there are three signatures:
- Code: Select all
Public Shared Function ReadCustomFieldValue(Manager As JiwaApplication.Manager, ValuesTableName As String, ValuesFKIDColumnName As String, ValuesSettingIDColumnName As String, IDColumnName As String, TableName As String, ID As String, SettingName As String) As String
And
- Code: Select all
Public Shared Function ReadCustomFieldValue(Manager As JiwaApplication.Manager, CustomFieldModuleName As String, ID As String, SettingName As String) As String
And
- Code: Select all
Public Shared Function ReadCustomFieldValue(Manager As JiwaApplication.Manager, ValuesTableName As String, KeyField As String, ID As String, SettingName As String) As String
Here's an example pulled from a working plugin to read a debtor custom field value:
- Code: Select all
string caseRatePart = JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValueCollection.ReadCustomFieldValue(salesOrder.Manager, "Debtor Maintenance", salesOrder.Debtor.DebtorID, "CaseRatePart");
It's using the signature of the 2nd method to get a debtor custom field value (the one I prefer to use). The 2nd parameter is the CustomFieldModule name, which comes from the SY_PluginCustomSettingModules table - in your case that would be "Inventory Category 1". The 3rd parameter is the debtor ID - you want that to be the ID of the IN_Category1 associated with the sales order line item. The 4th param is the custom field name.