Monday, 6 November 2017

No tree node for \DataDictionary\Tables

No tree node for \DataDictionary\Tables



Getting error while generating source file in DMF.

Solution:

For this error, just re-start the AOS Server.


Thanks

Thursday, 5 October 2017

Import and export of Model in ax 2012


Import and export of Model in ax 2012


Hi all

I have a scenario for moving the model object to one AOS to another AOS. But the AOS is located in the same server.

For this situation, i have know what are the database for this two AOS.

You have to export or import the objects you must take the "Model database" only.

How to Import and Export:

On the Start menu, point to All Programs, point to Administrative Tools, and then click Microsoft Dynamics AX Management Shell.

For Export:

Export-AXModel -Model "USR Model" -File "c:\temp\USR_Model" -Database TestDAX_Model

For Import:

Install-AXModel -File "c:\temp\USR_Model" -Database TestDAX_GST_model

While importing the object the same Model name already exist in the importing AOS i.e., (In two AOS "USR Model" name is exist). You face conflict for this use this command.

Install-AXModel -File "c:\temp\USR_Model" -Database TestDAX_GST_model -createparents -Conflict Push

Importing is done.

Make sure that Restart the AOS, synchronize, compile, full CIL.


Thanks

Wednesday, 26 April 2017

FTP file transfer to another server in ax 2009


FTP file transfer to another server in ax 2009


static void uploadTestFile(Args _args)
{
   System.Object ftpo;
   System.Object ftpResponse;
   System.Net.FtpWebRequest request;
   System.IO.StreamReader reader;
   System.IO.Stream requestStream;
   System.Byte[] bytes;
   System.Net.NetworkCredential credential;
   System.String xmlContent;
   System.Text.Encoding utf8;
   System.Net.FtpWebResponse response;
   ;
   // Read file
   reader = new System.IO.StreamReader("E:\\signed file path\Test.xml");
   utf8 = System.Text.Encoding::get_UTF8();
   bytes = utf8.GetBytes( reader.ReadToEnd() );
   reader.Close();
   // little workaround to get around the casting in .NET
   ftpo = System.Net.WebRequest::Create("ftp:/198.168.64.108:24/Imges/Test.xml");
   request = ftpo;

   credential = new System.Net.NetworkCredential("ananymous","P@ssw0rd");
   request.set_Credentials(credential);
   request.set_ContentLength(bytes.get_Length());
   request.set_Method("STOR");
   // "Bypass" a HTTP Proxy (FTP transfer through a proxy causes an exception)
   // request.set_Proxy( System.Net.GlobalProxySelection::GetEmptyWebProxy() );
   requestStream = request.GetRequestStream();
   requestStream.Write(bytes,0,bytes.get_Length());
   requestStream.Close();

   ftpResponse = request.GetResponse();
   response = ftpResponse;
   info(response.get_StatusDescription());
}

Monday, 24 April 2017

C:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin\AX32.exe

C:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin\AX32.exe



Hi,

I am getting the following error while run login with different user in ax 2009 Configuration files.






For this resolution:

Add the user( who login you want to access that user)  in user group of your system. Then try to run again login with different your.

Issue resolved for me.

"Unable to connect to remote server" error in AX2012 R2

"Unable to connect to remote server" error in AX2012 R2


Go to Reporting Services Configuration Manager.

1. Change the server account to local account.
2. Remove the SSL if configured.
3. Go to C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
4. In rsreportserver.config Change the SecureConnectionLevel value to "0"
Restart the sql server reporting service.

Thursday, 30 March 2017

How to get query sum value using X++ code in ax 2012

How to get query  sum value using X++ code in ax 2012 


static void querySumCustAmountMST(Args _args)
{
    Query                               q;
    QueryBuildDataSource                qbds;
    queryBuildRange                     qbr;
    QueryRun                            qr;
    CustTrans                           custTrans;

    q                                   = new Query();

    qbds    = q.addDataSource(tablenum(CustTrans));
    qbds.addSelectionField(fieldNum(CustTrans,AmountMST),SelectionField::Sum);
    qbr     = qbds.addRange(fieldNum(CustTrans,AccountNum));

    qbr.value(strfmt("1001"));
    qr = new QueryRun(q);
    
    while(qr.next())
    {
        custTrans   =   qr.get(tablenum(CustTrans));
        info(strfmt("%1",custTrans.AmountMST));
    }
}


Tuesday, 21 March 2017

How we can add custom Lookup on Morphx Report Dialog Box in ax 2012


How we can add custom Lookup on Morphx Report Dialog Box in ax 2012


Please find the Link for your reference.

https://dynamicsuser.net/ax/f/developers/92265/how-we-can-add-custom-lookup-on-morphx-report-dialog-box/486844#486844

You can get solution from this link.


Sunday, 5 March 2017

Like and Not like operation in ax 2012


Like and Not like operation in ax 2012

For Like operation:

static void likeOperation(Args _args)
{
    CustTable                         custTable;
    
    while select custTable where custTable.AccountNum like "1101"
    {
        info(custTable.AccountNum);
    }
}

For Not Like operation:

static void NotlikeOperation(Args _args)
{
    CustTable                         custTable;
    
    while select custTable where !(custTable.AccountNum like "1101")
    {
        info(custTable.AccountNum);
    }
}

Thank you

Thursday, 2 March 2017

Data getting using queries in ax 2012


Data getting using queries in ax 2012

static void AddRangeToQuery(Args _args)
{
    Query                               q = new Query();
    QueryRun                        qr;
    QueryBuildDataSource    qbr1,qbr2;
    str                                     strTemp;
    HPRWebUsers                 webUsers,webUsers2;
    EmplTable                        emplTable;
    ;
 
    qbr1 = q.addDataSource(tablenum(EmplTable));
    qbr1.addRange(fieldNum(EmplTable, EmplId)).value("f08*");
   
    qr = new QueryRun(q);

    while (qr.next())
    {
        emplTable = qr.get(tablenum(EmplTable));
        info(empltable.EmplId);
    }
}

Thank you...!

Tuesday, 24 January 2017

Enable or Disable Secuirty Policies in ax 2012 R2

Enable or Disable Secuirty Policies in ax 2012 R2

For my issues Security policies is working fine for all forms but particular transfer order form no need to work.

When i am getting the error while transfer items from one warehouse to another warehouse getting error.

I find the issues is InventSite table --> exist method.

So, i added below code for that.

static public boolean exist(InventSiteId  _inventSiteId)
{
    InventSite  inventSite;
    #define.InvalidContext('DisplayBrachData')
    boolean isFound;
    XDSServices xds = new XDSServices();
    // Disable the address book XDS by passing an invalid context string
    xds.setXDSState(0);
     select RecId from inventSite
                                 index SiteIdx
                                 where inventSite.SiteId == _inventSiteId;//.RecId != 0;
    isFound = _inventSiteId && (inventSite.RecId != 0);
    xds.setXDSState(1);
    return isFound;
}

Friday, 6 January 2017

Exception occurred on the metadata service on client or server in ax


Exception occurred on the metadata service on client or server in ax 

I am working on SSRS Reports getting a error while selecting a query.

For this error you have to refresh WCF Configuration file.

Go to :

Control Panel --> All Control Panel Items ---> Administrative Tools --> Open Ax 2012 configuration 

Click on the Refresh Configuration button. As shown below.

Note: For original Configuration file it is disable. For that you have to create a new configuration with same Server, TCP/IP and WSDL Port.


Close the visual studio and re-open it.