Tuesday, January 21, 2014

Dynamics GP - The sales distribution amount is incorrect

Problem:
You get this error even if you default the distributions correctly.

Solution:
this is happening because the MRKDNAMT and ORMRKDAM fields do not match the total markdown for all the line items.
This generally occurs if the transaction has been imported, and the MRKDNAMT field has been set.

To resolve this issue, default the distributions, and note the total markdown amount.
Run this script and set the fields to the correct markdown amount

update SOP10100 set MRKDNAMT = 1.25,ORMRKDAM = 1.25  where SOPNUMBE = 'inv00012'

Thursday, January 9, 2014

Dynamics GP - Remove CEIP and Reminders - Slow login or startup due to reminder list

http://support.microsoft.com/kb/916997

SQL - Attempt to fetch logical page in database 7 failed. It belongs to allocation unit

SQL 2008 R2 - Failed to flush the commit table to disk

Other errors
Failed to flush the commit table to disk in dbid 10 due to error 2601
Failed to flush the commit table to disk in dbid 8 due to error 8630

Solution 1 (does absolutely nothing):
This issue is resolved in the latest service pack

http://support.microsoft.com/kb/2527041

If the service pack does not resolve the issue, you must repair your SQL installation
Launch SQL Install>Maintenance>Repair


Solution 2 (this one worked for me):
Run a

DBCC CHECKDB (two) WITH NO_INFOMSGS, ALL_ERRORMSGS

then most likely a

ALTER DATABASE two SET SINGLE_USER
GO
DBCC CHECKDB (two,repair_rebuild)
GO
ALTER two SET MULTI_USER
GO

Solution 3 (others have reported this, i tried it, it did not work):
You can also disable change tracking on all objects and the database, and delete the uncommitted transactions

--Find all objects with change tracking
select (select OBJECT_NAME(object_id)) from  sys.change_tracking_tables

--Disable change tracking on each object
alter table GL00102 disable change_tracking
alter table MC00200 disable change_tracking
alter table GL10001 disable change_tracking
alter table GL10100 disable change_tracking
alter table GL10101 disable change_tracking
alter table MC40000 disable change_tracking
alter table SY00300 disable change_tracking
alter table GL40000 disable change_tracking
alter table GL12000 disable change_tracking
alter table GL00201 disable change_tracking
alter table GL12001 disable change_tracking
alter table GL10000 disable change_tracking
alter table GL32000 disable change_tracking
alter table GL40200 disable change_tracking
alter table GL20000 disable change_tracking
alter table GL00200 disable change_tracking
alter table GL00100 disable change_tracking
alter table GL30000 disable change_tracking
alter table SY40100 disable change_tracking
alter table SY40101 disable change_tracking



--Disable Change tracking on database
ALTER DATABASE AdventureWorks2012
SET CHANGE_TRACKING = OFF

--Delete the sys.syscommittab table
Click New Query
Click Change connection to bring up the login screen for the query
enter ADMIN: before your sql server name to use the DAC connection
Select your company
--backup the syscommittab table
select * into dbo.syscommittab_bak from sys.syscommittab
delete sys.syscommittab

--Enable change tracking on each object
alter table GL00102 enable change_tracking alter table MC00200 enable change_tracking alter table GL10001 enable change_tracking alter table GL10100 enable change_tracking alter table GL10101 enable change_tracking alter table MC40000 enable change_tracking alter table SY00300 enable change_tracking alter table GL40000 enable change_tracking alter table GL12000 enable change_tracking alter table GL00201 enable change_tracking alter table GL12001 enable change_tracking alter table GL10000 enable change_tracking alter table GL32000 enable change_tracking alter table GL40200 enable change_tracking alter table GL20000 enable change_tracking alter table GL00200 enable change_tracking alter table GL00100 enable change_tracking alter table GL30000 enable change_tracking alter table SY40100 enable change_tracking alter table SY40101 enable change_tracking
--Enable Change tracking on database
ALTER DATABASE AdventureWorks2012
SET CHANGE_TRACKING = ON

Wednesday, January 8, 2014

Dynamics GP - Reconcile to GL - Inventory - Violation of Primary Key contstraint... Cannot insert duplicate key in object

Related Issues

  • The excel sheet will still be generated after clearing the error
  • The reconciled excel sheet shows no matched transactions
  • All transactions appear as unmatched



--The problem occurs when this script is trying to run, but returns duplicates

BEGIN DECLARE @stored_proc_name char(28) DECLARE @retstat int set nocount on SELECT @stored_proc_name = 'ATLT.dbo.glGetIVTransactions'
EXEC @retstat = @stored_proc_name '2013.11.01', '2013.11.30', '##1765136' SELECT @retstat set nocount on END


--The constraint in question is this one
ALTER TABLE ##1765136 ADD CONSTRAINT PK##1765136 PRIMARY KEY NONCLUSTERED (TRXSORCE, DOCNUMBR, DOCTYPE, JRNENTRY, ACTINDX, ITEMNMBR)


--Send the output to a clean temp table

select * into temp_GLIVREC from dbo.##1765136
BEGIN DECLARE @stored_proc_name char(28) DECLARE @retstat int set nocount on SELECT @stored_proc_name = 'ATLT.dbo.glGetIVTransactions'
EXEC @retstat = @stored_proc_name '2013.11.01', '2013.11.30', 'temp_GLIVREC' SELECT @retstat set nocount on END


--Review the output by running this query to identify any duplicates

SELECT     TRXSORCE, DOCNUMBR, DOCTYPE, JRNENTRY, ACTINDX, ITEMNMBR
FROM         temp_GLIVREC
GROUP BY TRXSORCE, DOCNUMBR, DOCTYPE, JRNENTRY, ACTINDX, ITEMNMBR
HAVING      (COUNT(TRXSORCE) > 1)

--I found that i was getting duplicates due to transctions in the SEE30303 table having blank TRXSORCE values. To resolve the issue, i populated the trxsorce with the dexrowid because i was unsure if the records should be deleted or not. I kept a backup of the SEE30303 table in case we needed to reset the data

select * into see30303_bak from SEE30303
update see30303 set TRXSORCE = DEX_ROW_ID where TRXSORCE = ''

Tuesday, January 7, 2014

Dynamics GP - SOP Posting - Unable to obtain Receivables Document Number

Solution here

http://support.microsoft.com/kb/856940

Run these scripts

--Confirm document started posting
SELECT * from RM00401 where DOCNUMBR = '509924'
--Confirm status is not 0
SELECT PSTGSTUS,* from SOP10100 where PSTGSTUS <> 0
--Set the PSTGSTUS back to 0, then post
UPDATE SOP10100 SET PSTGSTUS = 0 where SOPNUMBE in ('509924','510048')


PSTNGSTUS Values
http://dynamicsgpblogster.blogspot.com/2009/05/sales-order-processing-posting-statuses.html

0 - Unposted
2 - Posted
12 - Error during posting
14 - Error during posting

Dynamics GP - SOP Edit List Errors

All of the errors are stored in the SOP10200 table.
the error code is in the SOPLNERR field.


http://support.microsoft.com/kb/943954