Based on feedback from these previous posts:
Here is a version of the tool for RTC (with pages). In fact, this time I removed the forms. There is nothing special added to the tool compared to last time, except for the pages, so if you do want to still run it in the Classic Client, then you can get the forms from the previous version.
But first a few general things about Charts.
This post concerns the charts that live in table 2000000078 “Chart” (Departments/Administration/Application Setup/RoleTailored Client/Charts” (page 9182)). These charts can be added as a system part to a role center or via “Customize this page”.
What other charts exist?
Other charts are not the topic for this particular post. But just to explore the alternatives, more advanced charts can be created using Client Add-ins, examples of which you can find here:
I’m sure there are more ways to add charts in NAV. Please feel free to add comments about other ways and also your experience with this and other types of charts.
So the charts we are concerned with here, are the system charts. Their characteristics are:
- Inbuilt – no external components needed, everything is built into RTC.
- Simple – good at showing a simple overview, but advanced BI they are not.
- Limited – They can be based on only one table and have limited scope.
To make the most of them, use their simplicity as a strength and don’t try to make them do too much.
Ideas for charts
My experience with charts is that they are easy to overcrowd and best kept simple. Trying to come up with ideas for simple charts, one only has to look at the Role Center – designed to give a role based, quick overview. Some of the features of the default Role Center are:
- Activities – Numbers of orders, quotes, etc
- My-Xyz – My Customers, My Items, etc
These areas are specifically designed to give a simple and personalized overview, so perfect for charts.
Activity Charts (Charts based on Cue tables)
This example shows how to make a chart to show Activities in a chart like this:
To get charts based on Cue tables:
After importing the objects attached below, start with Page 72000 “Chart Generator List”. In my case I added it to Home Items under Page Actions in my default Role Center 9006 as shown here:
Then click “New” to create a new chart:
Enter ID and Name. For table, select table 9053 “Sales Cue”, and for X-Axis, just select “Primary Key”. The chart needs to have an X-Axis, but in this case the X-Axis information is not really important. So it should look like this:
Then we add a column (Y-Axis) for each activity type we want in the chart – in this example we have three columns:
- Ready to Ship
- Partially Shipped
Do this by clicking the Y-Axis action, then select those three fields.
This would be enough, but if you created the chart now, then it would give you a different picture than the Activity Center. That’s because the activities apply a Date Filter. If you want to apply the same filter in the chart, then just click on Filters, and set “Date Filter” = 01011900..W. This will show you all orders from 1900 until Workdate.
Once you have completed the chart, click “Generate Chart”. This will create a new system chart, using the Name you typed in as ID. Or if this chart already exists, then “Generate Chart” will overwrite the existing one.
The last thing you need to do, is to add the chart to your Role Center, either via “Customize this page” from your Role Center (Charts can only be added to the Role Center, not to any other page type), or by designing your Role Center and adding a part of type Chart.
My-Charts – Chart based on My Customers
Here is the next example: Show the customers under “My Customers” plus a little additional information, for example Balance (LCY):
This chart requires a little bit of preparation in the form of table design to begin with. First: The field you want to see in the Y-Axis (in this example Balance (LCY)) has to be added to table 9150 “My Customer”. In this table you can basically copy any flowfield from the Customer table. I created a new field 50.000 called “Balance (LCY)”, FieldClass = FlowField, and CalcFormula = Sum(“Detailed Cust. Ledg. Entry”.”Amount (LCY)” WHERE (Customer No.=FIELD(Customer No.))).
Secondly we need to filter the table by User ID. In this case we cannot set the filter in the chart itself because there is no way in the charts to filter on USERID. But, this is what you can do instead: In Codeunit 1, apply a global filter. This will take effect also for charts. This is the code you would need:
IF GUIALLOWED THEN
// == begin ===
// == end ===
FILTERGROUP 1 is used for applying a global filter. When setting this filter in the CompanyOpen function, it will be applied to the whole session whether you run NAV from Classic or RTC.
Now, even charts will only see customers belonging to the current user.
So, finally, this is how you could create the chart in the tool:
The tool is attached just below as a txt file. It contains these objects:
- Table 72000 Chart Generator
- Table 72001 Chart Generator Filter
- Table 72003 Chart Generator YAxis
- Codeunit 72000 Chart Generator Mgt
- Page 72000 Chart Generator List
- Page 72001 Chart Filters
- Page 72003 YAxis List
- Page 72004 Chart Generator Card
I have added “DeleteMe” in front of every object ID in the txt file. So before importing it you must open the file in NotePad, then find all “DeleteMe”, check that the Object ID and name is OK, and then delete “DeleteMe”. Once you are OK that all the object IDs in the txt file, then import it.
Note!! When importing a txt file into NAV, it will replace existing objects without any warning.
And finally: This tool is unsupported. These postings are provided “AS IS” with no warranties and confer no rights. You assume all risk for your use.