Developer forum

Forum » Development » Problem renaming BOM-product

Problem renaming BOM-product


Reply
Hi,

I'm making a custom module where i need to set a new name on a BOM-group.

In this snippet it should only set the name of the BOM-group with the ID "GROUP23", but when the code is executed, it also overwrites all other BOM-Groups of that product.

             foreach (ProductItem bom in p.Items) {

                if (bom.BomGroupID.Equals("GROUP23"))
                 {

                        string oldName = bom.Name;

                        bom.Name = oldName + "213";

                        bom.Save();

                }
            }

For an example: Before the code is executed, we have 3 BOMGroups called: "one", "two", and "three" with seperate ID's. After the code is executed we now have 3 BOM-groups called: "one123", "one" and "one" - all with the same ID's and content.

Is this a known error?

I hope it is understandable and that someone can help :-)
 
 

Replies

 
Reply
Hi Emil!

Thank you for your message, we will fix it.
Until we are fixing it, use the second Save method:
for your example: bom.Save (bom.ProductID,bom.ID,"","");

Best regards,
Vladimir
 
Reply
Thanks for your reply :-)

I'll try the other solution.

Do we have en ETA on the fix?


 
Reply
Hi again,

I have tried the other save-method and i get the same error!

How quickly can You adress this error, as we need to use this feature asap.

Thank for your help :-)!
 
Reply
Hi Emil!
I very very carefully checked the work of save methods with parameters - bom.Save(bom.ProductID,bom.ID,"",bom.BomGroupID), but cant repeat  the described error.
Please check that your bin folder contains an updated module dll, with corrected code and, if it possible, show me full code of custom module(may be another influencing factor is exist..).

I think, the fix will in nearest release.

Best regards,
Vladimir

 

You must be logged in to post in the forum