Friday, June 24, 2016

Dynamics NAV - How to Add dimension values to posted transactions

Problem:
Sales transactions have been posted, but users forgot to add dimensions to the sale.
The end result is your Sales figures on your account schedules go to Dimension "" instead of a proper dimension

Solution:
Use the T480 "Dimension Set Entry" Table to find the "Dimension Set ID" (column in your table) value for the dimension you need to add


  • General Ledger Entries
    • Enable the dimension column in NAV (Named your dimension name) and filter to see which transactions are missing dimensions
    • Run this script to update the Dimension valus on all GL trx for a specific sales transaction
    • update [CRONUS].[dbo].[CRONUS$G_L Entry] SET [Global Dimension 1 Code] = 'DIMVAL' ,[Dimension Set ID] = 12 where [Source Code] in ('SALES','INVTPCOST') and [Global Dimension 1 Code] = ''
  • Sales Orders
    • update [CRONUS].[dbo].[CRONUS$Sales Header] SET [Shortcut Dimension 1 Code] = 'DIMVAL' ,[Dimension Set ID] = 14 where [Shortcut Dimension 1 Code] = '' and [External Document No_] = '5257'
    • update [CRONUS].[dbo].[CRONUS$Sales Line] SET [Shortcut Dimension 1 Code] = 'DIMVAL' ,[Dimension Set ID] = 14 where [Shortcut Dimension 1 Code] = '' and [Document No_] = (select [No_] from [CRONUS].[dbo].[CRONUS$Sales Header] where [External Document No_] = '5257')
  • Sales Invoices
    • update [CRONUS].[dbo].[CRONUS$Sales Invoice Header] SET [Shortcut Dimension 1 Code] = 'DIMVAL' ,[Dimension Set ID] = 14 where [Shortcut Dimension 1 Code] = '' and [External Document No_] = '5257'
    • update [CRONUS].[dbo].[CRONUS$Sales Invoice Line] SET [Shortcut Dimension 1 Code] = 'DIMVAL' ,[Dimension Set ID] = 14 where [Shortcut Dimension 1 Code] = '' and [Document No_] = (select [No_] from [CRONUS].[dbo].[CRONUS$Sales Invoice Header] where [External Document No_] = '5257')



Additional Notes:
To prevent this from happening in the future, you can set required dimensions on ALL accounts. vendors, customers, etc.
Search Dimensions>Navigate>Dimension>Account Type Default Dim
https://msdn.microsoft.com/en-us/library/hh167859(v=nav.70).aspx

However, if this is too general, you can set specific customer dimension defaults
Customer>Actions>Dimensions
This will allow you to set a required dimension for each customer.
If you leave it blank, it will require a value before posting.


No comments:

Post a Comment