Friday, January 5, 2018

Dynamics NAV - "The Array Dimensions must be identical"

https://dynamicsuser.net/nav/b/mark_brummel/posts/inside-nav-2017-improvement-comes-with-a-price


  • C365 Format Address requires CustAddress Array input, but this does not exist in most report function coding
    • Solution
      • Adjust the SalesInvShipTo function to the following
      • Remove the CustAddr Parameter

SalesInvShipTo(VAR AddrArray : ARRAY [8] OF Text[50];VAR SalesInvHeader : Record "Sales Invoice Header") ShowShippingAddr : Boolean
WITH SalesInvHeader DO BEGIN
  FormatAddr(
    AddrArray,"Ship-to Name","Ship-to Name 2","Ship-to Contact","Ship-to Address","Ship-to Address 2",
    "Ship-to City","Ship-to Post Code","Ship-to County","Ship-to Country/Region Code");
END;

Wednesday, January 3, 2018

Dynamics NAV LS OMNI - 10012900 WI Ls Mgt runs for all items and takes too long

10012867 WI Item With Daily Updates will populate based on changes required to sync to OMNI
If for some reason this table does not get cleared, it will always keep trying to update the same items even if no updates are necessary
Clear this table to reset the replication

Dynamics NAV LS OMNI - Retail Selling Prices show up as 0

Sales prices not coming up
- Retail Item>Distribution>Must exist in webstore
- Store must have func profile
- Uses Store.CurrencyCode (must match sales price currency code)
- Store Price group limits price check to that group, else uses item card price
- Uses Store Vat Posting Group - Must match sales price vat posting group


10012900 WI LS Mgt populates WI NC Product and WI NC Price

Thursday, December 21, 2017

Dynamics NAV - Intercompany - The General Journal Template already exists

This can happen when copying companies for intercompany setup.

When selecting Sales Journals Page, you get this error


Navigate to General Journal Templates
Delete the template producing the error

Wednesday, December 20, 2017

Dynamics NAV - Message: An item with the same key has already been added.

Problem:
This error occurs after a separate NAS service has been started.
The service itself runs, but the window error log shows this error, and the NAS does not execute any scheduled tasks.



Solution:
Google has Vague descriptions about problems with duplicate language codes, or duplicate keys in tables.

It may have to do with sql security after restoring a db to a new sql server that has the same user accounts, but in caps or commons.
Remove all users from the db and re-add them to ensure the security on the db corresponds to the actual users on the machine.

Set SQL to run as the same account the NAV Instance is running under
Ensure the account is a member of db_owner in the company db

Run the Fix Orphan Script
---------------------------------------------------
SET NOCOUNT ON
USE AdventureWorks
GO
DECLARE @loop INT
DECLARE @USER sysname
DECLARE @sqlcmd NVARCHAR(500) = ''

IF OBJECT_ID('tempdb..#Orphaned') IS NOT NULL
 BEGIN
  DROP TABLE #orphaned
 END

CREATE TABLE #Orphaned (UserName sysname,IDENT INT IDENTITY(1,1))

INSERT INTO #Orphaned (UserName)
SELECT [name] FROM sys.database_principals WHERE [type] IN ('U','S') AND is_fixed_role = 0 AND [Name] NOT IN ('dbo','guest','sys','INFORMATION_SCHEMA')

IF(SELECT COUNT(*) FROM #Orphaned) > 0
BEGIN
 SET @loop = 1
 WHILE @loop <= (SELECT MAX(IDENT) FROM #Orphaned)
  BEGIN
    SET @USER = (SELECT UserName FROM #Orphaned WHERE IDENT = @loop)
    IF(SELECT COUNT(*) FROM sys.server_principals WHERE [Name] = @USER) <= 0
     BEGIN
        IF EXISTS(SELECT 1 FROM sys.database_principals WHERE [Name] = @USER AND type_desc = 'WINDOWS_USER')
         BEGIN
            SET @sqlcmd = 'CREATE LOGIN [' + @USER + '] FROM WINDOWS'
            Exec(@sqlcmd)
            PRINT @sqlcmd
         END
        IF EXISTS(SELECT 1 FROM sys.database_principals WHERE [Name] = @USER AND type_desc = 'SQL_USER')
         BEGIN
            SET @sqlcmd = 'CREATE LOGIN [' + @USER + '] WITH PASSWORD = N''password'''
            Exec(@sqlcmd)
            PRINT @sqlcmd
         END
     END
   
    SET @sqlcmd = 'ALTER USER [' + @USER + '] WITH LOGIN = [' + @USER + ']'
    Exec(@sqlcmd)
    PRINT @USER + ' link to DB user reset';
    SET @loop = @loop + 1
  END
END
SET NOCOUNT OFF
------------------------------------------------------------

Monday, December 18, 2017

Dynamics GP - Printing to File - Selecting DOCX but only getting HTM in file location

Word Form Template for this report does not exist.

Create a word form template for this report using the correct original or modified version.
Create it from existing report, not blank.

Saturday, December 16, 2017

Dynamics NAV - Setup Flow Fields


  • Go to Table
  • Create new field
  • Click properties
    • Switch Fieldclass to Flowfield
    • Use Lookup if you just need to get a value from a related table eg. Barcode, Shipment No.
    • Set Calcformula to your formula
    • Set editable to no
  • These fields are available and sortable in pages