Leader Board

How to post PO by Code in Dynamics AX

I have task to integrate Dynamics AX with another application by posting PO from out side Dynamics AX, so I used AIF and build new web service to be used from out of AX and call the method below to post PO (packing slip, or invoice) .
public str CreatePostProductReceipt(PurchId _PurchId, Num _PackingSlip, ItemId  Itemid, Qty qty,
InventSiteId  InventSiteId ='', InventLocationId  InventLocationId= '' , inventBatchid batchid = '', InventSerialId  serialId = '', inventsizeId inventsizeId ='', InventColorId InventColorId ='')
{
PurchFormLetter             purchFormLetter;
PurchParmUpdate             purchParmUpdate;
PurchParmTable              purchParmTable;
PurchParmLine               purchParmLine;
PurchTable                  purchTable;
PurchLine                   purchLine;
PurchId                     purchId;
Num                         packingSlipId;
InventDim                   inventDim;
str                 ret='';
System.Exception    err;
;
packingSlipId   = _PackingSlip;
purchTable      = PurchTable::find(_PurchId);
ttsBegin;
try
{
// Create PurchParamUpdate table
purchFormletter = PurchFormLetter::construct(DocumentStatus::PackingSlip); // to post invoice change to DocumentStatus::invoice
purchFormLetter.createParmUpdate(true);
purchParmUpdate = PurchFormLetter.purchParmUpdate();
// Set PurchParmTable table
purchParmTable.clear();
purchParmTable.TransDate                = SystemDateGet();
purchParmTable.Ordering                 = DocumentStatus::PackingSlip;
purchParmTable.ParmJobStatus            = ParmJobStatus::Waiting;
purchParmTable.Num                      = packingSlipId;
purchParmTable.PurchId                  = purchTable.PurchId;
purchParmTable.PurchName                = purchTable.PurchName;
purchParmTable.DeliveryName             = purchTable.DeliveryName;
purchParmTable.OrderAccount             = purchTable.OrderAccount;
purchParmTable.CurrencyCode             = purchTable.CurrencyCode;
purchParmTable.InvoiceAccount           = purchTable.InvoiceAccount;
purchParmTable.ParmId                   = purchParmUpdate.ParmId;
purchParmTable.insert();
// Set PurchParmLine table
while select purchLine
where purchLine.PurchId == purchTable.purchId && purchline.ItemId == Itemid
{
purchParmLine.InitFromPurchLine(purchLine);
inventDim = purchline.inventDim(true);
// Set batch and serial number
if(InventSiteId != '')
inventDim.InventSiteId = InventSiteId;
if(InventLocationId != '')
inventDim.InventLocationId = InventLocationId;
if(batchid != '')
inventDim.inventBatchId = batchId;
if(serialid != '')
inventDim.inventSerialId = serialID;
if(inventsizeId != '')
inventDim.inventsizeId = inventsizeId;
if(InventColorId != '')
inventDim.InventColorId = InventColorId;
purchParmLine.InventDimId = inventDim::findOrCreate(inventdim).inventDimId;
purchParmLine.ReceiveNow    = 1 ; //PurchLine.PurchQty;
purchParmLine.setInventReceiveNow();
purchParmLine.ParmId        = purchParmTable.ParmId;
purchParmLine.TableRefId    = purchParmTable.TableRefId;
purchParmLine.setQty(DocumentStatus::PackingSlip, false, true);
purchParmLine.setLineAmount();
purchParmLine.insert();
}
ttsCommit;
purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
purchFormLetter.transDate(systemDateGet());
purchFormLetter.proforma(false);
purchFormLetter.specQty(PurchUpdate::PackingSlip);
purchFormLetter.purchTable(purchTable);

// This is the ID we hard code as the product receipt ID, if we do the posting via UI
// user would have the option to manually enter this value
purchFormLetter.parmParmTableNum(purchParmTable.ParmId);
purchFormLetter.parmId(purchParmTable.ParmId);
purchFormLetter.purchParmUpdate(purchparmupdate);
purchFormLetter.run();
return "OK";
}
catch (Exception::CLRError)
{
err = CLRInterop::getLastException();
ret = err.ToString();
return ret;
}
Return "Error";
}

