Interview Questions

Tuesday, July 29, 2014

Dirty tricks on Ax License


In the
world of Ax, Licenses play a major role. To continue with our day to day work,
at times, we will need to do some dirty work too …

This
entry is result of those dirty works . Let
me go through the following topics:

  • Copying License from one data
    base to another
  • Removing License of a
    particular module
  • Solving Sync issues after
    removing license
  • Working without licenses!!!



Copying License

<<Applicable when you already have this license of a
module in another database and dont have a License file>>

In Ax, Licenses are stored in Database. The tables used as data
source in License Information form are:

1. SysLicenseCodeSort
2. SysConfig

I didn’t do any micro research here, but, quickly jumped into
conclusion that License is stored only these tables as no other tables are
declared or used. 

Euphoria.. !!  Copying these tables from another database will solve the
purpose :)

So, everything we need to do now is:

  1. Backup and truncate records from
    Destination DB
  2. Copy
    records from Licensed DB. This can be by:

  1. Exporting and importing records
    • Export records using export
      tool.
    • Import the exported records.

Or

  1. Cross database query.
    • Insert into
      <<Destination DB>>.<<Tablename>> (Select * from
      <<LicensedDB>>.<<Tablename>>)

PS: But, after doing this, I found that original developer
license is gone. When I imported basic license again, I had all modules


Removing License of a module:

Sometimes, developer environment may have full license and
production environment may not. To simulate environment, we will have to remove
License of few modules.

This can be done as follows: (But, before doing this, make sure
that you have a backup of your database.)

  1. Click Administration > Setup > System > License information
  2. Goto Modules Tab
  3. Select
    the module and delete the LicenseCode
  4. Save and
    synchronize when prompted.

Solving Synchronization issues

Sometimes, after removing the license, synchronization will
fail. This is because a field, having configuration key of a removed module, is
part of an unique index.

For example, if Warehouse Management License is removed from a
DB having Demo data, we will get synchronization error on InventDim Table.

This is because, field WMSPalletId is a part of Warehouse
Management configuration Key. When that license is removed, this field gets
disabled and indexed set of fields will now have duplicate records.

There are many ways to solve this, like

  1. Make the index as non Unique. or
  2. Delete
    duplicate records from Database using a set of Sql queries. or
  3. In the
    EDT of this field, remove the configuration key. How? See below section.

Working without License

It is not impossible to

  • remove a configuration key
    from an EDTor field
  • Make a configuration
    independent of License
  • Make entire Ax License free!!

Follow these steps:

  1. Export the EDT or Config key to an
    xpo file
  2. Remove
    the config key or license in the xpo
  3. Import
    the file back.

To make Ax License free, export all configuration keys into an
xpo and edit it 

If this is first time and you dont have license to open AOT,
then you can import the xpo from command prompt as

Ax32.exe -startupcmd=autorun_"<<xml file locating the
xpo>>"

Tuesday, July 15, 2014

How to set Vendor wise Item price in AX 2012?

Hi all,
        Today I am going to tell you that if you need different item price for different vendors then what you have to do-

For this requirement, You have to post a journal from Sales and Marketing Module.
Then create a new journal. As given in below image.

Then create a new line where you have to select some options like, Table/Group/All. This will effect your options that for whom you are going to effect this price.
Table : It reflects that Item Price will effect a particular user.
Group: It is for User group
All: It is used for all vendors

Now, Validate and Post this journal


How to enable Create Purchase Reuisition button in AX 2012?

Hi, Today I am going to tell you that if your NEW button of Purchase Requisition is not enabled then what you have to do-

Goto System Administration module
Then Select your user name
Then Create a Relation with a Worker
Then Click Save then OK
Now, Check you New button of Purchase Requisition. 

Monday, July 7, 2014

Details information for Print date in AX through X++

//Detailed information of Date Print
static void PrintDate(Args _args)
{
info(date2str(systemdateget(),123,2,1,2,1,4));
}

//Here in the INFO line:
1. 123 = Date Month and Year
You can change the order as per your requirement like. 123, 321, 213

2. Systemdateget()= Through this method you will get current system date

3. After 123 the digit 1 is used to show blank space after Date.
Example : 01 01 2014
You can change it with 1 to 4.
          1 Means Space between date and month and Year
     Example : 01 01 2014
          2 Means Dot(.) between date and month and Year
    Example : 01.01.2014
          3 Means Dash(-) between date and month and Year
    Example : 01-01-2014
          4 Means slash (/) between date and month and Year
    Example : 01/01/2014

4. Now in Info Line 2,1,2,1,4
    Here 2 Means Date's Digit
             1 Means Blank Space
             2 Means Month's Digit
             1 Means Blank Space
             4 Means number of Year's Digit

Friday, July 4, 2014

Multiple Tables in field Lookup method

How To use Multiple Tables in Form LookUp

public void lookup()
{
  Query                   query = new Query();
  QueryBuildDataSource    qbdsPurchTable,QbdsInvntQO, qbdsInventDim;
  QueryBuildRange         qbrVendId,qbrPurchStatus,qbrPurchType;
  QueryBuildLink          qblink1, QbLink2;

  SysTableLookup  sysTableLookup = sysTableLookup::newParameters(tableNum(PurchTable), this);
  ;//breakpoint;
  qbdsPurchTable = query.addDataSource(tableNum(PurchTable));

  QbdsInvntQO = qbdsPurchTable.addDataSource(tableNum(InventQuarantineOrder));
  QbdsInvntQO.relations(false);
  QbdsInvntQO.joinMode(JoinMode::NoExistsJoin);
  qblink1 =  QbdsInvntQO.addLink(FieldNum(PurchTable,PurchId),FieldNum(InventQuarantineOrder,TransRefId));

  qbdsInventDim = QbdsInvntQO.addDataSource(tableNum(InventDim));
  qbdsInventDim.relations(false);
  qbdsInventDim.joinMode(JoinMode::NoExistsJoin);
  QbLink2 = qbdsInventDim.addLink(FieldNum(InventQuarantineOrder,InventDimId),FieldNum(InventDim,InventDimId));

  qbdsPurchTable.addRange(fieldNum(PurchTable, OrderAccount)).value(PurchTable_InvoiceAccountGrid.valueStr());
  qbdsPurchTable.addRange(FieldNum(PurchTable, PurchStatus)).value("Invoiced,Received");
  QbdsInvntQO.addRange(fieldNum(InventQuarantineOrder, Status)).value(queryValue(InventQuarantineStatus::Ended));
  qbdsInventDim.addRange(fieldNum(InventDim, InventLocationId)).value("102018");

  sysTableLookup.addLookupfield(fieldNum(PurchTable,OrderAccount));
  sysTableLookup.addLookupfield(fieldNum(PurchTable,PurchId),true);
  sysTableLookup.addLookupfield(fieldNum(PurchTable,PurchStatus));

  sysTableLookup.parmQuery(query);
  sysTableLookup.performFormLookup();
}

Multi-select lookup Dynamics AX 2012

Multi-select lookup Microsoft Dynamics AX 2012
Normally a lookup allows only one option, but a multi-select once allows one or more options.  Here we are going to show you how to do it with only one command.
First, we have to create a physical query; in this case called “AND_Consult”:
To generate this query we will base in a table, for this example called “AND_TestMult”:
Now, we need the field that we will filter, in this case called “Name”:
After that, we will create a form called “Lookup”:
In this form we add a single code to make the multi-select lookup:
Finally, this is the multi-select lookup:
And there are the multi-selected names.
We have demonstrated that we can improve our AX 2012 programming using a single command.
 Normally a lookup allows only one option, but a multi-select once allows one or more options.  Here we are going to show you how to do it with only one command.
First, we have to create a physical query; in this case called “AND_Consult”:

How to get Configuration Port Number through x++ code (AX 2012)

//Write this code in Job
static void FindPortNumber(Args _args)
{
    Str PortInfo;

PortInfo=strfmt("Port number of AOS IS: %1",int2str(Session::getAOSPort()));

info(PortInfo);

}

How to setup Business Relation Type in AX 2009

Hi All,
          Today I am going to tell you that if you need to add business relation then how can you accomplish this task. In this image if you want to add Type ID then how can you complete this task?


Solution : GO To CRM module > Setup > Contact Management > Relation Types.


Task Done.

Thursday, July 3, 2014

Error "Parameter setup of either language, currency, or type not specified. This is required to create a new prospect." in AX 2009

Hi All,
          Today I am going to tell you that if you will Face an Error "Parameter setup of either language, currency, or type not specified.  This is required to create a new prospect." during opportunity creation then, How you can solve this error.


Solution : Goto CRM module > Setup > Parameters
In this form you have to enter three values.
1. Language
2. Currency
3. Type


Task Done.