Add, Add by Dimension, Add by Filter, Add Related Entries, Analysis Views, BC18, Business Central, Change, Combinations, Completed, Correction, Correction Setup, Delete, Dimension, Dimension Corrections, Draft, Dynamics 365, Functional Tips, G/L Entries, G/L Register, General Ledger Entries, History, How To, Information, Modify, Posted General Journal, Reversing, Run, Schedule, Select Manually, Tip & Tricks, Trace, Undo, Updating, Validate, What's New

How can we Correct Dimension in Microsoft Dynamics 365 Business Central?

You can do correction by reversing the journal or creating a credit memo for the document, which will be time consuming and can attract to even more errors.

Now you can correct dimensions for general ledger (G/L) entries to ensure your financial reports is providing you with accurate insights. For G/L entries, you can now

  • change the dimension values
  • add new dimensions
  • remove wrong ones

You can also trace a history of the corrections that you have done and can undo corrections in case you had made a mistake in the corrections itself.

Before you continue let me remind you:

Although the Dimension Correction feature only updates general ledger entries, still it can be helpful in many cases with creating accurate financial reports.

You must decide when to use the corrections because when you perform correction, it will result in differences between the dimensions in finance and sub-ledgers. The earlier you decide on what corrections to use, the less manual corrections you’ll need to do in the future.

I am using BC18 Demo database.

 How to run the Dimension Correction

General Ledger Entries. You can change the dimensions for single or multiple entries just by selecting the entries.

G/L Register. You can change the dimension per batch posting. By using “From Entry No.”, “To Entry No.” as a filter for General Ledger Entries.

Posted General Journal. You can use “Document No.” and “Posting Date” as filters for General Ledger Entries.

Search for Dimension Corrections Page.

Draft Dimension Correction Screen:

Depending upon from where you Launched the Dimension Correction, it may come with pre-filled or as blank screen.

You have several options to work with dimensions:

  • You can Add New Dimensions
  • You can Remove existing Dimensions
  • You can Change the existing Dimensions

For Selecting Entries to which above changes applies you have different options to work with.

  • Add related entries. This requires at least 1 G/L Entry already to be selected, and then it adds all other G/L Entries with the same “Transaction No”.
  • Select Manually. You can manually select in the G/L Entries by just choosing them.
  • Add by Filter. Here you have all freedom of choice, how to filter your G/L Entries for the dimension corrections.
  • Add by Dimension. This can be useful if you want to change the dimension value Sales to Admin for all G/L entries. So, you find all G/L Entries with the Dimension Sales.

You can omit/remove selected entries, or change selection criteria for your entries to be applied with changes.

Updating Dimension Values

Above we create a Dimension Correction, the Status is initially DRAFT, it means the G/L Entries Dimension is NOT yet updated.

Once you are done in the Dimension change to move forward you have two option to go thru:

  • Click the Validate dimension change then click RUN.
  • Click RUN.

Validate change

This will check if it’s possible to make the dimension changes you specified.

  • Check Dimension Correction Setup.
  • Check Dimension Combinations.

Once the validation run successfully you can see it in the Validation status.

You can choose to run the job immediately or schedule in case you are operating on larger data set.

Next you can now use the Run action button. This will Apply changes to the General Ledger Entry Dimensions.

How to trace the correction

General Ledger Entries. You can see all the dimension corrections that you’ve done for the selected entries.

Search the Dimension Corrections. You can see all the Dimension corrections that you’ve done even the ongoing dimension corrections will be listed here.

Undo a Correction


In the dimension correction page just click the UNDO. This will be executed as a Job. The user will have to choose, how he wants to apply changes: running the job immediately or schedule it.

It is recommended to run the schedule if you are working with larger data set, to avoid the table locking during posting of other transactions.

Once the Job execution completes, you will see the status change to UNDO COMPLETED.

How to Update the Analysis Views

From the Dimension Correction page, you can also update you’re Analysis Views by clicking the Update Analysis Views button. This will be executed as a Job. You will have to choose, how you want to apply changes: running the job immediately or schedule it.

It is recommended to run the schedule if you are working with larger dataset, to avoid the table locking during posting of other transactions.

Hope you enjoyed the information. Will come with more similar information in my next posts. Till then keep exploring, learning and sharing your knowledge with others.

Remain safe, take care of your loved ones, put your mask, maintain safe distance and don’t forget to get vaccinated.

Advertisement
Backup, Development Tips, How To, Information, PowerShell, Schedule, Server, SQL, Tip & Tricks

SQL Server Database Backup using PowerShell

In this post we will see how we can take backup of databases from SQL Server using PowerShell and schedule it as a daily run Plan.

Step-1 : We will create Powershell Script to take backup of Databases in SQL Server.

SCheduleJob-18

Here is the full Script for your ready refrence.

param( $serverName, $backupDirectory )

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.SMO”) | Out-Null

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.SmoExtended”) | Out-Null

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.ConnectionInfo”) | Out-Null

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.SmoEnum”) | Out-Null

$server = New-Object (“Microsoft.SqlServer.Management.Smo.Server”) $serverName

$dbs = $server.Databases

foreach ($database in $dbs | where { $_.IsSystemObject -eq $False })

{

$dbName = $database.Name

$timestamp = Get-Date -format yyyy-MM-dd-HHmmss

$targetPath = $backupDirectory + “\” + $dbName + “_” + $timestamp + “.bak”

$smoBackup = New-Object (“Microsoft.SqlServer.Management.Smo.Backup”)

$smoBackup.Action = “Database”

$smoBackup.BackupSetDescription = “Full Backup of “ + $dbName

$smoBackup.BackupSetName = $dbName + ” Backup”

$smoBackup.Database = $dbName

$smoBackup.MediaDescription = “Disk”

$smoBackup.Devices.AddDevice($targetPath, “File”)

$smoBackup.SqlBackup($server)

“backed up $dbName ($serverName) to $targetPath

}

Save this Script file as ps1 extension.

You can create the script using even notepad.

 

Step 2: We will Create Batch file to call PowerShell scrip and to be used in Windows scheduler.

SCheduleJob-18

Save as .BAT file. Here is the batch script for ready refrence:

powershell -ExecutionPolicy RemoteSigned

-File “C:\User Data\SQL Backup\Tools\SQLServerBackupAllDatabase.ps1”

-serverName “INDEL-AXT5283NB”

-backupDirectory “C:\User Data\SQL Backup”

>> “C:\User Data\SQL Backup\LOG\\%date%.log”

Step 3 : Create a Windows Scheduler

Open Windows Task Scheduler.

Create New Task as shown below :

SCheduleJob-18

Enter Name & Description on General Tab as shown below:

SCheduleJob-18

On Trigger Tab create New Trigger and enter details as shown below :
SCheduleJob-18

On Action Tab Create Action and enter information as shown below : Here Select the batch file created in Step 2.

SCheduleJob-18

In Settings Tab do the setting as shown Below :

SCheduleJob-18

Click on OK to Save the Task and return to Task Scheduler Window.

Here you can see the newly created Task.

SCheduleJob-18

When Task is executed you will find the backup of databases at defined path in the script.

SCheduleJob-26

You can also find Log file at the path defined in batch.

SCheduleJob-27

Thats all for this post, will come up will more information in my up comming posts.

Backup, Corfu Navision 2016, How To, Information, Job, Schedule, SQL, Tip & Tricks

Schedule SQL Job for SQL Database Backup

 

Today we will see how we can schedule to take daily backup of our database.

Before i start explaining the step i am confirming the version of SQL based on which i am writing this post.

Process will remain same may be screen bit different in different versions of SQL.

SCheduleJob-1

At first we will ensure that SQL Server Agent is running, in case it is not right click and Start it.

SCheduleJob-1

Expand the SQL Server Agent Folder, Select Jobs, Right click and select New Job.

SCheduleJob-1

Provide Name & Description to your New Job.

SCheduleJob-1

Select Page Steps & New from Bottom of the page to define Step for your Job.

SCheduleJob-1

Give name to the Step.

Select Type as Transact Script (T-SQL).

Select Database Name in my case i am selecting Demo Database NAV (9-0)

Write the Script as shown below:

SCheduleJob-1

Here is the Script for your ready reference:

{– Script Start

SET QUOTED_IDENTIFIER off

select getdate() “Start Time”

set nocount on
declare @dbname varchar(36),@cmd varchar(255)

declare dbname_cursor cursor
for select name from master..sysdatabases where name = ‘Demo Database NAV (9-0)’
order by name

open dbname_cursor
fetch dbname_cursor into @dbname

while @@fetch_status = 0
begin
DECLARE @DATE VARCHAR(36)
SELECT @DATE = (select CONVERT(char(8),DATEADD(dd,-30,GETDATE()),112))
if DATABASEPROPERTYEX(@dbname,’Status’) = ‘ONLINE’
begin
select @cmd =’backup database [‘+@dbname+’] to DISK=”C:\User Data\SQL Backup\’+@dbname+’.bak” with init’;
print @cmd
execute (@cmd)
end
fetch dbname_cursor into @dbname
end

close dbname_cursor

deallocate dbname_cursor

select GETDATE() “End Time”

–Script End}

Although above script is for multipurpose like if you want to backup all database on your SQL Server, you can make small tweaking and you are done.

If you would like to backup all the databases on a particular SQL Server, then make the following changes to the code above.

Replace following line of code:

for select name from master..sysdatabases where name = ‘Demo Database NAV (9-0)’

with the following line of code:

for select name from master..sysdatabases where name != ‘tempdb’

This will create a backup file for each database on the server, except for the temp database.

Next : Switch to Advanced Page.

Define other parameters as shown in below screen as per your requirement.

SCheduleJob-1

On Selecting OK, you will return to Job window.

SCheduleJob-1

Select Schedule Page:

Define your Schedule as per your requirement.

SCheduleJob-1

Select OK to return to Job Page.

SCheduleJob-1

Select OK to close and save the JOB.

Now our Job is  created and scheduled.

You can see defined Jobs and its Status using Job Activity Monitor.

Before Job is executed

SCheduleJob-1

After executed you can see the Status as.

SCheduleJob-1

Post execution of Job here is the backup file created at defined path in the Script. Above script will overwrite the file on next execution.

If you want to create new file on every execution you need to modify the script for file name by adding timestamp or any other logic you desire.

SCheduleJob-1

I will come up with more information in my upcomming posts.

thats all for this post.