/
Version and Source Control

Object Manager

Version and Source Control

Update C/AL History

Open the Object Explorer and select outdated objects. An object is outdated when the C/AL History is not up to date.

42_outdated-objects.png

Press Update C/AL History.

Check and Update C/AL History

The Object Manager only checks if the properties of an object are changed. If you e.g. imported objects with a text file and the date and time of the objects are still the same but the C/AL of the objects is changed the Object Manager will not update the C/AL History. If you know that there are such changes in your database you will have to use the “Check and Update” option. Now the Object Manager will compare the contents of the objects with the C/AL History. This is a time consuming process.

43_check-and-update.png

Automatic C/AL Saving

When you perform some actions in the Object Manager it is possible to save the current C/AL to the C/AL History. Go to Setup > Source Control and set the triggers:

  • Save C/AL at Modification

  • Save C/AL at Assigning

  • Save C/AL at Locking

  • Save C/AL at Unlocking

  • Save C/AL at After Transporting

  • Save C/AL at Before Import Transport

  • Save C/AL at After Import Transport

44_save-c-al-triggers.png

You can set the 7 different triggers on 3 values: “No”, “If changed” and “Yes”.

  • Yes – C/AL will be saved always when trigger action is executed.

  • If changed – C/AL will only be saved when the properties (name, date, version) of the object has changed.

  • No – C/AL will not be saved.

Example
If you modify an object with the trigger Save C/AL at Modification on Yes or If changed. you can view the C/AL History with the Object Explorer. In this example we change the length of the field Name from 50 to 200. Save and compile the Vendor table.

45_modify-the-vendor-table.png

Select the Vendor table and click C/AL History in the Object Explorer.

46_c-al-history.png

The C/AL History Objects page opens.

47_history-of-the-vendor-table.png

In this list you can see all changes in the object from the moment you started tracing. In the example you see the first line is the “original” object, the last line is your last change. The field “Action Type” shows which trigger saved the history. With the button Code you can see the code.

48_source-code-of-the-vendor-table.png

C/AL History Lines. To analyze the changes you can use the function Compare.

49_compare-two-versions.png

Restore an Object

In the “C/AL History Objects” page you can restore an object to a previous version. Press Restore.

50_restore-object.png

A new line of Action Type Restore is added to the C/AL History table.

51_object-restored.png

Compare two Versions

Show Last Changes will open your compare tool and show the changes you made compared with the previous version of the object.

Analyze Modifications Made in a Project

You can compare changes of a project by using the function Show Changes in Directory. This function opens the compare tool and shows you the differences in objects and code of the specific project. It is also possible to see the changes in one file. For example if you use UltraCompare which does not have the option of comparing directories.

52_changes-on-project.png

Analyze Modifications Made in a Transport

You can compare changes in a transport by using the function Show Changes in Directory. This function opens the compare tool and shows you the differences in objects and code of the specific transport.

53_changes-on-transport.png

Analyze Modifications Made in a Period of Time

With the report Compare C/AL Code you can analyze all the modifications that are done in a specific period of time.

54_changes-in-period.png
55_changes-in-period-2.png

Merge C/AL History

With this option it is possible to merge two C/AL History records in an external editor and save your changes automatically back into the database.

There are 2 options:

  • Merge into Old – The oldest C/AL History record will be imported in the database when you are done.

  • Merge into New – The newest C/AL History record will be imported in the database when you are done.

Select the two history records you want to merge and press Merge into New.

56_merge-c-al-history.png

The merge tool will open where you can merge the differences. In our example the customer table overwritten by a colleague and your change was lost.

57_overwritten-modification.png

We merge the change into the new version and close the merge tool. Now you see the dialog in NAV that is waiting at your confirm.

58_dialog.png

There are 2 options:

  • Compile – Object will be compiled.

  • Set Modified Flag – The timestamp of the object will be changed to the current date and time and the modify flag will be set. If this option is disabled the date and time of the merged text file will be used.

Related content

IDYN 2024