Object Manager

Object Tools

The chapters below describe the feature set of Object Tools.

 

 

Create Table Wizard


In the Object Designer, there are wizards to create reports and pages but none for tables. With this tool you can create a table with a wizard and even the corresponding pages will be created.Just like the report and page wizard you fill in the name and table number of the new table.You can choose a Code or a No. field as primary key. Optional is creating additional Description field. If you use a No. field you can link the No. to a “No. Series” field in an existing table.When you use the Lookup for the card or list form number field, the Check License screen shows you which object numbers are still available.Press Create to to create all the required objects, with all additional C/AL code.

Translation Rules and Table Wizard

If there are rules in the Translation Tool. The captions in the objects are automatically created according to these rules. For more information see Translation Tool – Rules.

Renumber Objects


With this tool you can renumber objects. When another object has a connection with the renumbered object the reference(s) in these objects will also be changed. It even is possible to renumber tables with data in it. There are three possible modes.

  • Update in DB – Objects are renumbered in the database.

  • Export – The objects are renumbered and exported in text format.

  • Update text file – Objects are renumbered in a text file.

Update is recommended because all data in the Object Manager will also be renumbered. If you choose for the export mode, the data will stay the same.

Update in DB Mode

Click Renumber Objects and then click Add Objects.In the field No. of Involved Objects you can see which objects will be updated when you renumber your selection of objects. In the following example, you can see that the Resource table also will be updated because is has a reference to the Car table.

With the option Keep Delta Equal you only have to change one New Number. The Object Manager will apply the same delta to all other lines. If you have selected a couple of lines the delta will only apply to the selected lines. Without the option Keep Delta Equal you can modify the lines separately. The lines in the renumber page can have the following colors:

  • Black – New number is equal to original number.

  • Red – New number already exists.

  • Purple – New number is two times present.

  • Green – Object will be renumbered.

Press Start and a wizard will open which guide you through the renumbering.

Export Mode

This option works the same as the Updating in DB option, but the objects in the original database are not renumbered. The renumbering is only done in the exported file. The exported file is a text file which you can import in the Object Designer. Choose option Export, and select the filename for the text file.Press Start to initiate the renumbering and the file will be created.

Update Text File Mode

This mode works the same as the other two modes but the objects are renumbered in a text file. You enter a filename for the source file and a filename for the file that will be created with the renumbered objects.

Export Definition to File

If you have to do the same renumbering in another database you can use the options Export and Import Definition to File.

 

Renumber Fields


With this tool you can renumber fields. When another object has a connection with the renumbered field the reference(s) in these objects will also be changed.

There are three possible modes.

Update in DB Mode

Click Add Fields.

The lines in the renumber page can have the following colors:

  • Black – New number is equal to the original number

  • Red – New number already exists

  • Purple – New number is two times present

  • Green – Field will be renumbered

In the field No. of Involved Objects you can see which objects will be updated when you renumber your selection of objects.

With the option Keep Delta Equal you only have to change one New Number. The Object Manager will apply the same delta to all other lines. If you have selected a couple of lines the delta will only apply to the selected lines. Without the option Keep Delta Equal you can modify lines separately. Press Start and the wizard will open which will guide you through the renumbering.

Export Mode

This option works the same as the Updating option, but the field in the original database are not renumbered. The renumbering is only done in the export file. The exported file is a text file which you can import in the Object Designer.

Update Text File Mode

This mode works the same as the other two modes but the fields are renumbered in a text file. You enter a filename for the source file and a filename for the file that will be created with the renumbered fields.

Export Definition to File

If you have to do the same renumbering in another database you can use the options Export and Import Definition to File.

 

Renumber Elements


With this tool, you can renumber the elements of an object. Elements are functions, variables and controls. When another object has a connection with the renumbered element the reference(s) in these objects will also be changed.

There are three possible modes.

  • Update in DB – Elements are renumbered in the database.

  • Export – Objects are exported in text format and elements are renumbered in the exported file.

  • Update Text File – Elements are renumbered in a text file.

Update in DB Mode

Click Add Elements in the ribbon. Select filters for the objects from which you want to renumber the elements.

The lines in the renumber form can have the following colors:

  • Black – New number is equal to the original number

  • Red – New number is two times present

  • Green – Element will be renumbered

In the field No. of Involved Objects you can see which objects will be updated when you renumber your selection of objects.

To give the elements a new number you can modify the lines manually but you can also select the lines you want to renumber and fill in the Start at fields on the Options tab and click Fill New Numbers in the Functions ribbon.The elements will get their new number. Click Start to modify the objects. All the elements will be renumbered.

Export Mode

This option works the same as the Updating option, but the element in the original database are not renumbered. The renumbering is only done in the export file. The exported file is a text file which you can import in the Object Designer.

Update Text File Mode

This mode works the same as the other two modes but the elements are renumbered for an existing text file. You enter a filename for the source file and a filename for the file that will be created with the renumbered elements.

 

Update Variables


With “Update Variables” you can check for unused variables in objects and clean up or sort them. You can perform this functionality on the database or export it to a text file.

There are three possible modes.

  • Update in DB – The objects are updated in the database.

  • Export – The objects are exported in text format and the variables are updated in the exported file.

  • Update Text File – The variables are updates in text file.

Delete Unused Variables

Add the objects where you suspect unused variables.Press Start to delete the unused variables.If something changes in an object the modify flag of the object is enabled so you can assign the modification to a project. If an object is already ok the Object Manager skips it. To see what has changed you can compare the modified objects with the original using your compare tool.

h2.Sort Variables

With Update Variables, you can sort the variables in the object. Set checkbox Sort Variables. Add the objects for which you want to sort variables and press Start. The variables will be first sorted on Type then Object No. and last Name.

Set Variable Range

You can set a range or choose to update all variables. This makes it possible to update standard NAV objects and leave the standard variables as they are.

 

Change Field Options


With this tool you can update or change option fields in the database including the involved objects. All references to this field are also updated.

There are three possible modes.

  • Update in DB – Objects are updated in the database.

  • Export – Objects are exported in text format and options are changed in the exported file.

  • Update Text File – Options are changed in a text file.

Select the table and the field you want to change and alter the option string the way you like. It is possible to delete, insert, swap, or rename an option. The captions will also be updated. If you change an existing option you can use the No. of Times Used option to check whether you have to modify more than only the references.

 

Translation Tool


With the Translation Tool, you can easily translate all captions and names that you have used in your objects. It can even use translations used in existing objects to translate missing values automatically.

Setup

To translate the captions used in your objects you first have to add them to the Translation Tool. In the Process ribbon click Add Objects… and run the Import Captions batch job. Now that you have abstracted all the captions you can use them to create translation rules.

Rules

Rules are used to make suggestions for a translation and look if there are any deviating translations in your objects. Click Rules > Create Rules.The Translation Tool will now scan all the existing translations and create all possible rules. It is possible to manually add your own rules and import and export them to a text file using the import and export options under the functions buttons.

Translate Captions

Now the translation tool is setup to translate the captions used in your objects.And you will see an overview of all the translations that are present in you objects. To see what captions are missing you can set a filter on the field Missing Caption. Either you translate a caption manually or you let the translation tool help you clicking one of the functions in Validate Captions and then choosing one of the following options:

  • With Calculated Caption – this will populate the caption with the value as suggested in the Calculated Caption field

  • With Base Language Caption – this will populate the caption with the value available for the base language

  • With Name – this will populate the caption with the value of the Name property

When you are ready you effectuate the translations by pressing Write Changen Captions to Database

Export and Import to CSV

You can use this function to export and import translations to a CSV file. You can send this for example to a translator. And import the translated CSV file back into the Translation Tool.

 

C/AL to AL Converters


With the C/AL to AL Converter tool you can convert your objects to AL files and create extensions.

Setup

There are a couple of settings in the Object Manager Setup that apply to the conversion tool. A new database type is added specially for the conversion task. It disables saving the fob version of each object to the history for better performance. And it enables conversion guideline checks.

Conversion Nos. Format

This is the no. series format used when a new converter is created.

Extension File Name Format

See chapter File Name Format for more information.

No. of Converter Actions

Zoom in to see which actions are executed when you create the extension.

Converter Card

Fill in the fields on the converter card as follows:

No.

The no. of the converter.

Name

The name of the converter.

Directory Name

The directory where the converted objects are saved.

ID Range Starts at

Specify the object numbers that must be assigned to the AL files.

Prefix

This prefix is added to the name of the objects. Add a space to the prefix if you want a space between the prefix and your object name.

Target Type

Select the type of extension you want to create. Specific actions are enabled when choosing Cloud.

Target Version

Select the BC version that your extension is meant for. Extra breaking changes will be added if you choose a higher version.

Remove Captions

If you want to work with XLIFF Files, your captions need to be removed from your AL Files. The actual XLIFF files are created with the button Create XLIFF Files on the actions ribbon.

Objects

To add the objects you want to convert, click Add Objects… in the ribbon and select the objects en press OK.

Base Objects

To convert modifications made to standard objects you can add the initial version of these objects. The delta is calculated and the changes are transferred to an extension object. Press Add Base Objects… to open the History Objects page and select all objects present in your Converter.

