Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Dealing With Product Bundles In Plugin

$
0
0

Hi

I have a plugin registered against opportunity product on create and on update. This works fine. However it errors if the user adds a bundle. So I have attempted to exit the plugin at the earliest opportunity if the product being added is a bundle. However I am now getting a general error saying

Try this action again. If the problem continues, check the Microsoft Dynamics 365 Community for solutions or contact your organization's Microsoft Dynamics 365

and the bundle is not saving. If I run the code through the debugger it looks to be returning as intended if the product is a bundle. Anyone know what is going on here?

Code snippet below.

                if (context.PostEntityImages.ContainsKey("PostImage"))
                {
                    postImage = (Entity)context.PostEntityImages["PostImage"];
                    product = postImage.GetAttributeValue<EntityReference>("productid");
                    if (product.Name.Contains("BUNDLE"))
                    {
                        return;
                    }

                }


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>