Interview Questions

Monday, April 27, 2015

How to set default company in AX for any vendor address?

Hi All,
If you want to set default country code for any vendor's address then you need to set country at:

"CEU/Procurement and sourcing/Setup/Vendors/Enbargoed Countries/Regions"

in this form you need to set a default country.

Vendor Performance Evolution

If you want to evolution any vendor then you need to do setup in given path:

CEU>Procuurement and Sourcinng> Setup> Categories> Map Procurement Categories.

At this location you can do this task. 

Tuesday, March 31, 2015

If you can receiv email fine, but cannot send messages through outlook....

Outlook 2007, 2010 and 2013 (and Outlook 2003 SP2 and above)

  1. Go to Tools menu > Account settings
  2. Select the relevant GreenNet email account, and click the “Change” button (third from the left above that line)
  3. Make sure that the “Outgoing mail server (SMTP)” box reads “smtp.gn.apc.org” if this is a GreenNet account. (If you have “smtp.greennet.org.uk” it is worth changing to “smtp.gn.apc.org”.)
  4. Click the “More settings…” button to the bottom right.
  5. Click the second tab along, “Outgoing server” and ensure “My outgoing server (SMTP) requires authentication” is ticked. Select “Use same settings as my incoming mail server”. “Require secure password authentication” should not be ticked.
  6. Click the right-hand tab, “Advanced”.
  7. For “Outgoing server (SMTP)”, remove “25” if that is what you have, and first try entering 587. In this case change “Use the following type of encrypted connection” to TLS. Click “OK” and next.
  8. Cancel any messages being sent, and try sending again.
  9. If you still get an error, you may want to try using “2525” “Outgoing server (SMTP)” without any encryption (not secure), or possibly “465” with SSL encryption (secure).

Sunday, March 15, 2015

"You are not authorized to access table ‘Bills of materials’ (BOMTable). Contact your system administrator" error in AX 2012 R3

That happens because if related Configuration Key  is disabled .

The solution is to enable configuration keys from :
Administration > Setup > System > License Configuration

Check for 'Bill of Material' under 'Trade' in License Configuration form.

Then it will synchronize related tables.

Once this is done Try again to open the form / table

Please verify

Sunday, February 22, 2015

Delete all companies through code (x++) in AX 2012

static void DeleteCompanyAccountsByXPP(Args _args)
{
DataArea dataArea;
dataAreaId dataAreaId = 'USMF';
container virtualCompanies;
boolean validateDelete;
;

select dataArea where dataArea.id == dataAreaId;

if(dataArea)
{
validateDelete = xDataArea::validateDelete(dataArea);
if(validateDelete)
{
//Find virtual companies which are only assoicated with this
//deleted real company

virtualCompanies=xDataArea::findVirtualCompaniesAffected(dataAreaId);
if (xDataArea::delete(dataAreaId))
{
xDataArea::resyncOnRealCompChange(virtualCompanies);
}
else
{
// this.mark(o);
xDataArea::reloadTableCollections();
}
}
}
else
{
throw error(strfmt("Invalid company accounts %1",dataAreaId));
}
info("done");
}

Thursday, October 16, 2014

Exporting the Data from AX to CSV file

Hi All,

Today I want to share a code for exporting data from AX to CSV file with an example of Invent table.

static void ExportDataToCSV(Args _args)
{
    Query                                 q;
    QueryBuildDataSource     qbds;
    QueryBuildRange             qbr;
    QueryRun                         qr;
    CommaIO                         commaIO;
    FileName                          fileName;
    InventTable                      inventTable;
    ;
   
    fileName       = WINAPI::getTempPath() + "ItemDetails" + ".csv";
    commaIO      = new CommaIO(fileName,'CSVFile');
   
    q                  = new Query();
    qbds             = q.addDataSource(tablenum(InventTable));
    qbr               = qbds.addRange(fieldnum(InventTable,ItemId));
   
    qr                = new QueryRun(q);
   
    commaIO.write("ItemId","Item Name","Item Type","Item GroupId","Dimension GroupId","Model GroupId");
    while( qr.next() )
    {
        inventTable = qr.get(tablenum(InventTable));
       
        commaIO.write(inventTable.ItemId,inventTable.ItemName,enum2str(inventTable.ItemType),inventTable.ItemGroupId,
                      inventTable.DimGroupId,inventTable.ModelGroupId);
    }
   
    WINAPI::shellExecute(fileName);
}