Page 1 of 1

Possible Bug in Inventory Import

PostPosted: Wed May 19, 2021 12:27 pm
by SBarnes
We have extended inventory import to include other columns, one of these extra columns include the word description in the aliases but with other text and the index is different, the code below sets the destination property, what we have found when this is run even though the mappings grid looks correct at the top of the screen, the style description is ending up in the product description, are aliases being done on an exact match or do they work on contains the text?


Code: Select all
             newDestinationProperty.RecID = "Inventory.Style.StyleDescription";
            newDestinationProperty.Caption = "Style Description";
            newDestinationProperty.SetterMethod = delegate (JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory, string value, string rowData, string[] row, int rowNo, JiwaFinancials.Jiwa.JiwaInventory.Import.Mapping mapping)
            {
                SetStyleInfo(inventoryImport, destinationPropertyCollection, ref inventory, value, rowData, row, rowNo, mapping, ref catsetter, ref stylesetter, "Inventory.Style.StyleDescription", "StyleDescription");
            };

            newDestinationProperty.Aliases = new String[] { "StyleDescription", "Style Description"};
            SetOrAddProperty(ref destinationPropertyCollection, newDestinationProperty);

Re: Possible Bug in Inventory Import

PostPosted: Thu May 20, 2021 9:49 am
by Scott.Pearce
Please provide me with a full plugin and a sample import file for demo data and I'll debug - that will the be the quickest way to see whats going on.

Re: Possible Bug in Inventory Import  Topic is solved

PostPosted: Thu May 20, 2021 10:01 am
by SBarnes
Hi Scott

The plugin has a fair bit of code in it including extra tables and stored procedures that would make it fairly complex to set up but I have been able to solve the problem by changing the code given previously to the below where basically any use of description is replaced with the word definition, which would lead me to believe that some how the standard code is doing partial matches and that was the problem, I am just wondering if creating a plugin with a custom field with the word description in it my let you see if the issue is a bug, otherwise I don't want to waste your time given the issue is resolved for the client.


Code: Select all
 newDestinationProperty = destinationPropertyCollection.Manager.CollectionItemFactory.CreateCollectionItem<JiwaFinancials.Jiwa.JiwaInventory.Import.DestinationProperty>();
           
         newDestinationProperty.RecID = "Inventory.Style.StyleDefinition";
            newDestinationProperty.Caption = "Style Definition";
            newDestinationProperty.SetterMethod = delegate (JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory, string value, string rowData, string[] row, int rowNo, JiwaFinancials.Jiwa.JiwaInventory.Import.Mapping mapping)
            {
                SetStyleInfo(inventoryImport, destinationPropertyCollection, ref inventory, value, rowData, row, rowNo, mapping, ref catsetter, ref stylesetter, "Inventory.Style.StyleDefinition", "StyleDefinition");
            };

            newDestinationProperty.Aliases = new String[] { "StyleDefinition", "Style Definition"};
            SetOrAddProperty(ref destinationPropertyCollection, newDestinationProperty);