Freigeben über


CompileObjects

Compiles objects from the specified database.

finsql.exe command=compileobjects, [servername=<server>,] [database=<database>,] [filter=<filter>,] [logfile=<path and filename>,] [username=<user name>,] [password=<password>,] [ntauthentication=<yes|no|0|1>,] [validatetablechanges=<yes|no>,] [navservername=<server name>,] [navserverinstance=<instance>,] [navservermanagementport=<port>,] [tenant=<tenant ID>]

Parameters

servername

The name of the database server on which you want to run the command.

If you do not specify both the servername parameter and the database parameter, then the database server and database that are stored in the fin.zup file are used.

Note

When you first specify a database server and database to open, either from a command at a command prompt or from a client, the database server and database are stored in the fin.zup file. By default, the fin.zup file is located at C:\users&lt;user name>\AppData\Roaming.

If you do not specify the servername parameter but you do specify the database parameter, then the Open Database window opens so that you can specify the database server name.

Tip

To view the name of the server on which the current database is stored, on the File menu, choose Database, and then choose Information. Use the value of the Database Server field for the servername parameter.

database

The database in which the objects that you want to compile are stored.

If you do not specify both the servername parameter and the database parameter, then the database server and database that are stored in the fin.zup file are used.

Note

When you first specify a database server and database to open, either from a command at a command prompt or from a client, the database server and database are stored in the fin.zup file. By default, the fin.zup file is located at C:\users&lt;user name>\AppData\Roaming.

If you do not specify the database parameter but you do specify the servername parameter, then the Open Database window opens so that you can specify the database name.

Tip

To view the name of the current database, on the File menu, choose Database, and then choose Information. Use the value of the Database Name field for the database parameter.

logfile

The path and file name for the file that contains error messages that result from the command. If there are no errors, then a log file is not created.

By default, the file is named naverrorlog.txt and is located in the same location as finsql.exe.

The navcommandresult.txt file, which contains information about the success or failure of the command, is created in the folder that is specified by the logfile parameter.

When you run finsql.exe with a command, the previous log file and result file are deleted.

Note

If User Access Control (UAC) is turned on and you do not specify to run the Command Prompt window as Administrator, then the Command Prompt window runs as a standard user. In this case, if you do not specify the logfile parameter, then the command fails because the standard user cannot write to the default location of the log file.

filter

A filter on the Object table. Use the filter parameter to specify which objects to compile. Use a semicolon to separate multiple filters. The only operator that you can use in the filter is '='. The following table shows the fields in the Object table on which you can filter.

Object table field Values Example

Type

Table, Codeunit, Page, Report, XMLport, Query

Type=Table|Page

ID

Integer or range of integers

ID=50000..50500

Name

Any valid object name

"Name=Cost Entry"

Modified

yes, no, 1, 0

Modified=yes

Compiled

yes, no, 1, 0

Compiled=0

Date

Date, in the numeric format determined by your regional settings

Date=12/1/2012

Time

Time, in the numeric format determined by your regional settings

Time=12:00:00

Version List

Any valid version

Version List=NAVW17.00

Caption

Any valid caption

Caption=Company Information

Locked

Yes, no, 1, 0

Locked=1

Locked By

Domain\username

"Locked By=CRONUS\viktor"

If you do not specify a filter, then all objects in the Object table are included.

username

The user name to use to authenticate to the database. The user name must exist in the database. If you do not specify a user name and password, then the command uses the Windows user name and password of the current user to authenticate to the database.

Note

If User Access Control (UAC) is turned on and you do not specify to run the Command Prompt window as Administrator, then the Command Prompt window runs as a standard user. In this case, if you do not specify the username parameter and the current Windows user is an Administrator, then the command is run as the standard user.

If you specify the username parameter, then you must also specify the password parameter and the ntauthentication parameter must be no.

For more information about database users and permissions, see Setting Database Owner and Security Administration Permissions.

password

The password to use with the username parameter to authenticate to the database. If you do not specify a user name and password, then the command uses the Windows user name and password of the current user to authenticate to the database.

ntauthentication

Specifies if you want to use NT authentication. The possible values are yes, no, 1, or 0. If you specify the username and password parameters, then you must specify ntauthentication=no or ntauthentication=0.

validatetablechanges

Specifies if you receive a warning message if you compile an object that will result in data loss. If you set this parameter to No, and you remove a field from a table, or you change the data type of a field, any data in the field will be lost when you run the table or access it from a Microsoft Dynamics NAV client.

If your solution deploys in a multitenant deployment architecture, the change will only apply to a tenant database that is mounted using the Mode parameter set to force.

navservername

Specifies the name of the server that hosts the Microsoft Dynamics NAV Server instance, such as MyServer.

navserverinstance

Specifies the Microsoft Dynamics NAV Server instance that is being used, such as DYNAMICSNAV71.

navservermanagementport

Specifies the port on the Microsoft Dynamics NAV Server server that the Microsoft Dynamics NAV Windows PowerShell cmdlets access, such as 7045.

tenant

Specifies the ID of the tenant that is accessed when you run objects from the development environment. If your solution is not set up to deploy in a multitenant deployment architecture, leave the parameter empty.

Remarks

You use the CompileObjects command together with the finsql.exe executable. Finsql.exe is the executable file that runs the development environment. By default, finsql.exe is located at C:\Program Files (x86)\Microsoft Dynamics NAV\71RoleTailored Client\.

To compile objects, you must have a developer license.

Example

This example shows how to run a command to compile all tables and codeunits that have an ID that is greater than or equal to 500 and less than or equal to 1000.

finsql.exe command=compileobjects, servername=TestComputer01\NAVDEMO, database="Demo Database NAV (7-1)", filter="Type=Table|Codeunit;ID=500..1000"

See Also

Reference

DesignObject
ImportObjects
ExportObjects

Concepts

Compiling Objects