web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Dealing With Product Bundles In Plugin

(0) ShareShare
ReportReport
Posted on by 129

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;
                    }

                }

I have the same question (0)
  • Verified answer
    jonfarmer4999 Profile Picture
    129 on at

    Just found I need to throw an InvalidPluginExecutionException instead of returning. Bundle adds without  error now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans