Sunday 18 May 2014

AIF exception error “Instances of abstract classes cannot be created”

The AIF exception errors normally are quite self explanatory; especially validation but recently we were faced with the following odd error: -
The request failed with the following error:  Instances of abstract classes cannot be created
What is very odd about this error is that we knew we didn’t have any code that was trying to instantiate an abstract class. After all we had no compile errors.
So what could be causing such a strange error? My immediate thought was that it was so odd that it could be a corruption of some kind. The most likely corruption would be an IL build one and this was indeed the case. We executed a full IL build and once that had been done we were able to successfully import data via AIF again without any error.
So if you are ever faced with an AIF exception error “Instances of abstract classes cannot be created” I would recommend you first check your IL build.

Saturday 17 May 2014

Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics Axapta R2- R3

Hi all ,
I faced this error in AX R3 "Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics" , so did some research. It seems the UserInfo table is not correctly updated and the partition administrator is not updated correctly when you restore an existing DB or the Demo database.
To fix this, you can do the following.


  • Stop the AOS
  • Restore the database again
  • Start the AOS
  • Start a client and complete the partition initialiasation checklist
  • Close the client and execute the script below on the SQL database
  • Restart the client and reimport your license (if you were restoring the Microsoft demo data, the demo license is back in there)
  • Then compile / generate CIL / DB sync and you should be on track again!
The script for updating the UserInfo inforation is as follows:
DECLARE @NetworkDomain nvarchar(255);
DECLARE @NetworkAlias nvarchar(80);
DECLARE @SID nvarchar(124); DECLARE @InitialPartition BIGINT;
 
SELECT @InitialPartition=Recid FROM PARTITIONS WHERE PARTITIONKEY=N'Initial'
 
SELECT @NetworkAlias=NETWORKALIAS,@NetworkDomain=NETWORKDOMAIN,@SID=SID FROM USERINFO WHERE PARTITION=@InitialPartition AND ID = N'Admin'
 
UPDATE USERINFO SET NETWORKDOMAIN=@NetworkDomain,NETWORKALIAS=@NetworkAlias,SID =@SID WHERE PARTITION != @InitialPartition AND ID = N'Admin'

Saturday 3 May 2014

Microsoft Dynamics AX 2012 R3 Training: Transportation Management

Hi ,

This link is helpful for who is responsible for the setup and administration of transportation management functionality. Get an introduction to the transportation management flow and concepts in Microsoft Dynamics AX 2012 R3. The information is helpful for Transportation Managers, Transportation Coordinators, Shipping Planners, and Shipping Clerks.

http://channel9.msdn.com/Series/Microsoft-Dynamics-AX-2012-R3-Training/01

Microsoft Dynamics AX 2012 R3 Warehouse Management

Hi ,

This link is helpful for who is responsible for setup and administration of warehouse management functionality. This will help to get an introduction to warehouse management flow and concepts in Microsoft Dynamics AX 2012 R3. The information is helpful for Warehouse Workers, Warehouse Managers, and Shipping and Receiving Personnel.

http://channel9.msdn.com/Series/Microsoft-Dynamics-AX-2012-R3-Training/02

Sunday 27 April 2014

Adding new fields to the AX 2012 R3 retail distribution sub-jobs Or create new sub-jobs for new tables to the AX 2012 R3 retail

Hi All ,

This post focus on Jobs creation in retail from the code. This post will give the idea of how to customize the retail cdx classes for job creation as well as add customize fields to sync the data to the channel database.

After debugging the code from initialize button on Retail Parameter form I got to know that class RetailCDXSeedData and its child class RetailCDXSeedData_AX63 has major role in the job creation in AX R3.

As we see in the parent class RetailCDXSeedData->  run() method, we find the following code.

while (subjobEnumerator.moveNext())

    {

        subjobMethod = subjobEnumerator.current();

 

        seedDataClass.resetParameters();

        dc.callObject(subjobMethod, seedDataClass);

 

        if (subStr(subjobMethod, 1, 2) == 'C_')

        {

            seedDataClass.createSubJob();

        }

        else if (subStr(subjobMethod, 1, 2) == 'A_')

        {

            seedDataClass.appendFieldMapping();

        }

    }

 

Here we can see that parent class look in to the child class that is in to class RetailCDXSeedData_AX63 for methods whose name stars with the C_ or with the A_, then it define tables and fields that will be synchronized.

At this time there no "A_" methods available in AX R3, so difference between "C_" is not clear. What we can see from the code is  A_ methods might be use to append the new fields to existing sub-job.

Each of the “C_” methods simply initialize some class instance variables so they’re all really simple. Each method will generate the setup required for one sub-job and attach that sub-job to one or more jobs. The variables that we must set depend on whether it's a sub-job to send data to the POS or a sub-job to pull data back.
For a send style sub-job, you need to initialize the following variables
JobIDContainerA container of strings with each element defining the distribution job Id that the sub-job should be linked to. Typically this would be a single element container but there is no reason why you cannot link a single sub-job to multiple jobs using this approach.
subjobIDA string defining the id of the sub-job to be created/amended.
axTableNameThe name of the table that will be synchronised by this sub-job.
axFieldNamesA container defining the list of fields that the sub-job will synchronise.
For a sub-job designed to pull data back from the store database we need to define the same variables as a send sub-job plus the following additional variables.

isUploadA boolean variable that should be set to true.
ReplicationCounterFieldNameA string that defines the replication counter field name (typically “REPLICATIONCOUNTERFROMORIGIN”) which should also be included in the axFieldNames container.
tempDBTableNameThe name of the TempDB temporary table used during synchronisation.
 
 Here is the example of C_ method for a pull job.
private void C_RetailTransactionAttributeTrans()
{
    jobIDContainer = ['0001'];
    subjobID = 'RetailTransactionAttributeTrans';
 
    axTableName = tableStr(RetailTransactionAttributeTrans);
 
    axFieldNames = [
        fieldStr(RetailTransactionAttributeTrans, Channel),
        fieldStr(RetailTransactionAttributeTrans, Name),
        fieldStr(RetailTransactionAttributeTrans, ReplicationCounterFromOrigin),
        fieldStr(RetailTransactionAttributeTrans, store),
        fieldStr(RetailTransactionAttributeTrans, terminal),
        fieldStr(RetailTransactionAttributeTrans, TextValue),
        fieldStr(RetailTransactionAttributeTrans, transactionId)
    ];
 
    isUpload = true;
    replicationCounterFieldName = 'REPLICATIONCOUNTERFROMORIGIN';
    tempDBTableName = 'RetailTransactionAttributeTransT';
}
 
 
Let’s assume that I want to add a field to the RetailBarcodeMaskTable table and have that synchronise to the store database. For this I would need to modify the C_RetailBarcodeMaskTable() method as follows.
 
private void C_RetailBarcodeMaskTable()
{
    container    myCustomFields;
 
    jobIDContainer = ['1040'];
    subjobID = 'RetailBarcodeMaskTable';
 
    axTableName = tableStr(RetailBarcodeMaskTable);
 
    axFieldNames = [
        fieldStr(RetailBarcodeMaskTable, Description),
        fieldStr(RetailBarcodeMaskTable, Mask),
        fieldStr(RetailBarcodeMaskTable, MaskId),
        fieldStr(RetailBarcodeMaskTable, Prefix),
        fieldStr(RetailBarcodeMaskTable, RecId),
        fieldStr(RetailBarcodeMaskTable, Symbology),
        fieldStr(RetailBarcodeMaskTable, Type)
    ];
 
    myCustomFields = [
        fieldStr(RetailBarcodeMaskTable, MyCustomField1),
        fieldStr(RetailBarcodeMaskTable, MyCustomField2)
    ];
    axFieldNames += myCustomFields;
}
As you can see, rather than directly modify the code that sets the axFieldNames variable I have created my own container variable local to the method and added my fields to that. The local variable is then simply appended to the axFieldNames container so that it contains both the standard and custom fields.  This means that, although we will still have to merge code during an upgrade if the standard field list has been changed, it will always be a simple operation to merge in whatever new changes are in the new Microsoft code.

To Add New table :
It should be reasonably obvious from the text above that adding a new table into the synchronisation setup should be a simple matter of creating a new “C_” method a following either the send or pull method pattern appropriately to determine which variables should be set. The framework will automatically see the new method and will execute it along with all of the existing standard methods, creating your new sub-job and attaching it to whichever job you want to attach it to. If you need to define an entirely new job then you should modify the RetailCDXSeedData_AX63.createJob() method, adding a new line of code to create your job.

6 Things you did not know about Microsoft Dynamics AX 2012-R3

Here are 6 things you might not know about Microsoft Dynamics AX 2012-R3.
1. There are no longer extra GL entries generated from the two voucher item posting strategy
This corrects a design issue when the distribution framework was introduced in AX2012.  Fewer entries are made to the GL and the normal effect of posting a receiving to accrued purchases shows in a more sensible way.
2. There are now additional Inventory Storage Dimensions for Inventory Status and License Plate
Inventory statuses can also be tied to blocking features to only allow inventory that is truly available for immediate sale
3. The reservation Hierarchy determines how dimensions are used in the warehouse
The reservation hierarchy is the key to warehouse management and automation and can be configured differently for items that require more detailed manual reservation.  Understanding the hierarchy is important to the overall system automation and flow.
4. Items must be assigned to a storage dimension that is Warehouse Manageable from the beginning
Items must be associated with the correct storage dimension at creation.  Changing the storage dimension after transactions exist is not supported.  Microsoft will be introducing conversion utilities for existing customer installations post release.  Make sure to work closely with your account manager and solution delivery manager to plan your upgrade.
5.AX 2012 R3 will be available in the Cloud on Microsoft’s Azure server platform
Once released this could be the fastest and most cost effective way to deploy both development and UAT infrastructures for Dynamics AX.  There are still costs directly with Microsoft to run Azure servers but the overall speed of setup and the elimination of any hardware purchase make this a compelling offering.  And with Azure you only pay for server time used!
6. PowerQuery is a free download as an addin to Excel 2013 and 2010 that can integrate directly with your instance of AX2012 company data
PowerQuery allows an AX user to connect directly with Queries and Services exposed to the document framework of the Excel Addin. This allows easier creation of business intelligence reports on AX data directly connecting to the AX company database.  This does not require Office365 and can run standalone.

Reference from http://www.uxceclipse.com/pages/blog-detail.aspx?newslist=Blog%20List&itemId=19

Saturday 26 April 2014

New features in Microsoft Dynamics AX 2012 R3

Microsoft Dynamics AX 2012 R3 is released April 2014. New capabilities added to Dynamics AX 2012 R3 span horizontal and vertical features; however, this time enhancements also include mobile apps.
The new Dynamics AX 2012 R3 horizontal features are expected to cover e-procurement and budget planning to help improve operational efficiencies and support the planning needs of complex organizations.
E-procurement new features include:
  • Improved management of Request for Information (RFIs), Request for Proposal (RFPs) and Request for Quote (RFQ) from solicitation to award for enhanced efficiency
  • Better control on response types to include sealed, open, and reverse auction type bids
  • Ability to define evaluation criteria and scoring of RFxs upfront, allowing for improved decision making
Anticipated Budget planning features include:
  • Budget allocation based on allocation basis rules
  • Improved process flexibility and control by default and locked dimension values on certain type of budget plans
  • Evaluation of different scenarios for what-if analysis
Microsoft has also made many enhancements to Warehouse Management and Retail Dynamics AX 2012 R3.
Warehouse Management has improvements to capabilities that will help users streamline distribution and warehouse operations. Improvements include:
  • Enhanced inventory control through 360 inventory visibility, real-time cycle counting and replenishment
  • Embedded radio frequency that provides real-time transaction processing through mobile devices including receiving, putting away, picking, staging and loading
  • Rate, route and load planning that includes inbound and outbound planning, order consolidation, routing guides, constraints-based routing, load build capacity calculations, multi-mode planning, and methods to select a rate for specific loads based on the carrier’s rate profile
Retail is a fast-paced and ever evolving industry. Shoppers are mobile, connected and expect an omni-channel shopping experience. Microsoft created the following features with that in mind.
  • A native and immersive Windows 8 Tablet Point of Sales (POS) and Mobile POS for Windows Phone 8, allowing retailers to provide differentiating customer facing in-store experiences
  • Loyalty programs across legal-entities and tiering of customers as well as enhanced gift card support
  • Enrichments to pricing and promotions, assortment and catalog, BI and reporting, and seasonality and markdowns enhancements helping optimize revenue
As mentioned above, Microsoft has also added mobile apps with this release. It’s not a new concept for employees to be on the move all the time. Mobile apps makes it easier for them to do certain tasks on the go and improves their efficiency.
  • Time entry allows employees to capture time worked on projects simplifying this administrative task while providing businesses the opportunity to improve working capital through decreased billing cycle times
  • Approvals enables business requests like budget, time sheets, submitted expense reports to be approved on the go
  • Capturing and reconciling expenses while traveling allows organizations to implement policies more seamlessly and shortening time to get money back to employees
You can learn more about the expected feature enhancements in the Dynamics AX Statement of Direction. As we get closure to the release of R3, more details will be released.

Thursday 24 April 2014

List of New Modules in Microsoft Dynamics AX 2012 R3

List of New Modules in Microsoft Dynamics AX 2012 R3
List of New Modules in Microsoft Dynamics AX 2012 R3 or New Modules in Microsoft Dynamics AX 2012 R3


List of new modules we spotted in this new “Rainier” release for AX 2012 R3:


  1. Warehouse Management
  2. Transportation Management
  3. Call Center
  4. Trade Allowance Management
  5. Retails Essentials

Please see the screenshot below which shows all the modules available in AX 2012 R3

Saturday 5 April 2014

Microsoft Dynamics Axapta R3 Retail Component


I have identified some changes in AX R3 retail deployment components as well in commerce data exchange system that share data between HQ and store. Below  diagram gives the idea about new included components in retail deployment.



In POS retail POS is a component that is required for the day-to-day operation of Retail at a store, modern POS (point of sale) provides the services that enable Windows 8.1 clients to interface with Retail. It needs retail server URL for activation.

In Database there are two database for store, channel database and offline database. Channel database is store database, which hold retail data for one or more retail channels, such as online stores. The data for a channel can be included in more than one channel database. We can create channel database using setup or we can use Retail Channel Configuration Utility, to configure channel data and offline database we use Retail Channel Configuration Utility.

CDX, commerce data exchange contains realtime server, async server and async client.



               

Real-time Service is an integrated service that provides real-time communication between Microsoft Dynamics AX and retail channels. In AX 2012 R3 and AX 2012 R2, Real-time Service is a Windows Communication Foundation (WCF) service that must be installed on a website in Internet Information Services (IIS).

                Async server is new CDX component included in AX R3. Async Server is part of the asynchronous system that shares data between the Microsoft Dynamics AX database and channel databases. Async server is web application so we provide the various information like web application name, port number, thumb print. We also provide the HQ message database name . Installer will create HQ message database along with two working folders.



                Async Client is installed at the channel and communicates with the channel database. Async clients are connected to the async server, during the installation we provide the channel database group, username and password . Channel database group is present in retail- setup-retail scheduler-channel database. We also provide the channel message database name and channel database.

                SO when we push the data from HQ, it puts in to the two working folders. Async client fetch that data from async server and populate that in to the channel database.

Wednesday 19 February 2014

Working with the alerts in AX 2012

Dynamics Ax2012 facilitates the Alerts mechanism out of the box which can be used commonly across the modules for new implementations. Especially to fulfill the users wish on getting alerts and helping them in their daily activities.

Let us take few business scenarios as example to know how it plays a big role in alerting the user.
Susan from procurement team handles the RFQ (Request for quotation) process in the organization. He processes 100 RFQs each day. To track the Expiry date of the RFQ and compare the quotations received from different suppliers on completion of “Expiry date” is a tedious work for him. He wants to be alerted a day before the expiry date of the RFQ. How can we help him?
Rajat is an accounting manager and who is not involved in PR approvals but still he wants to be alerted or notified whenever a purchase requisition is approved.
Sunny is inventory manager and wants to be alerted whenever Inventory clerk creates an item in the Item master.

Dynamics AX2012 alerting mechanism can be used to address all these scenarios. AX2012 has two kinds of alerts which can be be used accordingly to achieve the same.
  • Change based alerts
  • Due date alerts
Change based alerts: With respect to a particular field we can setup the alert rule to alert the specific user. As per our scenario,  I am going to create an alert rule to alert someone when the PR is approved.
Go to PR header>focus on the status field in the header> right click >Create alert rule, which opens the below form. It has below 4 alerting options



  • Has changed – Alerts whenever the value in this field has changed
  • Is set to – Alerts whenever the field is set to a particular value
  • Create and deleted: whenever a record has been created or alerted
We can use “Is set to” option here to alert whenever PR “status” is set to – Approved. In the “Alert who” node specify the user who should be alerted.

Due date alerts:
Similarly, for the due date alerts, select the date field you want to get the alerts for >Right click>Create alert rule



Choose the event “due in” and specify the days i.e., how many days before you want to alert the user. Jump on the other events that you are seeing to know how you can make the best use of it.
Similarly, using the event “Record has been created” will alert the user when a record is been created in that table.

Sticky notes: How can we alert multiple users for the event? Create another alert rule and specify the different user id .
What if a user wants to be alerted only when the POs from particular vendor are invoiced? Just use the select button to specify the condition to meet to get the alert. (Apply this querying based on the client requirements).

Considerations:
Just creating the alert rule is not enough to get the alert. You will also need to work on initiating the batch processing to get the alerts triggered.

Go to system administration>setup>Alerts> Change based alerts and Due date based alerts to route it through batch processing.


In the form, select the batch processing check box and click recurrence to define recurrence interval for the alerts triggering.

After doing this, go to system administration>inquiries> Batch jobs to ensure whether the batch job created. (You will get to see the alerts only if the job is added to this batch jobs form)


Last but not least, set up the user options for the users who want to be alerted.
Go to system administration>Users>Select each user>go to options and click the “notifications” tab.


Set the value in minute’s field to see the pop up for every x minutes. Now, everything is done and we should receive the alerts.



AX home and all the forms will have the alerts symbol, clicking on which will show you the notifications.
Setting “Send alert as e-mail message” option sends the notifications as e-mail.

Sunday 16 February 2014

Conformation Message Box in AX 2012

Dialogbutton    dialogBtn;
;
dialogBtn  =   Box::yesNo("Are you sure to continue ", dialogButton::Yes, 
                                         "Choose your option");
if (dialogBtn == dialogButton::Yes)
   {
        info( "Process will be continued ");
   }
else
     if (dialogBtn == dialogButton::No)
       {
          info( "Process stopped");
       }

Thursday 13 February 2014

an unbalanced x++ TTSBEGIN/TTSCOMMIT pair has been detected.causes of this include(a) too many

Hi ,

Sometimes we het the TTSBEGIN unbalancing error.

Error: 
clip_image001 

To resolve this error this TTS level should be ZERO, Run this job to get rid of that error, this job will find the tts level where its greater than zero and make it zero by calling TTSABORT. 

static void resetTTS(Args _args)
{
while (appl.ttsLevel() > 0)
ttsAbort;
}


ttsBegin: marks the beginning of a transaction. This ensures data integrity, and guarantees that all updates performed until the transaction ends (by ttsCommit or ttsAbort) are consistent (all or none). 
ttsCommit: marks the successful end of a transaction. This ends and commits a transaction. MorphX guarantees that a committed transaction will be performed according to intentions.

WINAPI claas in Axapta 2012 and Its Use

Like most AX developers I use the WINAPI class quite often. Its a very useful class when handling files that need to be accessed outside of the AX environment

  static void FO_WinApi(Args _args)
  {
      str     root        = "C:";
      str     path        = "C:\\dionne";
      str     fileName    = "SalesInvoice.pdf";
      str     fileName2   = "SalesInvoice1.pdf";
      str     file        = path + "\\" + fileName;
      str     file2       = path + "\\" + fileName2;
      int     x, y;
      ;

      // Does folder exist?
      print WinAPI::folderExists(path);

      // Does file exist?
      print WinAPI::fileExists(file);

      // Copy file.
      print WinAPI::copyFile(file,file2);

      // New file exists?
      print WinAPI::fileExists(file2);

      // Delete new file.
      print WinAPI::deleteFile(file2);

      // New file still there?
      print WinAPI::fileExists(file2);

      // Get current cursor position.
      [x, y] = WinAPI::getCursorPos();

      print x;
      print y;

      // Get time and date format.
      print WinAPI::getSystemLocaleDateStr();
      print WinAPI::getSystemLocaleTimeStr();

      // Gets current computer name.
      print WinAPI::getComputerName();

      // Gets total disk space.
      print int2str(WinAPI::getDiskTotalSpaceInKb(root)
             / 1000) + " MB";

      // Gets current free space on disk.
      print int2str(WinAPI::getDiskFreeSpaceInKb(root)
             / 1000) + " MB";

      // Date when file was last accessed.
      print WinAPI::getFileAccessedDate(file);

      // Time when file was last accessed(In seconds).
      print WinAPI::getFileAccessedTime(file);

      // Gets path to temp directory.
      print WinAPI::getTempPath();

      // Gets a generated temporary filename, prefix "FO_".
      print WinAPI::getTempFilename(path, "FO_");

      pause;

  }
In addition to file information the WINAPI class can execute different file types from within Dynamics AX by of course using the file name as a parameter.
For example lets say you want to launch a PDF file saved in table within AX. WinAPI::ShellExecute() will do this for you

Wednesday 5 February 2014

Saturday 1 February 2014

Disabling form elements based on another form elements

Hi,

Sometimes we want to disable form element, depend upon some value or on some event of the same form element. we can do that , please refer below mentioned way, please view carefully so that you can modified as per your requirement.

As example, the CustTable form will be used. The example will disable the One-time customer checkbox on the General tab if the Mandatory credit limitcheckbox is checked on the same General tab.
Change form properties
  1. Select the Administration Field Group on the TabGeneral TabPage and set the AutoDataGroup Property to No.
  2. Select the Administration_OneTimeCustomer CheckBox field in the Field Group Administration and set the AutoDeclaration property to Yes.



create from methods for enable/disable

Create a new form method setAccessOneTimeCustomer:
void setAccesssOneTimeCustomer()     
{ 
   if (CustTable.MandatoryCreditLimit)     
    { 
       Administration_OneTimeCustomer.enabled(false);    
    } 
    else     
    { 
        Administration_OneTimeCustomer.enabled(true);     
    } 
    custTable_DS.refresh();    
}

call the form methods in active and modified methods

Call the newly created form method in the active method on the Data Sourceof the Form. As such, the second field will be enabled or disabled appropriately upon scrolling through the form.
public int active() 

{   
    int ret; 
    element.setAccesssOneTimeCustomer(); 
    ret = super(); 
    return ret; 
}


Call the newly created form method in the modified method on the field which should trigger the enabling or disabling. In our example, it is the fieldMandatoryCreditLimit. As such the second field, in our case OneTimeCustomerwil be enabled or disabled each time the value of MandatoryCreditLimit is changed.

public void modified()   
{ 
    element.setAccesssOneTimeCustomer();     
    super(); 
}



checkout

Open the CustTable form: check the field Mandatory credit limit: the field One-time customer will be disabled immediately.

Wednesday 29 January 2014

How to give startup message in Axapta 2012

Hi ,

Sometimes we want to give startup message. To do that follow below steps.

  1. Open the Configuration Utility (Start > Control Panel > Administrative Tools > Microsoft Dynamics AX Configuration Utility).
  2. Verify that the currently open configuration target and configuration are the ones you want to modify.
  3. On the General tab, in the Startup message box, enter the message you want to display, and then click OK.
    When the client is started, the text displays in a message box, with an OK button below.

Saturday 25 January 2014

Move all object from layer into the project in AX 2012

Hi ,


We can also export all the objects of layer and take backup. but for doing this we need to move all the objects from a layer into the project. Below I am defining how can we do it.
 Create a new project.



Then open the newly created project.
Choose Advanced Filter/Sort from the toolbar.
A new dialog pops up.


You can choose grouping of the objects as in the AOT or by user.

 Select the required objects.
Use the Select button on the dialog to select the objects you require for your project.
We wanna select all AOT objects from a specific layer, so we’ll use the UtilLevel field in the selection criteria.
                                             



From the screenshot you can see that all objects from the USR layer are selected, you can filter more by entrering the criteria you would like to do.

Thursday 23 January 2014

'The X++ debugger work only for users who are in the 'Microsoft Dynamics AX Debugging Users' local group of the Windows.'

Hi ,

To overcome from the Debugging Error: 'The X++ debugger work only for users who are in the 'Microsoft Dynamics AX Debugging Users' local group of the Windows.' please follow below steps.

To determine the AOS service account 
  1. From the Start menu, point to All Programs, click Administrative Tools, and then click Services. 
  2. In Services, right-click the Microsoft Dynamics AX Object Server service and then click Properties. 
  3. In the Properties window, on the Log On tab, the AOS service account is specified in the This account field. 
To add the AOS service account to the debug group 
  1. From the Start menu, point to All Programs, click Administrative Tools, click Computer Management, and then click Local Users and Groups. 
  2. In Local Users and Groups, double-click Groups, right-click Microsoft Dynamics AX Debugging Users and click Add to Group. 
  3. In the Properties window, click Add and add the AOS service account to the group. 
  4. Restart the machine. 

Thursday 9 January 2014

Find bank account from specification of main account


The following method finds a bank account from the main account attached to it. This is a general approach for relating the main account number to a record storing an account or account+dimensions combination.

Note use of DimensionAttributeValueCombination and MainAccount tables.


BankAccountTable bankAccountFromMainAccount(MainAccountNum mainAccountNum)
{
// Lookup bank account from main account

BankAccountTable bankAccountTable;
DimensionAttributeValueCombination valueCom;
MainAccount mainAccount;

select firstOnly bankAccountTable
join valueCom
where valueCom.RecId == bankAccountTable.LedgerDimension
join mainAccount
where mainAccount.RecId == valueCom.MainAccount
&& mainAccount.MainAccountId == mainAccountNum;

if(!bankAccountTable)
this.throwError(strFmt("Could not find bank account with main account '%1'",mainAccountNum));

return bankAccountTable;
}