Object Manager
Data Checks
Key Fields are Integer, Code, Option or Date
Checks if keyfields are of type:
Integer
Code
Option
Date
Comment: Try to avoid ‘Decimal’ in primary key.
NotBlank on Key Fields
Checks if property of keyfield is set to NotBlank. This check is only done on tables with one primary keyfield of type code.
Comment: Add NotBlank property
Testfield on Key Fields
Checks if TESTFIELD function is set on key fields in the OnInsert trigger of the table. This check is only done on tables with one primary key field of type code.
Comment: Add TESTFIELD;
Flowfields Not Editable
Checks if the Editable property of flowfields is set to No.
Comment: Make not editable
No. of Option Values in Fields
Checks if an option in the OptionCaptionML is missing.
Comment: No. of options not the same for Language ‘ENU’
Primary Key in Table Relation
Checks if in a table relation the primary key field is used. If it is a relation to a table with a single primary key this is not needed and should be removed.Comment: Remove Primary Key Field ‘No.’ from TableRelation
Field Types in Relations
Checks fields if related fields in table relation and FlowField CalcFormulas have same data type.Comment: The related field in table ‘Item’ is ‘Text175’The Description field on Item table has data type Text175, while the BOM Description field on the BOM Component has data type Text50.
Missing Relations
Check is a table relation is present when in C/AL code a field is filled with the primary keys field of another table.Comment: Relation is missing
Assignments
Checks if an overflow can occur when fields are assigned in C/AL code.Comment: This assignment can cause an overflow. Text50 := Text175
Delete Relating Table
Checks if in the delete trigger of a table all related sub-tables are deleted.
Comment: Related records in table Item Amount are not deleted
Constants in Relations
Checks if in a string is used in a table relation.Comment: Do not use a string in a table relation
Transferfields
?????
Lookup Page
Checks if lookup and drilldown page has the same table no. as the table itself
Checks if lookup and drilldown pages are list pages
Comment: Wrong Source table
Comment: Not a list page
Data Caption Fields
Checks if the data caption fields are specified on a table. Data Caption Fields are the fields shown when you do the look up.Comment: Add data caption fields
AltSearchFields
Checks if AltSearchField is present for master data tables (only enabled in classic client). You get a warning if AltSearchField functionality is used
Comment: Remove AltSearchField property
Redundant MaintainSIFTIndex
Check that MaintainsSIFTIndex is disabled for the primary key if SumIndexFields are present.Comment: Disable MaintainSIFTIndex for this primary key
Field Types in Filters
Checks if the fields that you use in link properties such as SubPageLink and LinksFields have same data type.Comment: Fields are not the same Code20 <> Code10
Data Classification
Checks if your table field have a data classification specified.
Comment: Data to be classified
Usage Category
Checks if your card and list pages have a Usage Category specified.
Comment: Add UsageCategory property
Missing SumIndexField Key
Checks if a matching key with a SumIndexField is present for your SUM and AVERAGE flowfields.
Comment: No key with SumIndexField Amount and all the filters found in table G/L Entry
Naming Checks
This feature checks the correct naming
‘tmp’ in Name of Temporary Records
Checks if ‘tmp’ is in the name of a temporary record. A warning will be given if a record variable has ‘tmp’ in its name and is not a temporary record. Other way around when a temporary record has no ‘tmp’ in its name also a warning appears. The following name parts will be seen as temporary:
Tmp
Temp
Buf
Buffer
_Comment: Add ‘tmp’, ‘temp’ or ‘buffer’ to variable name
Comment: Remove ‘Temp’ from variable name_
Variable Names
Variable names must start with capital letter. The first and second letter of the name can be lowercase because of the common use of prefixes.
Comment: Start a variable name with a capital
dimensionValue: Not allowed
pCustomer: Allowed
Also spaces in the variable name will be noticed.
Comment: Remove space from variable name
Object Names
Object names have the same check as variable names except for spaces. Double spaces however are noticed.
Field Names
Same checks as Object Names.
Reserved Names
Checks if variable-, field- and function names are conflicting with existing functions and commands.
Comment: ‘CopyFilters’ is a reserved command.
Function Names
Checks if a function name contains spaces.
Comment: Remove space from function name
Double Captions
Checks if the captions of table fields are conflicting.
Transport Checks
Transport checks are only performed when the Check Guidelines is executed either from projects or transports.
Conversion Checks
Conversion checks are enabled if you choose database type conversion. A database that is used to convert your objects to AL format.
Application Area set without Usage Category
Checks if a Usage Category is missing in one of your objects.
Comment: Application Area set Without Usage Category
Lefover Properties
Checks if there are properties in your objects that are not valid in AL objects. You can choose to remove them or to leave them in your objects and let a converter action remove them when you convert your objects with the C/AL to AL Converter. More info: C/AL to AL Converters.
Comment: TestTableRelation not supported
Promoted Action Properties
Checks if one of the properties PromotedCategory, PromotedIsBig or PromotedOnly is set without the Promoted property.
Comment: PromotedIsBig can only be set for promoted actions
Grid Layout
Checks if a grid layout matches the layout.
Comment: GridLayout only supported on Grids
RunOnClient
Checks if there are dotnet variables declared with RunOnClient.
Comment: Remove RunOnClient property
Company Checks
You can add guideline checks that are specific for your company by subscribing to three publisher functions.
Here is an example how you can check if all VAR parameters that starts with Tmp are temporary:
InitializeCompanyChecks:
Sender.AddCompanyCheck(900, TxtCheckTmpParameterVariable, TRUE);
AnalyseObject:
IF TmpProcedure.FindSetWithParentEntryNo(TmpObject."Entry No.") THEN
REPEAT
IF TmpVariable.FindSetWithParentEntryNoType(TmpProcedure."Entry No.", TmpVariable.Type::Parameter) THEN
REPEAT
IF TmpVariable."Is Var" AND NOT TmpVariable."Is Temporary" AND (DELSTR(TmpVariable.Name, 4) = 'Tmp') THEN
Sender.AddCompanyComment(Comment, 900, TxtMakeVariableTemporary, TmpVariable."Line No.", TmpVariable.Identifier);
UNTIL TmpVariable.NEXT = 0;
UNTIL TmpProcedure.NEXT = 0;
CorrectCompanyComments:
IF TmpProcedure.FindSetWithParentEntryNo(TmpObject."Entry No.") THEN
REPEAT
IF TmpVariable.FindSetWithParentEntryNoType(TmpProcedure."Entry No.", TmpVariable.Type::Parameter) THEN
REPEAT
IF TmpVariable."Is Var" AND NOT TmpVariable."Is Temporary" AND (DELSTR(TmpVariable.Name, 4) = 'Tmp') THEN BEGIN
TmpVariable."Is Temporary" := TRUE;
TmpVariable.Modification := TmpVariable.Modification::Update;
TmpVariable.MODIFY;
NoOfCommentsCorrected += 1;
END;
UNTIL TmpVariable.NEXT = 0;
UNTIL TmpProcedure.NEXT = 0;
Caption Checks
Checks all objects for missing captions and redundant spaces in captions. To enable this feature select Check Missing Captions in the Object Manager Setup window. Caption checks will only be executed in the range of languages the user has defined in the setup.Checking the captions typically can show the following comments:
_Add caption to object _- The object checked does not have any captions defined for.
Add caption – The field or control checked does not have any captions defined for.
Add
<language>
caption_ – The field or control checked does not have a caption defined for the designated language.Remove space from caption – The caption contains a redundant space.
Use the Update Captions window to view the individual check results and update them.If a translation for a specific language has been defined as a translation rule you can insert a missing caption for that language using the Apply Guidelines to Selection feature on the Code window. For more info see section Translation Rules.If a lot of captions are missing you can add those with the translation tool. For more info see chapter Translation Tool.
Space after Comma
The guidelines of NAV says that you cannot put a space after a comma. Many developers like to place there a comma anyway. In the setup you can choose which method the Object Manager has to check.
If you choose the option Mandatory your code have to look like this:
If you choose the Prohibited setting your code has to look like this:
It is also possible to leave this option blank. The Object Manager will not check for spaces after comma.
Check Guidelines
The Check Guidelines tool can be found in menu Analyzing Tools > Check Guidelines.Add the objects you want to check. If you have a range of objects you want to add you also can use the function Add Objects.Enter the filters. The objects will be added to the worksheet. To check the object(s) start function Check.When finished all criteria you selected in the setup is checked. The No. of Comments per Object can also be seen in the lines.
Function Name can also be shown in the View Check Guidelines, make sure to add the corresponding column in order to see the Function Name values. By using the Code button in this page on the selected object you can go to the C/AL where the Check Guidelines tool found the comments. If you want to loop through all comments you can use the function buttons Previous and Next.
Known comments
You can set a comment as Known Comment if you don’t want to solve the comment. This is often done when the comments apply to standard NAV objects. The benefit of using the know comment option is that you can easily see a new comment because this comment is not set to ‘known’.
Set Known Comments with C/AL History
With this function you can set all comments to known that were already present on a certain moment. This can be useful when you work on a particular project for a week and you want to know which comments were newly created in this week.Set the date and press OK. All comments that were already in the objects at April the 18th will be set the known. The comments that will remain as new are the comments that are newly created since April the 18st.
Import and Export Known Comments
With this function you can import and export all your known comments from or to other databases. So you don’t have to set them again in a new database.
Auto Apply Guidelines
You have the ability to let the Object Manager correct some of the check coding guidelines comments. Beware that automatic changing by the tool isn’t possible for all guideline checks. Only auto apply guidelines in a development environment and test the changes before transporting your objects to the production environment. It is possible to apply the guidelines to a selection of code. All comments of the objects. Or a selection of objects.
Manual Apply Guidelines
There are also coding guideline checks that cannot be auto applied. E.g. the FIND check can be replaced with more possibilities so this can only be done manually. The fastest way to do this is directly in the code page.
Here it is possible to edit a line of code and press the save button. The objects will be saved and the guidelines will be rechecked and the comment will be deleted.
Layout checks can be best solved in the Object Designer. To open the object in design mode you can press Design. The Object Designer will open the selected object in design modus. Also Data and Naming checks have to be done directly in the object itself or by modifying the results in the Editor page.
Perform Guidelines on Text File
See chapter File Function - Check Guidelines for more info.
Compare Databases
With the Compare Database functionality, the user is able to compare objects of two separate databases and or files. You are able to compare current database with another or compare 2 databases other than the current you are in. Furthermore you can import .obp and .txt files to compare.
Setup
Open Administration > http://Databases.In the Database Card you set the properties for the databases you want to connect for comparison.
Comparing Databases
Open Analyzing Tools
> Compare Databases
. If you want to compare your current database set Left is Current Database. If you want to compare another database, you select a database in the field Left Database. Select a database in the Right Database to which you want to do a comparison, and click Refresh. If lines are red the C/AL History has to be updated in the database.
Analyzing Changes
You can set a filter on Different to show only the objects which are not equal or do not exist in one of the databases. You can analyze the differences with your compare tool with the menu options Show Changes in Directory or Show Changes in One File.
You can see if the no. of records is equal between the databases. This can be used to e.g. check if your master data is already up to date in your test database. Push Calculate No. of Records
for all objects or a selection.
It is possible to filter on project and transport, as well as open the tool from project and transport cards and lists. For any of the objects in the left database the Active Projects column lists all active projects in the object is their part.
For tables there is an option to zoom in on the fields with the Compare Fields
button. A similar window will open where you can see the differences the field level. See chapter Compare Fields for more info.
Push Objects
If the objects can be transferred without any changes you can use the push functionality to send your objects to the other database. The objects are imported in a compiled state.
Merging Objects
The objects can be merged using your compare tool into the other database. The objects are imported in text format, therefore the option Use Command Line must be enabled.
Database Compare Matrix
To get an overview of all you databases and the differences between them you can use the Database Compare Matrix. This tool can be found in menu Analyzing Tools
> Database Compare Matrix
.
You can add databases or change the order of the databases with the buttons in the ribbon. To see which objects are different between the databases you can drill down on one of the quantities. The Database Compare tool will open for the corresponding databases. See chapter Compare Databases for more info.
Compare Fields
With the Compare Fields functionality, the user is able to analyze differences on field level between two separate databases and/or files. You are able to compare current database with another or compare 2 databases other than the current you are in. Furthermore you can import .fld files to compare.
Test Worksheet
The Test Framework is used to automate tests. If you have a certain process that has to be tested before you transport objects to your customer database you can write a codeunit with input and output parameters that will be tested before the transport is executed.
Create Test
You can find the Test Worksheet in menu Analyzing Tools or access it from the project- or transport card. If you add a test to a project it will be transported to your customer database and it can be tested before you do the transport.
Codeunit No. | The codeunit that will execute the test. |
---|---|
Codeunit Name | The name of the codeunit. |
No. of Input Parameters | The number of input parameters that is used in the test codeunit. |
No. of Output Parameters | The number of output parameters that is used in the test codeunit. If one of the output parameters has another value the test will fail. |
Maximum Duration (ms) | If the duration of the test is longer than this value the test will fail. |
Run Frequency |
|
Last Test Succeeded | The result of the last executed test. |
Last Test Result | The result of the last executed test. If an error has occurred the error message is shown in this field. |
Example of a Test Codeunit
Codeunit 11102078 – OM – Test Example is a simplified example of how a test codeunit could look like.
This codeunit will test if in a new project the user that is validated in the first user role will be the active user. In this example you see that it has 1 input parameter and 1 output parameter.
The result of this test will be Test succeeded.
If you have done a modification to the project module which will result in another active user the test will fail and give you the result “Parameter ‘ActiveUser’ returned ‘KOOS SPLINTER’. Must be ‘REIJER MOLENAAR’
If you lower the maximum duration to 5 ms. the test will also fail and the result will be “Duration of test was 27 ms.”.
Check Transferfields
NAV uses the TRANSFERFIELDS command to copy data from one table to another. When there are conflicting field types or field length in this tables you will get an error like this.
To check if you have any of these conflicting field types in your database you can use the Check Transferfields page.
Initialize Transferfields Tables
There are two methods to populate the tables to check. The first one is to use the option Initialize Tables
. This option fills in the tables that use the transferfields command in a default Cronus database. If you have customization’s in your database it is better to use the option Get Tables from Where Used
. This option searches your where used base for the transferfields command.
Transferfields Conflicts
Whenever there is a conflict between table fields, drilldown to the “No. of Errors” column to see which fields cause this conflict. There are two types of conflicts. Warnings are fields that exist in one of the tables but miss in the other. This can be done for a reason, but sometimes it is simply forgotten to add the field to one of the tables. Conflicts of the type ‘error’ have to be fixed always.
In the above example you can see that there is a conflict between table Customer and the Contact table. When you drilldown the No. of Errors column you will see which fields cause this conflict.
Apply Differences on Dest. Table
You can create missing fields in the destination table or update existing fields if they have conflicts. Select the lines of the fields which you want to transfer to the destination table. All conflicts would be solved in your database. The Apply Differences with C/AL Code
function also copies the C/AL code from the OnValidate and OnLookup triggers of the source fields to the destination fields.
MenuSuite Viewer
With this tool you can check where an object is located in a MenuSuite.
Synchronize MenuSuite Properties
A couple of properties are present at your pages/reports as well as in your MenuSuite. To see if they are the same you can use the MenuSuite Viewer.
Select the MenuNodes and push the Synchronize Page Properties button. In the following page you can analyze the differences, make modifications and apply them to the objects.
Check License
With the Check License page you can see which objects are unused in your license (in other words: available object numbers) and which objects are outside your license. Alternatively The Detailed Permission Report can be imported from MS Voice page via file download to check the exact objects allowed to be used.
Import and Export License Files
Pressing Export
you can export license information of the active license to a .lic file. At any time you can import a .lic file into the Check License window to verify the license against the object set in OMA.
Bitmaps
With the Bitmaps feature you can see which bitmaps are available in NAV. Navigate to related bitmaps by selecting the corresponding letter on the ribbon. The bitmaps are sorted alphabetically.
IDYN 2024