Viewing the Definition of a Function or Object by Using Go To Definition

You can view the definition of a function or object by selecting the item in the C/AL Editor and then clicking Go To Definition. You can also view the definition of a function by selecting it in the C/AL Globals window and then clicking Go To Definition.

To go to the definition of a function or object, select or place the cursor anywhere in the function name or object variable name, and then do one of the following:

  • On the View menu, click Go To Definition.

  • Right-click the function name or object variable name, and then click Go To Definition.

  • Press SHIFT+F12.

The following table describes how you can go to the definition of a function or object.

Starting location Result

From the C/AL Globals window, select a user-defined function

The C/AL Editor goes to the C/AL code that defines the selected function.

From the C/AL Editor, select a user-defined function

The C/AL Editor goes to the C/AL code that defines the selected function.

From the C/AL Editor, select a user-defined function that is called on an object variable

  • The object is opened in the corresponding designer.

  • A new C/AL Editor window opens to the C/AL code that defines the selected function.

From the C/AL Editor, select a system function on an object

If the system function is called on an object variable, such as a record, codeunit, or report, then the object is opened in the corresponding designer. If the system function is not called on an object variable, then nothing happens.

From the C/AL Editor, select a variable that is one of the following object types:

  • Record

  • Page

  • Form

  • Report

  • Codeunit

  • Dataport

  • XMLport

The object is opened in the corresponding designer or editor:

  • Table Designer

  • Page Designer

  • Form Designer

  • Report Designer

  • C/AL Editor

  • Dataport Designer

  • XMLport Designer

Gg502520.note(en-us,NAV.60).gifNote
If you select a variable that is a fundamental data type, such as Integer or Decimal, then information about the variable is displayed in the status bar.

Examples

This section shows examples of using the Go To Definition shortcut menu item.

User-Defined Function from the C/AL Globals Window

From the C/AL Globals window, right-click a user-defined function, and then click Go To Definition.

Go To Definition of a user-defined function

The result is that the C/AL Editor jumps to the C/AL code that defines the selected function.

Go To Definition of a user-defined function

User-Defined Function from the C/AL Editor

From the C/AL Editor, right-click a user-defined function, and then click Go To Definition.

Go To Definition from user function in C/AL Editor

The result is that the C/AL Editor jumps to the C/AL code that defines the selected function.

Go To Definition from user function in C/AL Editor

User-Defined Function from the C/AL Editor for an Object Variable

From the C/AL Editor, right-click a user-defined function that is called on an object variable, and then click Go To Definition.

Go To Definition from user function in C/AL Editor

The result is that the object on which the function is called is opened in the corresponding designer and a new C/AL Editor window opens to the C/AL code that defines the selected function.

GoToDefinition from user func in C/AL Editor

System Function from the C/AL Editor

From the C/AL Editor, right-click a system function that is called on an object variable, and then click Go To Definition.

Go To Definition from a system function

If the system function is called on a record variable, then the table that the record is from is opened in Table Designer.

Go To Definition from system function

If the system function is the <codeunit>.RUN function, then the codeunit is opened in a new C/AL Editor window.

Go To Definition from codeunit.RUN function

If the system function is called on any other object type variable, then the object is opened in the corresponding designer. For any other system function that is not called on an object variable, nothing happens.

Object Variable from the C/AL Editor

From the C/AL Editor, right-click a variable that is one of the following object types, and then click Go To Definition:

  • Record

  • Page

  • Form

  • Report

  • Codeunit

  • Dataport

  • XMLport

Go To Definition from Record Variable

The object is opened in the corresponding designer:

  • Table Designer

  • Page Designer

  • Form Designer

  • Report Designer

  • C/AL Editor

  • Dataport Designer

  • XMLport Designer

Go To Definition from record variable

Permissions

To go to a definition, you must have the correct permissions. If you do not have permission to view the definition of an object by selecting the object in Object Designer and then clicking Design, then you cannot view it with the Go To Definition option.

Community Additions

ADD
Show: