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)

Custom Goal / Target on Chart

(0) ShareShare
ReportReport
Posted on by 2,909

Hi,

Struggling here I need to try and create targets / goals based on monthly targets for each Account on a count of Opportunity Products targeting the Model (Segment) attribute of which there are 12. 

Account A has targets of Products grouped by Model (Segment) type

Products (Model 0-40) target 3 units

Products (Model 40-60) target 2 units

…………...

I created the relationships below and have no issue showing a chart of all related Opportunity Products grouped by model on the Account form.

I also created the custom goals entity as shown below however can't see clearly how I can get this as a line on my existing chart mimicking the OOB Goals.

I have attempted creating some OOB rollup queries without success.

I can get the values into a fetchxml query but at a loss, although thinking about count distinct.

5633.Capture5.JPG

Here is the fetch I can get where I can get Segment and related Goal / Target

7608.Capture6.JPG

The FetchXML

<fetch>
  <entity name="opportunityproduct" >
    <attribute name="new_accountid" />
    <attribute name="productid" />
    <attribute name="extendedamount" />
    <attribute name="baseamount" />
    <link-entity name="new_goal" from="new_account" to="new_accountid" link-type="inner" alias="Goal" >
      <attribute name="new_model" />
      <attribute name="new_goal" />
      <attribute name="new_account" />
    </link-entity>
    <link-entity name="account" from="accountid" to="new_accountid" alias="accountOp" />
  </entity>
</fetch>


Any ideas?

*This post is locked for comments

I have the same question (0)
  • Dynamics365 Rocker Profile Picture
    7,755 on at

    Do you want to create OOB chart and want to display in dashboard?

  • antc Profile Picture
    2,909 on at

    Yes would like to display on Dashboard and on Account form.

    I believe I can create with OOB chart as I need to edit XML to get the Goals / Target into the FetchXML.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    First create OOB then update it's XML as per your need.

  • antc Profile Picture
    2,909 on at

    I have been trying to create the fetchxml and import but keep getting errors.

    the logic has been to:

    count Opportunity Product quanity

    avg Custom Goal entity goal(int)

    groupby model 

    I'm wondering however if my design is flawed and if there is a better way to achieve this outcome.

    Here is a different concept view if anyone has any ideas.

    3034610.Capture.PNG

  • Dynamics365 Rocker Profile Picture
    7,755 on at

    Do you have XRM toolbox, If yes then copy paste your below script there and check if it is giving required output.

    <fetch>

     <entity name="opportunityproduct" >

       <attribute name="new_accountid" />

       <attribute name="productid" />

       <attribute name="extendedamount" />

       <attribute name="baseamount" />

       <link-entity name="new_goal" from="new_account" to="new_accountid" link-type="inner" alias="Goal" >

         <attribute name="new_model" />

         <attribute name="new_goal" />

         <attribute name="new_account" />

       </link-entity>

       <link-entity name="account" from="accountid" to="new_accountid" alias="accountOp" />

     </entity>

    </fetch>

    If you do not have XRM toolbox then download it. Thanks

  • antc Profile Picture
    2,909 on at

    Hi Rocker,

    I think this is where my design / logic is flawed as you can see by the screenshot it is returning random model (Ssegment) for same Product which is why I suspect my fetchXML import is failing. I feel like it needs filter conditions with runtime parameters for the linked entity just not sure if this can be done.

    Capture22.JPG

  • Dynamics365 Rocker Profile Picture
    7,755 on at

    It seems like a SSRS report not a chart. Please confirm.

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