Sunday, March 6, 2011

How to iterate over addresses in the global address book of Vendors/Customers

I'm frequently asked to mass update addresses for vendors or customers during data imports when something isn't imported correctly.  Here is a simple job that I wrote that shows the relationship between the tables, that you can modify to fit your needs.

static void iterateOverAddresses(Args _args)
    VendTable                           vendTable;
    Address                             address;
    DirPartyAddressRelationship         dpar;
    DirPartyAddressRelationshipMapping  dparm;

    while select address
        join dpar
        join dparm
        join vendTable
              vendTable.PartyId         == dpar.PartyId                         &&
              dpar.RecId                == dparm.PartyAddressRelationshipRecId  &&
              dparm.RefCompanyId        == curExt()                             &&
              dparm.AddressRecId        == address.RecId

Saturday, March 5, 2011

Enterprise portal security issues with Refresh 3.5 and AX 2009

I wanted to play around with a well-built demo environment so that I could experiment with some workflow ideas I had, so I downloaded Microsoft's Refresh 3.5 VPC from partnersource (located here).

I prefer to work as a typical user with typical security settings so that I can identify issues quickly.  After booting up the VPC and restarting it a few times so that it would adjust to my machine, there were quite a few changes I had to make to get it usable.

Firstly, I had to change the client configuration to point to AX593 and the business connector configuration as well.  If you forget the business connector, you will have EP issues, amongst other things.

I randomly chose contoso\Nancy as my testing user, and I immediately notice that I don't have access to EP at all:

So I switch back over to contoso\administrator to take a look at the security settings in EP and notice there really isn't anything setup:

Let's add Nancy to the viewer's group and see what happens...

So now we can at least see the role centers, but the KPIs are having an issue...hmm...this issue is typically related to Kerberos, but on the Refresh 3.5 VPC, it's only NTLM security because everything is on the same machine.

Let's remove Nancy from the viewers group, and just create our own "AX Users" group, but let's make it "Read" only instead of "View only", add Nancy to it, then refresh our role center:

And we're good.  The only difference between View Only and Read is the ability to view the source of documents with server-side file handlers.  See Sharepoint permissions matrix here for security differences.

Friday, March 4, 2011

Undoing the Financial Dimension Wizard

During the initial setup of AX, I've seen where dimensions in one environment don't match the other environment. One place will have one called "Brand" and another will say "Brands", or "Event/Place" vs "Place/Event", for example. This can cause big issues, and be a bit of a pain.

To fix this, what I recommend doing is deciding which environment is the good one, and dropping the dimension code down to the bad one. You'll then need to drop the good database down to the bad environment too...otherwise data will look screwy all over the place.

Fixing data is another discussion, and just reloading/replacing the database is the easiest.

Replacing the code is easy. This screenshot should give you all the information you need to fix the dimensions in the AOT:

  • Tables\LedgerJournalTrans
  • EDT\COSAllowDimensions
  • EDT\Dimension
  • EDT\DimensionAllocation
  • EDT\DimensionCriteria
  • EDT\DimensionKeepFromTransaction
  • EDT\DimensionLedgerAllocCriteria
  • EDT\DimensionLedgerJournal
  • EDT\DimensionPriority
  • EDT\MandatoryDimension
  • EDT\XMLMapDimension
  • BaseEnums\SysDimension
  • Forms\LedgerAllocation
Labels need to be fixed.  The dimension wizard creates labels for these items, I believe in the DPA label file.  Just check on the objects and see what their labels are.  You can open the axDPAen-us.ald file in notepad (US English) and take a look there too.