How to Call Report from Dynamics AX 2009

After you created your report in AX you can call report from  AX form by follow the below steps:

1- Create menu item with type output by drag and drop report to MenuItems nodes under AOT.

2- Open the form that you need to call report from.

                  Note: the form should be have dataSource with the table in report

3-  Drag and Drop menu Item created in step 1 in the form under any button group.

4- Add the following method to Report

void initFromCaller(Args _args)
{
    str                   QrderId; // field used as Rang and used to filter data
    QueryBuildDataSource  qbds; // should be represent report datasource and selected record in the form

    ;

    if (! _args ||
        ! _args.caller() ||
          _args.dataset() != tablenum(TableName) )
        return;

    QrderId = _args.record().(fieldnum(TableName,FieldName));

    qbds    =  element.query().dataSourceTable(tablenum(TableName));

    if(!qbds.findRange(fieldnum(TableName,FieldName)))
    {
        qbds.addRange(fieldnum(TableName,FieldName)) ;
    }
    qbds.findRange(fieldnum(TableName,FieldName)).value(queryvalue(QrderId));

}

Inventory Closing slow

May The below link lead you to solve Dynamics ax closing slowness issue by creating new indexes in the main tables used in the recalculation and closing process in Dynamics ax.

Inventory Closing slow:

JOB OPPORTUNITY

An Egyptian Group is hiring:

1- AX 2012 R3 Functional Specialist (specially Logistics, Banking, and GL)

2- AX 2012 R3 Junior Developer (X++, MS Visual Studio 2010 or newer, SSRS, MorphX)

Requirements:

+1 years experience in AX 2012 Microsoft certified is a plus

** If interested, please send your CV to: m.anwar@raneen.com.eg

Your email subject should include the Job you are seeking.

(Vacancies)contracts and permanent jobs

Good morning,
The market for Microsoft Dynamics is very busy at the moment and we have a number of contracts and permanent roles that might be of interest to you, please take a moment to have a look.
TPC 008
Dynamics NAV Developer – based in southern Denmark, solid NAV development skills essential 5000DKK per day
TPC 015
SSRS AND SSIS BI Developer in an AX environment – UK South Coast, must have proven commercial SSRS and SSIS experience, perm role up to £50k
TPC 016
Dynamics CRM PreSales Consultant – London – working with a successful tier 1 international Microsoft Partner, £100k package available for the right person
TPC 017
Dynamics CRM development consultant – Dynamics CRM development within the hedge fund industry, based in St James, London, immediate start £400 per day
TPC 018
Dynamics AX Consultant – Paris based AX Financial Consultant, within the retail / fashion industry, this is an upgrade for a platform with over 4000 users, must have experience of larger implementations. €750 per day
TPC 019
Dynamics AX Developer – Munich – For an aviation client must be able to work in Munich due to the nature of the project there is NO work offsite option €600 per day
TPC20
Dynamics AX PM – Manchester based Dynamics AX PM role within the insurance industry, working for an end user, but will also have oversight of the Microsoft partner staff, this is an AX2015 upgrade from an AX2009 install. £700 per day
If you are interested in any of these roles or are becoming available, please get in touch on CMerchant@templeton-recruitment.com
Have a great week

Object has not been initialized Erro in Ax 2012

When user open journal lines from GL ---> General journal  ---> Line

got below error

objectnotinitialized

 

Solution:

1- Delete *.auc files from user Machine

2- release Usage data under Tools –> option –> Usage Data ---> reset button

Running AX report through batch job in AX2009 (batch printing)

Running batch report in AX2009 (batch printing)

Since the change of AX2009 batch framework, printing of report through batch can be done through two methods:
- Printing from server (to printer or file)
- Printing from client (the legacy batch processing)
Prerequisites: For both of the method, there're some mandatory setup:

  1. Enable any of the AOS that you want to make it as batch AOS
    (Administration -> Setup -> Server configuration)
  2. Create batch group for printing.
    Eg. One for client printing and one for server printing.
    (Administration -> Setup -> Batch groups)
  3. Add the batch group created in #2 into the AOS enabled for batch processing (in #1)

complete article available here

Dynamics AX Workflow types - AX 2012

To create a workflow, you must first select the type of workflow that you want to create. This topic lists the types of workflows that you can create in each module. The topic also describes what each type of workflow is used for, and whether the workflows of each type are associated with a specific company in the organization or with the whole organization.

https://technet.microsoft.com/en-us/library/dd362043.aspx

Data Import/Export Framework error

Troubleshoot issue with a Data Import/Export Framework installation from cumulative update 7 for Microsoft Dynamics AX 2012 R2

After you install cumulative update 7 for Microsoft Dynamics AX 2012 R2, the Data Import/Export Framework appears to be installed, but you receive error messages when many forms are opened like the following:

You receive an “Assembly containing type Microsoft.Dynamics.AX.DMF.ServiceProxy.DmfEntityProxy is not referenced.” error

Reason: When you install cumulative update 7 for Microsoft Dynamics AX 2012 R2, the Data Import/Export Framework appears to be installed for members of the System Administrators role. However, the binary components of the framework are not present.
Solution:

please click here to get solution

Regular maintenance activities in Dynamics AX that affect performance

The following list describes some of the maintenance activities that we recommend that you perform regularly in your production environment:
  • Defragment indexes – You can defragment indexes from either SQL Server Management Studio or the Intelligent Data Management Framework (IDMF).

  • Update SQL Server statistics from SQL Server Management Studio – We recommend that you run both manual and automatic updates of statistics. Manual updates may become more important as the size of your database increases, because automatic updates are less likely to be completed on large data sets.

  • Reduce the size of the database – You can use IDMF to keep the size of the production database small. A small database makes database operations more efficient. For example, you can delete or archive data that is not required in your production system.

Troubleshoot an installation of the Data Import/Export Framework from InformationSource

This post describes how to troubleshoot issues with a Data Import/Export Framework installation from InformationSource.

The Data Import/Export Framework does not compile

After you install the Data Import/Export Framework, if you cannot compile, validate that the Data Import/Export Framework was installed correctly.

  1. Verify that the Microsoft Dynamics AX Data Import/Export Framework service is running.

  2. Verify that the Data Import/Export Framework DLLs are present in C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin folder:

    • Microsoft.Dynamics.AX.DMF.Mapper.dll

    • Microsoft.Dynamics.AX.DMF.PreviewGrid.

    • Microsoft.Dynamics.AX.DMF.ServiceProxy.dll

    • DMFConfig.xml

    • Microsoft.Dynamics.AX.DMF.DriverHelper.dll

Resolution

Copy the DLLs from the installation location (C:\Program Files\Microsoft Dynamics AX 2012 Data Import Export Framework Client Component) to the C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin folder.

Exception message while you use Data Import/Export Framework

While you use the Data Import/Export Framework, you might receive the following error message:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException

Verify that the following files are present in the C:\Program Files (x86)\Microsoft Dynamics AX\60\Server\Bin folder on the server that is running the AOS instance:

  • DMFConfig.xml

  • DMFClientConfig.xml

  • Microsoft.Dynamics.AX.DMF.ServiceProxy.dll.config

Resolution

Copy the .xml and the config files from the installation location (C:\Program Files\Microsoft Dynamics AX 2012 Data Import Export Framework Server Component) to the C:\Program Files (x86)\Microsoft Dynamics AX\60\Server\Bin folder on the server that is running the AOS instance.

Changes to the location of the Data Import/Export Framework service

If you have to update the location where you run Integration Services and the Data Import/Export Framework service, you can update the endpoint address in the Microsoft.Dynamics.AX.DMF.ServiceProxy.dll.config file to use the new server name.

<endpoint address="http://<<NEW MACHINE NAME>>:7000/DMFService/DMFServiceHelper.svc"

NoteNote

The Microsoft.Dynamics.AX.DMF.ServiceProxy.dll.config file is located in the C:\Program Files (x86)\Microsoft Dynamics AX\60\Server\Bin folder on the server that is running the AOS instance.