Where Used Objects

With this tool you can check where objects, fields, triggers, etc. are used. It is also possible to see if an object is unused and if it is called without validation.

Where Used Objects
Where Used Objects


You can search on the following type of objects:
  • Object
  • Trigger
  • Key
  • Sum Index Field
  • Field
  • Global Function
  • Local Function
  • Global Variable
  • Local Variable
  • Parameter
  • Return Value
  • Global Publisher
  • Local Publisher
  • Global Subscriber
  • Local Subscriber
  • Event

Setup

Use the "Update Where Used" field on Object Manager Setup window to
  1. Confirm - Let Object Manager ask you whether or not you want the "Where Used Objects" be updated
  2. Always - Let this process be run automatically each time you open the "Where Used Object Card"
  3. Never - Skip this process

In order to use the Where Used functionality Object Manager needs to update the Where Used Objects. This is done in three steps:
  1. Updating "C/AL History"
  2. Updating "Where Used Objects". The C/AL code is analyzed and every item that can be used somewhere is saved
  3. Updating "Where Used In". The C/AL code is analyzed and every entry where an item, found in step 2, is used in is saved

Update Where Used
Update Where Used


For each object that changes these three steps will be executed again. So your Where Used Objects will always be up to date. This is a time consuming process. If you cancel the updating process halfway, it will continue, the next time you open the Where Used window, from that point on.

Find out Where an Object is used

When everything is updated the Where Used Object Card opens.

Colors
Colors


Some lines are colored:
  • Red - Used but not active
  • Green - Not used
  • Grey - Not active
  • Blue - Global function that is only used local

To find out where an element is used you press the Where Used button. For example the Insert trigger of the Cust. Ledger Entry table. The Where Used In window opens. Here you see the different lines of code that are calling the Insert trigger.

Where Used of Insert Trigger
Where Used of Insert Trigger


Once you have selected a line press Code to get a view on the full C/Al code context with the specific line where the trigger is used highlighted.

C/AL Code
C/AL Code


The "Temporary Record" column in the "Where Used In" window indicates that the C/AL statement uses a temporary record.

Relations

On tab relations you can see the relations between tables.It is also possible to see which objects are used in the object and in which objects the object is used.

Examples

Find out where the Table "Finance Charge Terms" is used.

Usage of Finance Charge Terms
Usage of Finance Charge Terms


Find out where codeunit Sales Post is called.

Usage of Sales-Post
Usage of Sales-Post


Find out where the table Sales Header is deleted.

Sales Header Delete
Sales Header Delete


Find out where the field Ship-to Code of table Sales Header is filled without validation.

No Validation
No Validation


Find out where the SIF Field Credit Amount of the table G/L Entry is used.

Sum Index Fields
Sum Index Fields


Find out how much unused variables codeunit Payment Tolerance Management has.

Unused Variables
Unused Variables

What Used In

If you want to see what is used in a line of code you can use the function What Used In.

What Used In
What Used In

Delete Where Used Object Lines

It is possible to delete unused "Where Used Object Lines". It will also delete the entity from the object itself.
For example we have made a field 50.000 in the Customer table but is not used anywhere. We can delete that "Where Used Object Line". The content of the field will be deleted and the field will be deleted from the table.

MenuSuite Viewer from Where Used

When objects are used in MenuSuites you can see with the function Show in MenuSuite Viewer where it is used.

MenuSuite Viewer
MenuSuite Viewer

Enable or Disable Keys and Fields

Using the Enabled field on the lines of the Where Used Object Card, you can enable of disable keys and fields. This will not work for primary keys, fields containing data, fields being part of an active key, and any other type of lines, like Trigger, Global Function, etc.