Tuesday, September 18, 2012

AX 2012 Delete a record from table browser or grid when delete button is not available

In earlier versions of AX, you had access to the red X on the main AX tool bar to allow you to delete a record from a table via the table browser or a grid where there was no delete option.

In AX 2012, this option is not necessarily available. You need to use an AX shortcut now. I always forget what this is so I'm writing a post. Simple stuff I know but its different so I'll write about it. Highlight the record(s) of interest and hit ALT+F9. This will prompt you if you really want to delete the record(s). Unless you have a sudden change of heart, click yes.

Fin

Monday, August 27, 2012

AX 2012 for Retail Error - A connection with the Transaction Service has not been enabled

Here's an error and solution. Hopefully it helps.

Process:
In implementations, it is necessary to refresh information from the production system to a lower environment so certain issues can be resolved. With this process, there are settings that need to be changed to make sure that the actual production system is not intermingling with the lower environments. If things are not changed properly errors can occur.

Issue:
After doing the PROD DB restore and reconfiguration, whenever a transaction service call is done, the error "A connection with the Transaction Service has not been enabled" is thrown.

While this could be a few things, here are two things that we need to check in regards to proper reconfiguration when seeing this error:
1) Retail Transaction Service Profile is setup for the new environment's AOS

2) POS Terminal 'Transaction Service Profile' value. This should be the value setup in point 1) above

Once these values changes are made, take down the transaction service followed by the AOS. This may not be a required step but it is always good to do this when transaction service errors pop up and it won't hurt anything. Bring up the AOS and then the transaction service once the AOS is back up.

After adjusting these values, push them down to the POS terminal via the appropriate job (N-1090 in base config).  Once pushed down (you can check this in the Store DB), conduct a transaction service call where you were getting this error before. As a note, you may need to log out of the POS. I wouldn't think you'd need to but I saw this as an issue after I did it. 

Hope this helps with this error!

Monday, July 9, 2012

Primary key index not showing up in AX 2012 table

There was an issue where I was training a couple resources for the client on how to create table and a form in AX so they can import data into AX, view/modify the data in a simple form, then export the data to Excel for reporting. Simple enough. A 30 minute mod that turns into a 4 hour AX training exercise because its a 'teaching tool' exercise.

After creating everything in a training session, we hit the an error 'Cannot load [AXTable]. Tables must have a valid replacement key or a primary index other than RecID for use in the Office Add-ins' when trying to add the table datasource in Excel.

Figure 1 - The error in Excel

It sucks that all the stuff from previous versions of AX were followed but the error above was hit.  We had a unique key and everything. it just wasn't assigned on the table properties as primary. The primary key wasn't showing up in the primary key drop down like it did in previous versions. Just typing the name of the id in there if the idx doesn't show up in the drop down does not mean it will work. The name will show up in the properties but then, when clicked on, the name disappears. This is because it doesn't actually exist there. Don't be fooled. The Surrogate index won't work for this either btw. The primary key I planned to use contained a unique combination of three fields

I'll cut to the chase. There are new features for AX 2012 leveraging features in SQL that AX used to not be able to use (primarily alternate keys). Here are the criteria that need to be done to get the index to show up in the properties of the AX table so this error can go away:
  • The index needs to be unique ('AllowDuplicates' property set to No) (Figure 2)
  • The index needs to have 'AlternateKey' property set to Yes (Figure 2)
  • The primary index of interest can only have one field in it
    • NOTE: This sucks in the scenario I have where we have three fields which would usually be the primary index. A primary field should technically only be one field anyways. This is just forcing the scenario. So create two unique indexes if you need to export to Excel using the add-in: one that is the primary and one that contains the unique combinations of the other fields. Both Alternate Keys values should be set to true.
  • The field on the table used in the primary key needs to be mandatory (Figure 3)
  • The field on the table used in the primary key cannot be editable (Figure 3)
    • Setup a number sequence or value creation logic for this value (complexity just went up)
Figure 2 - The index properties on the table (note: do not edit in the USR layer like in this picture...)

Figure 3 - The field properties in AX for the field used in the primary key

Hope the above helps some people. It's not a huge deal but was a source of frustration when it should not have been an issue...  Please make sure to chose your primary key carefully as it can be extremely tricky to change this in a production environment.
 



Wednesday, June 27, 2012

Hotel toiletries and status ranking

So, let me preface by saying this post is pretty much worthless. there is nothing technical in it whatsoever. I doubt I will get any hits on it at all. If I do, I hope everyone who reads this appreciates that I wrote it with the expectation no one will truly read it.

