Page 1 of 1

Jiwa 7.0.186 Inventory Category Lookup Custom Field

PostPosted: Sat Sep 23, 2017 2:10 am
by nsbandara
Hi,

I'm working on a plugin for Jiwa 7.0.186 that require lookup custom field for inventory category. Before executing custom field button click event Jiwa throws an error (screen snap attached). Is this a known bug in Jiwa 7.0.186 ?

Re: Jiwa 7.0.186 Inventory Category Lookup Custom Field

PostPosted: Sat Sep 23, 2017 12:46 pm
by Mike.Sheen
It works ok for me in 7.0.187 - and I've looked at the changes made since 7.0.186 and cannot see any changes related to this aspect of the software.

To test this, I created a new plugin and on the custom fields tab of plugin maintenance added a custom field of type lookup to the Inventory Category 1.

Then in my, code I added a messagebox display to the ButtonClicked method of the LineCustomFieldPlugin class:

Code: Select all
#region "LineCustomFieldPlugin"
public class LineCustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldPlugin
{
    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.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    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)
    {
    }

    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)
    {
      System.Windows.Forms.MessageBox.Show("test", "test");
    }
}
#endregion


When I load the Inventory Category 1 list maintenance form, the column displays and when I click the button to the right of the custom field the messagebox displays as expected.

Maybe there is there something inside your ButtonClicked code causing this.

If you put the following line as the first line of the ButtonClicked method, you'll be able to debug the code:
Code: Select all
System.Diagnostics.Debugger.Launch();


Mike

Re: Jiwa 7.0.186 Inventory Category Lookup Custom Field

PostPosted: Sun Sep 24, 2017 3:53 pm
by nsbandara
I retested the plugin and and it seems button click code execution failing only for few rows. For category 1 custom field, error appear for rows 2, 4, 5. For category 2 error appear for row 1, 2, 5 .... It seems plugin code execution fails in a random pattern for each category.

I've attached custom field plugin and screen snap taken while testing lookup custom field for category 1.

Re: Jiwa 7.0.186 Inventory Category Lookup Custom Field  Topic is solved

PostPosted: Sun Sep 24, 2017 4:38 pm
by Mike.Sheen
Thanks for the detailed steps to reproduce!

Confirmed this a bug: DEV-6269 - Fixed now in 7.00.188.00 which will be out in a day or two.

The problem cause (as detailed in DEV-6269) is categories where the ID has trailing spaces. Demo data has some categories which have trailing spaces because they were created 22 years ago - it's possible some customer databases may have the issue also, but I think it would be unlikely.

Anyway, it's now fixed.

Mike