*Note
Most of the time you can just select all objects and press OK. It’s not necessary to pick each object separately. Objects that are not present in your Converter are ignored.

Action Type

Per object you can choose four action types:

<Empty>

The object will be skipped.

Convert

Object will be converted.

Convert Delta

The modifications will be calculated and an extension created.

Disable

The object will be skipped and all references will be removed in all other converted objects. This can be used if you have e.g. a page part with a control add-in that is not supported in the Web Client or a codeunit with functionality that is only suited for the Windows Client.

Check Guidelines

Press Check Guidelines to see which comments are found and you may want to consider solving before converting your objects to an extension.

See chapter Check Guidelines for more info.

Converter Actions

  1. Solve Breaking Changes

  2. Add Parentheses ()

  3. Add Missing Application Areas

  4. Add Missing Data Classifications

  5. Add Missing Usage Categories

  6. Prevent Conflicting Control Names

  7. Sort Variables

  8. Remove RunOnClient

  9. Replace StringBuilder

  10. Company Converters

Solve Breaking Changes

Breaking changes that can be solved are fixed. Breaking changes like signature changes must currently still be fixed manually.

Add Parentheses ()

Parentheses are added after the most commonly known recordset functions. It’s on the roadmap for OMA15 to update this action to handle all functions.

Add Missing Application Areas

Missing application areas are filled with value All.

Add Missing Data Classifications

Missing data classification properties are filled with the value CustomerContent.

Add Missing Usage Categories

Objects that have an ApplicationArea but not a UsageCategory. List type pages get the value Lists. All other pages the value Documents.

Prevent Conflicting Control Names

The AL ruleset will raise warnings if a control name has the same name as a variable. This action prevents this conflicts.

Sort Variables

The AL ruleset requires you to define your variables in a specific order. First recordsets than report, codeunits etc. This action sorts all variables in the required order.

Remove RunOnClient

The property runonclient on dotnet variables are removed.

Replace StringBuilder

In a cloud extension it is forbidden to use dotnet variables. If the target type of your converter is Cloud, all dotnet StringBuilder variables are changed to references to codeunit DotNet_StringBuilder and C/AL Code like SB := SB.StringBuilder; will be replaced with SB.InitStringBuilder('');

Company Converters

You can subscribe to two subscribers to write your company specific converters. The first is called InitializeConvertActions and is used to add the converter to the converter list.

LOCAL [EventSubscriber] InitializeConvertActions(VAR Sender : Codeunit "OM - AL Converter") Sender.AddCompanyAction(900, TxtThisIsAnExampleAction);

In this example we chose 900 for the unique ID of the converter.

The second subscriber is called AfterConvertObject and will execute the actual converter.

