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 :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by 20

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

I have the same question (0)
  • Martin Donnelly Profile Picture
    1,030 on at

    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)

  • Nettsales Profile Picture
    20 on at

    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.

  • Suggested answer
    Nettsales Profile Picture
    20 on at

    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.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans