Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Is this a bug? writing price of product to custom entity

Posted on by 112

I have a need to do something very simple:  use a calculated field to read the retail price ("price") of a product and multiply is by a percentage.

So I've set up the N:1 relationship between my custom entity and the product entity, selected the required product and now I'm working on a calculated field to take the product price from the list price of the product, multiply it by 0.9 and display it in a field.

Everything I have read says that if I use this "new_membershiplevel.price * 0.5" in the calculated field then the list price of the product will be multiplied by 50% and the value placed in this currency field.

I can't see any errors anywhere and this is something I have done successfully before, so is this a bug, or have I made a mistake?

Thanks,

Simon7357.Window.png

*This post is locked for comments

  • Suggested answer
    Nettsales Profile Picture
    Nettsales 112 on at
    RE: Is this a bug? writing price of product to custom entity

    I'm ebarassed to say I've found the answer to this issue!  In case anyone else hits the same issue, the problem was that I didn't have the currency field on the form.  As it is a custom entity, the currency field is not added by default and it appears that for any calcuation to work on a currency type field, the currency needs to be set.  Which makes sense, I guess.

  • Nettsales Profile Picture
    Nettsales 112 on at
    RE: Is this a bug? writing price of product to custom entity

    Ahhh sorry - probably a good idea!  

    Problem is that there is nothing coming through into the calculated field in the custom entity.  This is regardless of whether I just push the contents of the "list price" field or put a calculation on it.

    I need to use the list price as this is being updated from the Sage accounts system, so price lists are not really an option.

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: Is this a bug? writing price of product to custom entity

    I think it's more conventional to use a price list to execute this strategy but, what is the problem?  You've shown the configuration but not mentioned what's wrong.

    ps- on the SDK side, such an operation would require one to execute currency.Value (money to decimal) before doing any math and then converting it back: new Money(price.Value*0.5)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans