If you use the sales pipeline chart in combination with an option set for your visualization, by default the chart is ordered by the option set value. But what if you want to order by the labels of the option set instead?
Let’s take the following option set as an example:
Label | Value |
---|---|
1 Start | 274000001 |
2 Examine | 274000003 |
3 Continue | 274000002 |
4 Finish | 274000004 |
The result would be:
Fortunately, this is quite easy to correct:
- Create a new unmanaged solution and add the sales pipeline chart;
- Export the solution;
- Extract the zip package;
- Modify the customizations.xml;
- Package the files;
- Import the unmanaged solution.
Step #4 is the key here: a small modification to the customizations.xml is necessary. The relevant part of the XML is the following:
<fetch mapping="logical" count="10" aggregate="true">
<entity name="opportunity">
<attribute name="opportunityrevenue" aggregate="sum" alias="sum_estimatedvalue" />
<attribute name="my_option_set" groupby="true" alias="stepname" />
<order alias="stepname" ascending="true" />
</entity>
</fetch>
Remove the count attribute from the fetch tag, and the entire order tag. The modified XML now looks like this snippet:
<fetch mapping="logical" aggregate="true">
<entity name="opportunity">
<attribute name="opportunityrevenue" aggregate="sum" alias="sum_estimatedvalue" />
<attribute name="my_option_set" groupby="true" alias="stepname" />
</entity>
</fetch>
After re-importing the solution, your chart should now correctly order by label: