How to add keys in Base table of Business Central

With the release of Wave 1 2021 lot of new feature introduced . One of the new feature is that partners now can add keys in base table with customized field which was not possible earlier

Today we will see how we can do that

First Lets see what is happening is earlier version of business central. In earlier version we can only add the keys with the field added on table extension and we are not able to see the field available in base table for adding in keys

Look at the following example as I created one simple extension in V17 and trying to add key

Now when I try to add the keys in this table extension it will populate only those fields which are added in table extension

In New version of Business central i.e. Wave 1 2021 we can Add more keys with base table fields and use to improve the performance while retrieving or updating records

Now look at the following example for new version .Just created a simple table extension

Now when I try to add the keys in this table extension it will populate all the fields available in base table as below

So that means we can create keys with

  1. Fields from base table
  2. Fields from table extension

Can I create combination of fields from base table and fields from table extension ?

And the obvious answer is no and reasons are simple that both base table and table extension are two different tables in Sql server.

I hope you will find this information useful

So stay tuned for more updates.

Cheers.

Microsoft Dynamics 365 Business Central 2021 Virtual Event

Get Ready for yet another virtual launch of business central Wave 1 2021 and it is streamed on 13th April 2021

Image

This will a free virtual event for everyone from reselling partners, consultants, and ISV partners.

You can join from following link

https://events1.social27.com/msdyn365bclaunchevent2021w1/auth/register

Lets drive more deep in Business central with this event and don’t forget to get you system check specially for internet.

Cheers..

How to restore environment in business central

Have you guys remember my tweet regarding the restoration of environment .Following is the tweet

If you still not follow me on then please follow me on twitter for more updates

So in month of November 2020 I faced this problem as due to some issue production environment got hanged and user abruptly close the session .Post that data in some tables got messy and couldn’t recover in time and then I need to contact MS guys to restore environment which took almost a week and till that time customer transaction got halted. That time question came to my mind how customer will handle all these things by going forward and MS guy responded me that time that this feature is going to added in Admin center in upcoming release.

Now with released of Business central 17.3 this feature become reality .It is still in preview mode.

Lets look at how to restore the environment

To restore environment you need to have access to admin center.

  1. Go to Admin center.
  2. Select Environment

3. Click on Restore

4. In the restore environment window select date and time to which you want to restore the environment.

5. Select the type of environment such as sandbox or production.

6. Finally Name for restored environment.

7. Hit the restore

Important points

  1. Backups are available for past 30 days
  2.  The number of restore attempts will be limited to 10 attempts per environment/per month.
  3. The recovery is allowed within a maximum of three immediately preceding versions of Business Central (including minor and major updates), but still within a maximum of 30 days (from the point of the environment creation)

Hope this will help you.

Stay tune for more.

Upcoming New Features with Business Central

Recently Microsoft releases plan for major version of Microsoft Dynamics 365. This blog post actually focused on those features which I am looking forward to and may be every one in community.

Lets Start

Partners can add keys to base tables and table extension

Does anybody remembered this points which I raised in year 2017 on GitHub and finally this is going to add in April 2021 and I am looking forward to it as it is not supported and I have restructure the app.

Report Extensibility

This feature is everybody awaiting because if we need to change in any base app report then we need to copy that report ,make changes and use report substitution to display the customize report. Looking forward for new report extension object where in one can change layout and dataset.

Dimension Correction

In Year 2016 I wrote this blog post for updating the dimension and not it is going to be add as feature in Business central. This will help end users for updating the incorrect dimensions.

Above all it from April 2021 onwards Business Central will be available in India

Apart from above lot of new features are added in upcoming version of business central

Administration

Improve the reliability of the database export operation for larger databases with more companies

Improvements for the Delegated Administrators

Reassign an environment from one Azure Active Directory organization to another (through Microsoft Support)

Application

Assisted setup helps move the task of adjusting item costs to the background

Automatic creation of lot and serial number information cards

Bank reconciliation improvements

Changes in synchronization between contact and customer

Define lot sizes for various stages of production

More control over settings for default dimensions

Payment reconciliation journal improvements

Simplified bank statement file import

Better with Microsoft 365

Look up Business Central contacts from within Microsoft Teams

Enablement of Word merge in Business Central

Support cloud printing using Microsoft Universal Print


Modern development tools

Extension validation on upgrade

Interface – obsolete support

Return record link instead of name when using lookups

For more information please visit here on official sites of Microsoft

Stay tuned for more updates.

How to kill session in Business Central

Recently faced a problem of table locking which goes in not responding stage and finally user close the tab ,but when user opens the session again it actually messed up the critical data (It seems unimaginable force was roaming that time when this happens). Eventually after trying couple of days for data correction I need to contact Microsoft to restore the database.

When this happening my customer asked me if something like this happen then can we kill or cancel the session of user and then I came across this feature of Business Central admin center.

How to access admin center

This can be by adding tenant id with your business central URL as below

https://businesscentral.dynamics.com/%5BTenant Id]

This will open admin center as below.

In this portal you can see all the environment including sandbox.I can see this is your control center for managing business central on cloud.

Now next step is click on required environment which will navigate to other screen.

To see all the session click on session

This will show you call the required session for the selected environment.

Now to cancel the session select the required session and click on Cancel session .This will kill the required session.

Another advantage of this screen is that it show other information like which operation is going on ,which object is involved in current operation and duration of current operation.

Hope this will help you to cancel the unwanted session

Stay tuned for more..

How to check financial journals in background in business central

With the release of Business Central Wave 1 2020  new feature added to check validation in background for financial journals

As of now this feature is need to enabled from Feature management

This features will helpful to financial users to check the issue before posting. Before this feature we have Test Report and Preview Posting to check the issues before posting. Advantage of this feature is that this feature is can be enabled for specific batch .

To enable this feature on batch go to General Journal batch and enabled this feature for required batch.

Once this will enabled on batch this will show journal check on journal screen as follows

Enter the transaction in journal and if entry is erroneous then it will show the error as below

For more details of the error you can click Issues total to see the details of issues

Even this factbox shows the the lines which shows which lines are correct and incorrect.

Hoe this will help you to deal with financial journals validation.

Apart from this you can check financial features Copy journal lines to posted.

Stay tuned for more.

How to add XML comments in AL Code :- Business Central

With the release of Business Central Wave 1 2020 XML comments is available in AL code.

If you would like to add documentation to your code then you can use XML documentation .The documentation comment must immediately before the object such as codeunit,table,functions etc.

The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags. There is IntelliSense support for writing documentation comments. Most importantly providing a template documentation comment when writing the third slash in the triple slash.

These documentation comments are visible when hovering over source symbols.

Advantage :

  1. XML document comment will improve readability ,add useful information about the code implementation and help others take over your code .
  2. With XML comments it also enable intellisense in AL objects that you add in your code as a help to other developers who is going extend your code.

Let sees an example how we can add the xml comments.

Created one simple code unit where we can add documentation comments.

Please note that If you have the showMyCode setting in the app.json file set to false and download an app package; the app package will not contain any XML comments.

Hope this will help you.

How to Delete extension data in business central

With the release of Business Central Wave 1 2020 new feature added to delete the extension data from production or sandbox. Prior to that we can uninstall the extension but data still there for the extension.

This feature will be useful when

1) Application is not in use.

2) Customer have desire to reinstall the extension data from scratch.

Let see how to uninstall and delete the extension data.

1) Launch the business central and search for extension management.

2) Select the required extension for uninstall. In this you can see new option added for delete extension data .

3) After selecting the option then you will get following warning message.

4) After click ‘YES’ then you can see ‘Delete Extension Data’ will get enable as follows

5) After that you can click on Uninstall then system will again warn before starting deleting data from extension.

6) If you are sure then click ‘YES’ and it will start processing to delete the data. This can not be undone.

Hope this will help and stay tuned for more.

If you like my blog then please connect me on

Blog :-https://ammolhsaallvi.blog/

Twitter :-https://twitter.com/ammolhsaallvi

LinkedIn :-https://in.linkedin.com/in/amolsalvi

How to Copy Journal Line to Posted General Journal in Business Central

With the release of Business Central Wave 1 2020 new feature added to copy the general journal to posted general journal.

As you aware that whenever you post the journal entry the entries get deleted after posted the transaction. Now whenever accountant need to reverse the entries then they need to enter the same entries again with opposite sign.

With this new version of business central new feature is added to copy the general journal to posted general journal. This feature is enabled based on setup. This setup is enable on Gen Journal Templates so we have leverage to enable this setup on required templates.

  1. Search for Gen Journal Templates

Enable the field Copy to Posted Jnl Lines. for required template. Once it is enabled on template then it will be applicable for all batches under that template.

2. Go to Journal screen and enter the required details to post journal entry and post it.

3. After posting search for Posted general journal

On this screen you will find two options

  1. Copy Selected Lines to Journal  :-This function to create a copy of a general journal line or a batch with opposite signs (a reversing journal), a different posting date or document number.

The result will be as follows

2. Copy G/L Register to Journal :- This function will copy all journal lines that belong to selected G/L Register to target General Journal.

This will help when working with journals and we need to have easy way to correct the mistake happen in single entry. This will make accountant more productive.

Hope this will help you. Personally I like this feature

Stay tuned for more updates.

Connect Me on

Blog :-https://ammolhsaallvi.blog/

Twitter :-https://twitter.com/ammolhsaallvi

LinkedIn :-https://in.linkedin.com/in/amolsalvi

How to Use SetLoadFields in Business Central for performance

With the release of Business Central Wave 1 2020 the partial records capability is available.

The partial records capability is allows for loading a subset of normal table fields when accessing the data source based on SQL.

To access the data source we use GET ,FIND NEXT. When we use these methods then runtime it load all fields and will hamper the performance while fetching the records.

Now from business central wave 2 2020 we can use ‘Partial records’ capability.

To accommodate partial records following methods available in business central. These methods are avaaible on RecordRef and Record datatype in AL. These methods are loaded in two groups i.e. Subsequent loads and Current load

MethodDescription
SetLoadFieldsSpecifies a set of fields to be initially loaded when the record is retrieved from its data source.
AddLoadFieldsAdds fields to the current set of fields to be initially loaded when the record is retrieved from its data source.
AreFieldsLoadedChecks whether the specified fields are all initially loaded.
LoadFieldsAccesses the table’s corresponding data source to load the specified fields.

Lets See few examples of these methods

Following example is for summation of Quantity fields from Item Ledger Entry .In this we would like to make calculation of only Quantity fields and not require the others fields to be loaded.

If you see SetLoadFields is call before data fetching operation starts. This will determine which fields needed for Find Set Call.

Advantage of this is that it gives you ability to load only those fields which are required to perform the operation which will make execution of code faster and give more performance. This feature is recommended to use while fetching the records and not for Insert,Modify or Delete operation.

Using the above method we added the required fields but what will happen to other fields which hasn’t been loaded .In such cases platform does an implicit GET and loads the missing fields, called as JIT Loading (Just in Time).

When JIT loading occurs, another access to the data source is required. These operations tend to be faster because they’re GET calls. GET calls can often be served by the server’s data cache or become clustered index seeks on the database.

Iterating over records in the database, enumerator is created based on selected fields and row is fetched when NEXT is called. but certain operations will not follow enumerator like if we passing a record by value and not by VAR .This operation actually creates new copy of the record and original records and copy of the record not share the filters ,selected field for loading. That means to access unloaded fields it need to trigger JIT load and but it will not update enumerator which means for future iterations also require JIT load.

To overcome such situations we can do following

  1. Pass the record reference using VAR.
  2. Call AddLoadFields on the original records before passing by value.
  3. Use SetLoadFields before calling FIND,GET,NEXT.

Hope this will help you to understand for partial records and stay tuned for more updates.

For more updates you can follow my blog on following channels.