Ever since I was young, for some strange hoarding reason, I've collected hotel toiletries. It sounds stupid when categorizing a collection of things that are used on a (hopefully) daily or bi-daily basis in a term that sound like an object you crap in...  Toiletries are necessities in a zombie apocolypse: shampoo, conditioner, face soap, body soap, hand soap, liquid soap, Q-Tips, mouthwash, etc. I'll happily sell you them at a premium. I'll also trade for gold and silver.

These are a huge draw for me and I have stock piled so many I could keep a small army clean for a small war. Some would smell like Aveda sandalwood and others as Peter Thomas Roth Grapefruit with exfoliating beads. An unlucky few would smell like cheap mountain rain from an cheap hotel branded product line.

Anyways, I always size up a hotel by the toiletries. I've stayed at places that span from $80 - $800 a night in Hiltons, Marriotts, Four Seasons, etc and one of the most constant comparisons to quality is the toiletries. Maybe I'll create a blog post where I try to detail out what places have what. Probably not but whatever.  Just wanted to write about it because I can and this is my domain.

Wednesday, March 21, 2012

Missing tool bar and close X on task manager (taskmgr)

So I was on a very late night call and immediately passed out afterwards right in my chair.  Unfortunately that is not unusual when you are hitting 5 hours a night of sleep everyday on a crazy schedule.  All consultants know the situation of when and how this happens.  This post isn't about that though so moving on...

When I woke up, my task manager window did not have a border around it (see Figure 1 below). I think I must've double clicked on the edge of the task manager on accident but I really don't remember. All I know is I woke up and it didn't look right.  I didn't know how to close out of it and do the stuff that I needed to.

This is an easy fix but thought I would post about it on here.  If you double click on the border somewhere (see highlighted area in Figure 1), it will show the border again (Figure 2).

Easy enought but I didn't know about it with all of the stuff that I know so I thought it was blog worthy.  Enjoy!

Figure 1 - Task Manager with no border and highlighted area to double click

Figure 2 - Task Manager with the borders

Sunday, February 12, 2012

Windows 7 and Autorun.inf. Won't work from USB

I'm writing this post to let everyone know that the autorun.inf file will not automatically trigger from a USB drive in Windows 7.  I wrote a post (What is autorun.inf file) talking about the autorun.inf file because this can work for CDs/DVDs and other applications but WILL NOT work for auto starting a program from a USB drive. 

This used to be possible from a USB when I originally wrote the stuff in my files but since Microsoft removed it, its not anymore. I used it for a personal program I had on my USB so I didn't care about getting a virus from the USB.

As a rule of thumb, I always suggested people disable the autorun on their PCs to avoid viruses.  The reason for this is that if it is enabled and someone puts a USB in your computer, your computer can get a virus. It's insane how many people have viruses on their computer and don't even know it.  It's bad practice for people to put updates on a USB and just go computer to computer installing it that way for a few reasons.  First and foremost, its incredibly inefficient for deploying updates.  The second is the virus aspect.

Before you pass judgement on Microsoft for disabling this for USBs, look at the following:
If you insert a USB into your computer with autorun enabled and the autorun.inf pointing to an infected program, your computer now has it. Congrats! The autorun.inf viruses can really suck and wreck havok on things. Seriously bad news. Now in Windows 7, the virus will only transfer to your computer if you manually open the drive. This is great since you now have a chance to scan the drive and clean all viruses before opening it.

Saturday, February 11, 2012

All about 'Autorun.inf'

What is the 'Autorun.inf' file?
The file extension .inf stands for information file. The file is a simple text-based configuration file that tells the operating system (OS) how to deal open the presentation and treat the contents of the media (CD, DVD, USB thumb drive, etc). It tells the operating system which executable to start, which icon to use, and which additional menu commands to make available.
It defines the following:
  • The process or application that will automatically run when a disk is inserted
  • Optionally, one can define the process or application that will run for specific Operating environments.
  • The icon that will represent your application's CD or DVD when the drive is viewed with My Computer or Explorer.
  • Menu commands displayed when the user right-clicks the CD-ROM icon from My Computer or Explorer.
What does it contain?
There are 5 parts to this file: [autorun], [Content], [ExclusiveContentPaths], [IgnoreContentPaths], and [DeviceInstall]

