Page 1 of 1

Upgrading and Mapping Jiwa 6 Custom Field In Jiwa 7

PostPosted: Thu Sep 21, 2017 5:00 pm
by nsbandara
Hi,

We recently did a Jiwa6 database upgrade to Jiwa 7.0.175. In Jiwa6 for Debtors we had custom field for delivery day where user set a weekday from a drop down list.

Code: Select all
GridObject.Col = Col 
  GridObject.Row = Row 
  GridObject.TypeComboBoxList = "None" & vbtab & "Monday" & vbtab & "Tuesday" & vbtab & "Wednesday" & vbtab & "Thursday" & vbtab & "Friday"  & vbtab & "Saturday"  & vbtab & "Sunday" & vbtab & "Daily"
  End Sub


After migration we created same custom field in Jiwa7 and implemented drop down.

Code: Select all
#region "CustomFieldPlugin"
public class CustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldPlugin
{
    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    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)
    {
        if (CustomField.PluginCustomField.Name.Equals(CustomFieldsFromV6.Debtor_DeliveryDay))
        {
            FarPoint.Win.Spread.CellType.ComboBoxCellType salesChannelEditor = GridObject.ActiveSheet.Cells[Row, Col].CellType as FarPoint.Win.Spread.CellType.ComboBoxCellType;
            salesChannelEditor.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;
            salesChannelEditor.ItemData = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8" };
            salesChannelEditor.Items = new string[] { "None", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Daily" };
        }
    }


Issue we are facing is, since we created new custom field, we have to re-assign custom field values using sql script. Is there better approach to do this that would match custom field data automatically ?

Thanks.

Re: Upgrading and Mapping Jiwa 6 Custom Field In Jiwa 7  Topic is solved

PostPosted: Thu Sep 21, 2017 6:38 pm
by Mike.Sheen
nsbandara wrote:Issue we are facing is, since we created new custom field, we have to re-assign custom field values using sql script. Is there better approach to do this that would match custom field data automatically ?


There is another way - I'm not sure If it would be better or worse for your scenario!

When the version 6 database is upgraded to version 7, all the custom fields are attached to a plugin named "Legacy Pre-Version 7 Plugin".

What you should do is open this plugin in plugin maintenance, and on the custom fields tab press the Move button on the fields grid for each field you wish to move to another plugin. That will move the field to the new plugin, and keep the values intact.

You'll need to follow these steps in order:

1. Upgrade database to Version 7 (you obviously already have done this)
2. Create the new plugin (but don't define your custom fields you want to move)
3. Edit the Legacy Pre-Version 7 Plugin plugin and Move the custom fields to the plugin created in step 2.

Mike