Possible Bug in Inventory Import  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Possible Bug in Inventory Import

Postby SBarnes » Wed May 19, 2021 12:27 pm

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);
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Possible Bug in Inventory Import

Postby Scott.Pearce » Thu May 20, 2021 9:49 am

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Possible Bug in Inventory Import  Topic is solved

Postby SBarnes » Thu May 20, 2021 10:01 am

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);
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests