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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom Pricing and Product Bundles

(0) ShareShare
ReportReport
Posted on by 50

Up until now we haven't used product bundles, as we found the (now deprecated) kit functionality did what we needed.

However because of some changes to our commercial offer, and the future deprecation of kits, we are investigating moving across to using the Product Bundle functionality.

Unfortunately we have done some significant customisation around sales entities and have implemented a custom CalculatePrice plugin.

I have been doing an experiment with a simple bundle containing two required products and one optional product. Although we are still seeing Dynamics add all the bundle products to the invoice when we add the bundle, we aren't seeing the correct pricing behaviour.

The CalculatePrice plugin is being fired for invoice and for the invoicedetail  that contains the bundle, but not for the sub lines added as part of the bundle. So although the unit price field is filling correctly based on default behaviour, our custom extended price field is not getting touched, and in fact for each bundle item is getting the extended price value from the bundle itself.

Looking in detail at the invoicedetails that have been created I can see that the lines for the sub-products have the correct producttypecode, and a parentbundleid - so in theory we could work out the correct behaviour if only the platform fired the custom pricing plugin for those lines.

At the moment the only thing I can think of is to somehow fire another whole-invoice recalculate after all the products are added and do a forced iteration over all the line items

Anyone else come across this issue?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    JE-14021252-0 Profile Picture
    50 on at
    RE: Custom Pricing and Product Bundles

    So this is how...

    The solution was to add another plugin, registered synchronous, post-create of invoicedetail that checks if the invoice line is a bundle sub-product (check producttypecode), and if so delegates to our existing custom pricing logic (which luckily was already abstracted out of the CustomPricing plugin to a service class

  • JE-14021252-0 Profile Picture
    50 on at
    RE: Custom Pricing and Product Bundles

    Custom pricing is firing, but only on the invoice line that represents the bundle. The invoice lines that the platform creates when it expands the bundle don't fire the custom pricing message.

    So with a bundle that has two required products and one optional I see the following messages when I add the bundle to an invoice::

    CalculatePrice fires 3 times on the invoice itself - no idea why

    Then a couple of actions that are called by my client-side code on the invoice product

    When I save the invoice product  Ithen get the following:

    Create called 4 times, once for each of the invoice lines (bundle + 3 products in the bundle)

    CalculatePrice called for the bundle line

    Then Update and CalculatePrice again on the bundle line because the custom logic tweaks it slightly.

  • Flydancer Profile Picture
    1,332 on at
    RE: Custom Pricing and Product Bundles

    Did you deactivate the OOB Pricing Calculation in your System Settings? Otherwise it won't fire your custom pricing plugin

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans