<img alt="" src="https://secure.intelligent-consortium.com/791393.png" style="display:none;">

How to Fix Your [LineStart(185)] Woes during Object Compares in Dynamics 365 BC

Note: This short tutorial is intended for C/AL-only or Hybrid in Dynamics BC.

The Task

You need to compare and merge objects exported from Dynamics BC. Your customer develops objects directly in C/AL, and they want to add an ISV solution without an extension option. To get the ISV solution into their database, you need to use a compare and merge.

The Problem

If we export the table from the object designer and then from PowerShell for table 18 from Dynamics BC RTM, you will find this [LineStart(###)] text.

Screenshot of code highlighting LineStart(173)

Comparing RTM and CU4 using the Object Designer, you will find significant differences. These include both actual changes and the [LineStart] text is included, just like the text file created from the export from the development environment.

Here is where it really can make a difference…

I added one line of code to table 18 in the AssistEdit function. This should only return date time differences and my one line of code. That’s not what happens though! I get 71 differences because that line of code alters the [LineStart()} values from that line all the way to the end of the file.

Screenshot of code

When I export from PowerShell, however, I get the expected result. Date time difference and the line of code I added.

Nathan_2

Using the PowerShell script without the switch listed above will make comparisons much simpler and much faster.

Further Application

This solution can also be helpful when comparing a previous version to BC. For example, NAV does not create a text file with LineStart.

In my example below, I have exports from the development environment NAV2018 on left and BC 140 on the right. The PowerShell export would exclude the LineStarts on the right file, which makes the number of differences in the compares much smaller.

Nathan_6

For more helpful tips and tricks to help you work in and around Dynamics 365 Business Central more effectively, keep up with our latest blogs.

Read our Blog

Nathan Peters

Nathan Peters

Nathan Peters is a Senior Development Consultant at Innovia Consulting. He has worked with NAV/Business Central for more than 12 years. He has specific expertise in SQL, databases, and integrations.

Related Posts