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

Need to perform rollup on fields within same entity (not supported) to calculate MTD sales for a user

$
0
0

We have an entity called Sales Orders where we track details of every Sales Order placed, including Net Product Profit, Net Service Profit, Date of Sale, and the Sales Rep's name.

I need to create a process that in any given calendar month populates a field in Sales Order with the month-to-date (MTD) Net Profit for the selected Sales Rep (lookup in the form).  For example, if Sales Rep A made these sales:

DateSales RepNet Product ProfitNet Service ProfitMTD Net Profit - Sales Rep A
1/1/16A$100$0$100
1/5/16A$50$100$250
1/7/16A

$0

$10$260
1/7/16B

$25

$0

$260

2/1/16A

$5

$25

$30

2/1/16B

$10

$15$30

Then field for Sales Rep A's MTD sales on 1/7/16 would contain the result $260, etc.

There would not be more than 2 reps, and their MTD net profit is tracked separately, from the input of net product profit and net service profit on each Sales Order.

I initially tried to do this with a Rollup until I realized that it cannot be run against fields in the same entity - only related entities.

I considered creating a separate entity just to track this, which the rollup could run against, but that seems like a very inefficient way to solve this problem and I think I'm probably missing an obvious solution, and need some fresh perspective.  

Maybe an asynch workflow?

I would like to try and do this with the OOB tools that CRM 2016 has provided - Rollups, Workflow, Calculations, Business Rules, etc.  My JS abilities are also limited so all the more reason to use OOB tools.

And of course, it has to be done in a supported method.  As a user of CRM since v3.0, I've had to suffer through a few painful upgrades where I had to rip out a lot of unsupported code. Going forward I want to try and do things in a manner that will make future upgrades easier.

Thank you in advance for any input.


Viewing all articles
Browse latest Browse all 46379

Trending Articles



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