Monday, September 28, 2009

Just Getting It Done

Here’s a link to a great blog entry by Joel Spolsky (Joel on Software) about programmers who just get the job done and delivered.  I’m a great believer in “good enough”.  Not perfectly designed, n-tier architecture, reusable web services, but maintainable code, works, gets the job done and gets delivered.

Enough said.  Read the article.

Friday, September 25, 2009

Stuck Open Payables Voucher

We recently had a client call with two payables voucher that were stuck open.  The amount remaining was $0 but there were no payments associated with it.  Because the amount remaining was $0, they were unable to apply any further payments.  In addition, running Check Links and Reconcile didn’t resolve the situation.

Time to open up Query Analyzer (yes they’re still on SQL 2000).  After some digging, we found that there were Apply records in the PM10200 (apply work table) and the PM20100 (apply open table) for the full amount of the transaction.  Additionally, the date invoice paid off (DINVPDOF) was set and the current transaction amount (CURTRXAM) was set to $0.

The solution was to remove the apply records, clear out the date invoice paid off and set the current transaction amount to the document amount as follows:

--Delete orphanned apply to records from  the
--work table.
DELETE FROM PM10200
     WHERE VENDORID = '<<MyVendorID>>'
         AND APTVCHNM IN ('<<MyVoucherNumber1>>', '<<MyVoucherNumber2>>')

DELETE FROM PM20100
     WHERE VENDORID = '<<MyVendorID>>'
         AND APTVCHNM IN ('<<MyVoucherNumber1>>', '<<MyVoucherNumber2>>')

--Update the PM transaction header to set the
--current amount due (CURTRXAM) to the full
--document amount and the date invoice paid off
--(DINVPDOF) to empty (1/1/1900)
UPDATE PM20000 SET
        CURTRXAM = DOCAMNT
        ,DINVPDOF = '1/1/1900'
    WHERE VENDORID = '<<MyVendorID>>'
        AND VCHRNMBR IN ('<<MyVoucherNumber1>>', '<<MyVoucherNumber2>>')

For good measure, we ran Check Links against the Payables Transaction Logical File after completing this.  It didn’t register any errors with the specific vouchers.

Thursday, August 27, 2009

Dynamics GP Security Console Error - “Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))”

We recently had to add a user to an app that uses the Dynamics GP web services.  Since the web services seem to only allow you to assign permissions to individual users and not Active Directory groups, I was required to go into the Dynamics GP Security Console.  Sadly this often turns into an adventure in error messages and this time was no different.

First the console errored out at the top level.  A little digging and I discovered that of the three app pools setup by the GP Web Services in IIS, GPWebServicesAppPool, DynamicsSecurityServiceAppPool and DynamicsSecurityAdminServiceAppPool, the first two were using the service account we’d originally setup for this.  The DynamicsSecurityAdminServiceAppPool, however, was using an administrator end user’s account.  Not exactly best practice.

Anyway, figured that changing it to the same account as the other two app pools would do the trick.  And so it seemed.  I was able to open up the Security Console and navigate down to the policies node, usually the mark of a functioning console. 

However, when I went to add the new user to the appropriate application level group, I received an error message when I clicked Apply, “An unexpected error has occurred.  See the event log for further details.”

So into the event log I dove and found the following error:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Pretty much left me stuck.  A couple of emails back and forth with MS support and it turns out that during the Web Services installation, another account is created, DynamicsGPAdm.  This is a local account and is apparently given additional privileges beyond those of a local administrator.  I’m guessing that these are to ADAM. 

Of course, I had no idea what the password was as this was setup during the install, but fortunately, this account isn’t used for anything else.  So a quick password change and an update to the app pool and I was back on my way.

However, the complexity (do we really need three separate app pools?) and fragility of the GP Web Services, is one of the main reasons I’ve moved away from using them have moved creating my own web services using eConnect directly.  ADAM may be a great idea in theory, but it has caused me no end of grief.