Sections:
  1. [AutoRun]
    1. This section is required for the file to be valid
    2. There can be one of these sections for the different operating systems (e.g. [autorun], [autorun.mips], [autorun.alpha], etc).  This is important so the appropriate executables run that are compatible with the computer the media is entered in.
    3. PURPOSE: contains the default AutoRun commands
    4. VALID KEYS:
      • Action
        • Specifies text to be ussed in the AutoPlay dialog to represent the program specified in the open or shellexecute keys.
        • VALUES: Text or '@[filepath\]filename, -resourceID 
      • Open
        • Specifies the path, file name and optional parameters to the application that AutoRun launches when a user inserts a disc in the drive
        • It is the CreateProcess function that is called by AutoRun.
        • VALUES: '[exepath\]exefile [param1 [param2 ...]]'
      • Icon
        • Name of a file resource containing an icon.  This icon will replace the icon of the drive when it is looked at from
        • VALUES: 'iconfilename[,index]'
        • EXAMPLE:
          • icon=MyProg.exe,1
      • Label
        • This will be the text label of the drive
        • VALUES: Text
        • EXAMPLE:
          • label=My Drive Label
      • shellexecute
        • Like the open command but this uses the machine's association information for the file type.
        • VALUES: '[filepath\]filename [param1 [param2 ...]]'
        • EXAMPLES:
          • shellexecute="Readme.txt"
          • shellexecute=[filepath\]filename[param1, [param2]...]
      • UseAutoPlay
        • Use AutoPlay rather than AutoRun
        • VALUES: boolean
        • EXAMPLE:
          • UseAutoPlay=1
      • shell\verb\command
        • Adds a custom command to the drive's shortcut menu.
        • Verb is a string with no embedded spaces.
        • Verb is also the text that will appear in the shortcut menu unless specifically altered to some other text
        • VALUES: '[exepath\]exefile [param1 [param2 ...]'
        • EXAMPLE:
          • shell\readit\command=notepad abc\readme.txt
            shell\readit=Read &Me
      • shell\verb
        • Optionally specify the text displayed in the shortcut menu for the verb above.
        • Use an ampersand (&) to select a hotkey for the menu.
        • VALUES: Menu Text
        • EXAMPLE:
          • shell\verb\command=Filename.exe
            shell\verb=MenuText
      • shell
        • Defines the menu command referred to by shell\verb as the default command in the shortcut menu.
        • The default command is the command executed when the drive icon is double-clicked.
        • If missing, the default menu item will be "AutoPlay", which launches the application specified by the open entry.
        • VALUES: Text
        • EXAMPLE:
          • shell=verb
  2. [Content]
    1. This section is not required
    2. PURPOSE: Allows authors to communicate the type and intent of content to AutoPlay without AutoPlay having to examine the media
    3. VALID KEYS:
      • MusicFiles
        • Values: boolean
      • PictureFiles
        • Values: boolean
      • VideoFiles
        • Values: boolean
    4. The key values will determine if the handlers associated with that contect type are displayed
    5. EXAMPLES:
      • [Content]
        MusicFiles=Y
        PictureFiles=0
        VideoFiles=false
  3. [ExclusiveContentPaths]
    1. This section is not required
    2. PURPOSE: Limits AutoPlay's content search to only those folders listed, and their subfolders. The folder names are always taken as absolute paths (a path from the root directory of the media) whether or not a leading slash is used.
    3. EXAMPLE:
      • [ExclusiveContentPaths]
        \music
        \music\more music
        music2
  4. [IgnoreContentPaths]
    1. This section is not required
    2. IgnoreContentPaths takes precedence over ExeclusiveContectPaths so if a path given in a [IgnoreContentPaths] section is a subfolder of a path given in an [ExclusiveContentPaths] section it is still ignored.
    3. PURPOSE:AutoPlay's content search system will not scan the folders listed, nor their subfolders.
    4. EXAMPLE:
      • [IgnoreContentPaths]
        \music
        \music\more music
        music2
  5. [DeviceInstall]
    1. Used to indicate where driver files may be located
    2. Not used with AutoRun or AutoPlay and is only referred to during a driver installation phase
    3. Multiple key entries are allowed.
    4. PURPOSE: used to indicate where driver files may be located. 
    5. VALID KEYS:
      1. DrivePath
        1. Values: text (a directory path)
    6. EXAMPLE:
      • [DeviceInstall]
        DriverPath=drivers\video
        DriverPath=drivers\audio
Simple example of an autorun.inf

[autorun]
open=PStart.exe
action=Run PStart Program
icon=PStart.exe
label=My Portable PC


Complex example of an autorun.inf

[autorun]
open=filename.exe /argument1
icon=\foldername\filename.dll,5
[autorun.mips]
open=filenam2.exe
icon=filename.ico
[autorun.alpha]
open=filenam3.exe
icon=filename.ico
[autorun.ppc]
open=filenam4.exe
icon=filename.ico
shell\install = &Install
shell\install\command = setup.exe
shell\uninstall = &UnInstall
shell\uninstall\command = Uninstall.exe
shell\readme = &Read Me
shell\readme\command = notepad readme.txt
shell\help = &Help
shell\help\command = helpfilename.hlp


For more information see these associated blog posts: