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

Discussions relating to plugin development, and the Jiwa API.

Upgrading and Mapping Jiwa 6 Custom Field In Jiwa 7

Postby nsbandara » Thu Sep 21, 2017 5:00 pm

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.
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

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

Postby Mike.Sheen » Thu Sep 21, 2017 6:38 pm

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
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron