Dynamics GP 2010 Web Services Installation – The Security ID structure is invalid. (Exception from HRESULT:0x80070539)

 

I been trying to install the web services for one of my clients, they are running a complicated environment, clustered SQL Server environment over three servers and clustered Hyper-V server to manage virtualized web applications like Workflow and Business Portal.

We have installed the SharePoint Server Farm and configured the Load Balancer to manage the load balancing between servers and created web applications for both Workflow and Business Portal and then moved to the web services installation which was already installed on the production environment, unfortunately the installation never succeeded with the above error message.

I tried everything, reinstalled it more that 100 times with no luck, searched every where with no result where I realized that the web services cannot be installed on a multiple server environment which does not make sense.

Finally I have decided to select the same Web Services database of the production environment and it worked! Looks like the Web Services cannot be installed with more that security database which is logically right due to the complication of the security roles and tasks on the web services entities.

Next time do not waste your time and directly select one name for web services database!


Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com

Advertisements

How to change SQL Collation for SQL Server 2008 R2

 

Have you ever been in a situation where you wanted to change the SQL Collation to match SQL Database Collation?? Last year I have posted a script that resolves this for SQL Server 2005, but the same syntax is not applicable for SQL 2008 R2, while investigating this I found the correct syntax that need to be used as below:

E:\SQL\setup.exe” /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SAPWD=P@ssW0rd /SQLCOLLATION=Arabic_CI_AI /SQLSYSADMINACCOUNTS=”DAOUD-PC\DAOUD

E:\SQL\setup.exe will need to be replaced with the locations of the SQL Server 2008 R2 setup.exe path.

MSSQLSERVER represents the default instance, if you have a named instance this must be changed to hold the instance name.

P@ssW0rd: is the new SA user password, it must be strong password or otherwise the repair will fail.

Arabic_CI_AI: is the new collation name.

DAOUD-PC\DAOUD need to be replaced with the local administrator of the server or PC you are installing the SQL on.

Paste above command into CMD and wait for 3-4 minutes, you will have your SQL Collation changed.

Warning: this operation will recreate your master database, were all existing setting will be reset, if you had databases attached it will be de-attached and will be found in the database folder.


Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com

Purchase Order Commitments View

I been working on a report where the customer requested to view the payment voucher with its corresponding commitments information and had a need to have Committed Amount, Actual Amount and Budget Amount, view below details all the needed information about this subject:

SELECT     ACTINDX, BUDGETAMT,  
ISNULL((SELECT SUM(DEBITAMT - CRDTAMNT) AS Actual FROM dbo.GL20000
WHERE (OPENYEAR = MAIN.YEAR1) AND (ACTINDX = MAIN.ACTINDX)), 0) AS ACTUAL,

ISNULL((SELECT SUM(DEBITAMT - CRDTAMNT) AS Actual FROM dbo.GL10001
WHERE (YEAR1 = MAIN.YEAR1) AND (ACTINDX = MAIN.ACTINDX)), 0) AS UNPOSTED,

ISNULL((SELECT SUM(Committed_Amount) FROM dbo.CPO10110 WHERE
(YEAR(REQDATE)= MAIN.YEAR1) AND (ACTINDX = MAIN.ACTINDX)), 0) AS Committed_Amount

FROM
(SELECT YEAR1, SUM(BUDGETAMT) AS BUDGETAMT, ACTINDX FROM dbo.GL00201 AS MASTER
WHERE
(BUDGETID = (SELECT TOP (1) BUDGETID FROM dbo.CPO40002
WHERE (YEAR1 = YEAR(GETDATE())))) GROUP BY ACTINDX, YEAR1) AS MAIN


Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com

PO Receiving Hangs During Posting

 

Sometimes I feel like an idiot while standing behind such a strange issue! I been in a situation with one of my clients where they have a rare case that occur once a week or once every two weeks.

When they post the Receiving Batch, the posting screen is shown and never finalize posting, GP remain responding and the user can work, process monitor has nothing pending and everything looks like the transaction was successfully posted.

When returning back to the Receiving screen you will find that the transaction remain un-posted, posting it again will return tons of errors that duplicate document numbers are exist.

Investigating this issue further shown that transaction has the below impact:

1. GL Batch was created!

2. Payables invoice was created.

3. Receiving Posted Transactions Table Header (POP30300) is affected while Receiving Posted Transactions Line Items Table (POP30330) was not.

4. Inventory Cost Layers Table (IV10200) was partially affected.

5. Inventory Transactions History Table (IV30300) was partially affected.

Client used to perform manual operation like creating an inventory adjustment with differences to fix this miss, but this actually will cover the issue but will not correct the transaction.

Current installation with existing customizations done internally does not allow for application reinstallation specially since the client is using terminal services environment, therefore we been unable to identify the actual reason behind this issue which most probably due to a corrupted dictionaries that cause such an error.

the good thing is I gave them the script below which will remove the effect of posting the transaction from the inventory and allow to repost the transaction which will be posted correctly on the second try! For sure they will still have to manually void the AP invoice and will need to manually delete the GL Journal.

 

CREATE PROCEDURE FIXPOHANG (

@POPRCTNM VARCHAR(500)

)

AS

DECLARE @BACHNUMB VARCHAR(500)

SELECT @BACHNUMB = BACHNUMB FROM POP30300

DELETE FROM POP30300

WHERE POPRCTNM =@POPRCTNM

DELETE FROM POP30310

WHERE POPRCTNM =@POPRCTNM

DELETE FROM POP30330

WHERE POPRCTNM =@POPRCTNM

DELETE FROM POP30700

WHERE POPRCTNM =@POPRCTNM

DELETE FROM POP30390

WHERE POPRCTNM = @POPRCTNM

DELETE FROM IV30300

WHERE DOCNUMBR = @POPRCTNM

DELETE FROM IV10200

WHERE RCPTNMBR = @POPRCTNM

DELETE FROM SEE30303

WHERE DOCNUMBR = @POPRCTNM

DELETE FROM DYNAMICS..SY00800

WHERE BACHNUMB= @BACHNUMB

DELETE FROM DYNAMICS..SY00801

UPDATE SY00500 SET MKDTOPST=’0′, BCHSTTUS=’0′, USERID=”

WHERE BACHNUMB = @BACHNUMB

 

Hope that this helps people have such an issue.

Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com

Inventory Reset Utility– HITB Did not match Staging Report and actual GL Journals!

 

While doing the inventory reset for one of my clients, I shocked when finalizing the last step when my Historical Inventory Trial Balance did not match the General Ledger upon finalizing the journals posting which cannot be correct, we have initiated the reset process from the beginning to match GL to Inventory but been able to achieve this.

I did the reset for many clients so far without having any issues, however the client has huge number of daily transactions, around 2.5 records in IV30300 per year and has some issues in uncompleted transactions and posting interruption, but this does not represent the fact that the reset utility much handle such an issue.

While investigating the issue further I have found that many transactions in SEE30303 does not have corresponding GL Journals and found that those transactions are actually duplicated, I used the script below to clear all transactions from SEE30303 that does not have corresponding Journal and managed to tie both numbers:

DELETE FROM SEE30303 WHERE JRNENTRY NOT IN (SELECT JRNENTRY FROM GL20000)

It worked! Hope that will help the community.

Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com

Vendor Notifications on EFT Bank Transfer

 

I got a request from one of my clients to notify vendors by mail once they release his payment to the EFT bank, where I had to create a trigger on CM20202 to monitor payments and send the mail to the vendor, below the script I used:

Create TRIGGER [dbo].[SendVendorMails]
   ON  [dbo].[CM20202]
   FOR INSERT
AS
BEGIN
 
DECLARE @MAILPROFILE VARCHAR(8000)
DECLARE @ToMAIL  VARCHAR(8000)
DECLARE @MESSAGE     VARCHAR(8000)
DECLARE @HEADER         VARCHAR(8000)

SET @HEADER = ‘Payment Transfer’
SET @MESSAGE = ‘Dear Esteemed Vendor,’ + char(10) + char(10)

+ ‘Kindly be advised that we have processed payment with the amount of (‘ + CONVERT(VARCHAR(500), (SELECT [Checkbook_Amount] FROM INSERTED)) + ‘) to your account. ‘ + char(10) + char(10)
+ ‘Your kind confirmation of subject payment to the following email is highly appreciated (payables@XXXX.com)’ + char(10)
+ char(10)
+ char(10)
+ ‘Regards,’ + char(10) + char(10)
+ ‘Accounts Payable Unit’ + char(10)

SELECT @ToMAIL = COMMENT1 FROM PM00200 WHERE VENDORID = (SELECT [CustomerVendor_ID] FROM INSERTED)
SET @MAILPROFILE        = ‘Administrator’
EXEC msdb.dbo.sp_send_dbmail
@Profile_Name = @MAILPROFILE,
@recipients = @ToMAIL,
@body = @MESSAGE,
@subject = @HEADER;

END

Note: the vendor e-mail address was saved in COMMENT1 field in the vendor card, you can modify the query to pull vendor mail from different field.

Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com

Inventory Reset – Average Item receipt QTY on hand does not equal IV QTY on hand.

 

As a part of the inventory reset utility you might get an issue with “Run Data Checks” step, that the Average Item Receipt Quantity On Hand (Table IV10200) does not equal Inventory Quantity On Hand (Table IV00102), this is really confusing specially after doing a full inventory reconcile as a part of the inventory reset process.

While investigating this I found indeed that Quantity at IV00102 does not match the IV10200 quantity and the Inventory Reconcile Process does not cover this part, where I had to find an alternative method to proceed.

On of the community users did face this issue and posted this question on one of the community portal and got an answer from WAQAS who went through the stored procedures of the reset tool and extracted a query that detects variances between IV10200 and IV00102, I have used this query to create the below cursor to collect and fix differences automatically:

DECLARE @ITEMNUMBER VARCHAR(500)
DECLARE @DEXROWID BIGINT
 
DECLARE QTYFIX CURSOR FOR
SELECT 
A.DEX_ROW_ID,
A.ITEMNMBR 
FROM IV10200 A 
INNER JOIN IV00101 B ON A.ITEMNMBR = B.ITEMNMBR
INNER JOIN IV00102 C ON A.ITEMNMBR = C.ITEMNMBR
WHERE B.VCTNMTHD = 3 AND A.QTYTYPE = 1 AND C.LOCNCODE = '' 
AND A.QTYONHND <> C.QTYONHND
AND EXISTS (SELECT 1 FROM IV10200 WHERE QTYTYPE = 1 AND ITEMNMBR = B.ITEMNMBR 
AND VCTNMTHD <> 0
GROUP BY ITEMNMBR HAVING MAX(DATERECD) = A.DATERECD)
AND EXISTS (SELECT 1 FROM IV10200 WHERE QTYTYPE = 1 AND ITEMNMBR =B.ITEMNMBR 
AND DATERECD = A.DATERECD AND VCTNMTHD <> 0
GROUP BY ITEMNMBR, DATERECD HAVING MAX(RCTSEQNM) = A.RCTSEQNM)
AND EXISTS (SELECT 1 FROM IV10200
WHERE QTYTYPE = 1 AND ITEMNMBR = B.ITEMNMBR AND DATERECD = A.DATERECD 
AND RCTSEQNM = A.RCTSEQNM 
AND VCTNMTHD <> 0
GROUP BY ITEMNMBR, DATERECD, RCTSEQNM HAVING MAX(DEX_ROW_ID) = A.DEX_ROW_ID)
 
OPEN QTYFIX
FETCH NEXT FROM QTYFIX INTO @DEXROWID, @ITEMNUMBER
WHILE @@FETCH_STATUS = 0 
BEGIN
UPDATE IV10200 SET QTYONHND=(SELECT QTYONHND FROM IV00102 WHERE ITEMNMBR=@ITEMNUMBER AND RCRDTYPE='1') WHERE DEX_ROW_ID= @DEXROWID
FETCH NEXT FROM QTYFIX INTO @DEXROWID, @ITEMNUMBER
END
CLOSE QTYFIX
DEALLOCATE QTYFIX

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Enjoy!

Regards,

Mohammad R. Daoud MVP – MCT
MCP, MCBMSP, MCTS, MCBMSS
+962 – 79 – 999 65 85
me@mohdaoud.com
www.mohdaoud.com