[EventSubscriber] AfterConvertObject(VAR Sender : Codeunit "OM - AL Converter";VAR TmpObject : TEMPORARY Record "OM - Object";VAR TmpElement : TEMPORARY Record "OM - Element";VAR TmpProperty : TEMPORARY Record "OM - Property";VAR TmpCaption : TEMPORAR IF Sender.ActionEnabled(900) THEN IF TmpObject.Name = 'PRE Example Codeunit' THEN IF TmpProcedure.GetByName(TmpObject."Entry No.", 'ExampleProcedure') THEN TmpProcedure.CommentLines(5, 10);

The above example will comment out some C/AL code in the procedure ExampleProcedure in codeunit PRE Example Codeunit.

Breaking Changes

Microsoft is refactoring the base app every release. Therefore, procedures moves regularly to other codeunits and are renamed etc. These changes can break your app. E.g. in BC13 all functions in codeunit 1 were moved to separate codeunits. OMA can solve a lot of these breaking changes. Zoom in on the field No. of Breaking Changes to see which changes OMA will fix.

*Note
It’s recommended to check the changes made by OMA. So convert your objects twice. Once with solving the breaking changes, and one time without, and analyze the changes with a compare tool like Beyond Compare.

Extract Subscribers

Modifications on specific triggers can be moved to events. If you have written some code on e.g. the OnInsert trigger of a table it will also be executed if you create a subscriber on the event OnAfterInsertEvent. An example of such a subscriber could look like this:

LOCAL [EventSubscriber] CustomerOnInsert(VAR Rec : Record Customer;RunTrigger : Boolean) IF RunTrigger THEN WITH Rec DO BEGIN MESSAGE('Inserted code');

Use the Extract Subscribers… button in the action ribbon to open the page that can create this subscribers.All pages and tables with a base object are added to the page.

No. of Source Files

Zoom in to see which objects will be scanned for code that can be moved to subscribers.

Remove from Source Objects

The triggers with extracted code are rolled back to the version of the base object.

Type

Choose where the subscribers must be saved. Possible options are:

  • Database – an object will be added/updated in the database.

  • C/AL File – a file in C/AL format will be saved/updated on your file system.

  • AL File – an AL file will be saved/updated in your VS Code project.

Codeunit No.

The number of the codeunit.

Codeunit Name

The name of the codeunit

File Name

The name of the file

*Note
If you choose an existing object of file the object will not be overwritten but updated.

Create Files

dotnet File

Press this button to create the dotnet file. All your objects will be scanned and all dotnet references will be placed in the dotnet file.

dotnet { assembly("System.Web") { Version = '4.0.0.0'; Culture = 'neutral'; PublicKeyToken = 'b03f5f7f11d50a3a'; type("System.Web.HttpUtility"; "HttpUtility") { } } assembly("System.Xml") { Version = '4.0.0.0'; Culture = 'neutral'; PublicKeyToken = 'b77a5c561934e089'; type("System.Xml.XmlDocument"; "XmlDocument") { } } }

Permission File

Press this button to create the permissions file.

<?xml version="1.0" encoding="utf-8"?> <PermissionSets> <PermissionSet RoleID="CarApp" RoleName="CarApp"> <Permission> <ObjectType>TableData</ObjectType> <ObjectID>60002</ObjectID> <ReadPermission>Yes</ReadPermission> <InsertPermission>Yes</InsertPermission> <ModifyPermission>Yes</ModifyPermission> <DeletePermission>Yes</DeletePermission> <ExecutePermission>Yes</ExecutePermission> <SecurityFilter /> </Permission> <Permission> <ObjectType>TableData</ObjectType> <ObjectID>60003</ObjectID> <ReadPermission>Yes</ReadPermission> <InsertPermission>Yes</InsertPermission> <ModifyPermission>Yes</ModifyPermission> <DeletePermission>Yes</DeletePermission> <ExecutePermission>Yes</ExecutePermission> <SecurityFilter /> </Permission> </PermissionSet> </PermissionSets>

XLIFF Files

Press this button to create the XLIFF files.

<?xml version="1.0" encoding="utf-8"?> <xliff version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file datatype="xml" source-language="en-US" target-language="en-US" original="translation"> <body> <group id="body"> <trans-unit id="TableExtension 1056305832 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve"> <source>Customer</source> <target>Customer</target> <note from="Developer" annotates="general" priority="2"></note> <note from="Xliff Generator" annotates="general" priority="3">TableExtension CAR Customer - Property Caption</note> </trans-unit> <trans-unit id="TableExtension 1056305832 - Field 3892782271 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve"> <source>Car Code</source> <target>Car Code</target> <note from="Developer" annotates="general" priority="2"></note> <note from="Xliff Generator" annotates="general" priority="3">TableExtension CAR Customer - Field Car Code - Property Caption</note> </trans-unit>

SQL Scripts

Press this button to create a file with SQL statements. With these statements you can copy your data to your extension database.

--DELETE FROM [DATABASENAME].dbo.[Object Manager Advanced 14_00$Customer$6BDBE989-9EBE-4A66-B514-EDEF89FCF142]; INSERT INTO [DATABASENAME].dbo.[Object Manager Advanced 14_00$Customer$6BDBE989-9EBE-4A66-B514-EDEF89FCF142]([No_], [Car Code]) SELECT [No_], [Car Code] FROM [Object Manager Advanced 14_00$Customer]; GO --DELETE FROM [DATABASENAME].dbo.[Object Manager Advanced 14_00$Sales Header$6BDBE989-9EBE-4A66-B514-EDEF89FCF142]; INSERT INTO [DATABASENAME].dbo.[Object Manager Advanced 14_00$Sales Header$6BDBE989-9EBE-4A66-B514-EDEF89FCF142]([Document Type], [No_], [Car Code]) SELECT [Document Type], [No_], [Car Code] FROM [Object Manager Advanced 14_00$Sales Header]; GO

Update Properties

Calculate No. and Names

If you change the prefix or object range the object numbers and names must be updated. Press the action Calculate No. and Names and the new prefix and/or object range will be applied.

Get Object Nos. from Files

When you start working on an existing extension, the object numbers in your converter need to be the same as the object numbers in your VS Code project. To synchronize these values press Get Object Nos. from Files. The link is made with the object names so the Ext. Object Names and the object names in your AL files must be the same.

Update File Names

If you change an Ext. Object Name you need to change the name of the AL file as well. Otherwise, the converter makes a second file for the same object. The button Update File Names will rename the files in your VS Code project according to the format specified in the setup. More info: File Name Format

IDYN 2024