Posts

Fix Dynamics 365 for finance and operations error : unable to read beyond the end of stream

  Fix Dynamics 365 for finance and operations error : unable to read beyond the end of stream. To fix this issue: Build the model you are working on. If doesn't fixed, build full models.  

Import the database from UAT or Production in Dynamics 365 for Finance and operation (D365fo)

Download a database backup (.bacpac) file. Download sqlpackage .NET Core for Windows from   Get sqlpackage .NET Core for Windows . Open a  Command Prompt  window, and run the following commands from the sqlpackage .NET Core folder:  SqlPackage.exe /a:import /sf:< Backup Path > /tsn:< Target server name > /tdn:< Target database name >  /p:CommandTimeout=1200 /TargetTrustServerCertificate:True Example: SqlPackage.exe /a:import /sf: C:\Backup\UATbackup .bacpac /tsn: DEV_SERVER /tdn: AxDB_FromUAT /p:CommandTimeout=1200 /TargetTrustServerCertificate:True Run the following SQL script : CREATE USER axdeployuser FROM LOGIN axdeployuser EXEC sp_addrolemember 'db_owner' , 'axdeployuser'   CREATE USER axdbadmin FROM LOGIN axdbadmin EXEC sp_addrolemember 'db_owner' , 'axdbadmin'     --CREATE USER axmrruntimeuser FROM LOGIN axmrruntimeuser --EXEC sp_addrolemember 'db_datareader', 'axmrruntimeuser' --EXEC sp_addrolem

How to Create a Custom Service in D365fo (Using Data Contract)

Image
Create custom service in D365fo: Create the Request Class. Create the Response Class. Create the Service Class. Create the Service Object. Create the Service Group. Request Class [DataContractAttribute] class TBS_VendRequest {     private DataAreaId dataAreaId;     private VendAccount accountNum;     [DataMember("DataAreaId")]     public DataAreaId parmDataAreaId(DataAreaId _dataAreaId = dataAreaId)     {         if (!prmIsDefault(_dataAreaId))         {             dataAreaId = _dataAreaId;         }         return dataAreaId;     }     [DataMember("AccountNum")]     public VendAccount parmAccountNum(VendAccount _accountNum = accountNum)     {         if (!prmIsDefault(_accountNum))         {             accountNum = _accountNum;         }         return accountNum;     } } Response Class [DataContractAttribute] class TBS_VendResponse {     private boolean     result;     private str         error;     private DataAreaId dataAreaId;     private VendAccount accoun

Setup Postman To Call D365fo API

Image
Prerequisites Install Postman on the local development VM. Go to https://portal.azure.com Select " Azure Active Directory " Write the " Tenant ID" . We will use it later with name "Directory ID" Select "App registrations"  then click "+ New registration"  and fill data as following and press Register: Write the "Application (client) ID". We will use in later with name "Client ID" Select "Certificates & secrets" then click the "+ New client secret". Fill Description and Expires then click "Add" . Write the " Value ". We will use it later with name "Client secret ID" Login to D365fo then go to System administration then Setup then Azure Active Directory applications . Click New then fill the "Client ID" with the "Application Client (ID)" then fill "Name"  then fill "User ID" , for testing select user with system administ

How to Open a Dynamics AX Client with No Load-balancing / Connecting Dynamics AX to a Specific AOS Instance / Manage a client configuration

Image
  Open  Microsoft Dynamics AX 2012 Configuration and i n the "Configuration command to run at kernel startup" field enter the following command  –loadbalance=0

Force synchronization in Microsoft Dynamics AX 2012 using X++

    Dictionary              dictionary;     int                     iLoop;       int                     totalTablesCount;     TableId                 tableId;     Application             application;     SysOperationProgress    progress;     StackBase               errorStackBase;     ErrorTxt                error;     ;     application         = new Application();     dictionary          = new Dictionary();     totalTablesCount    = dictionary.tableCnt();          progress            = new SysOperationProgress();     progress.setTotal(totalTablesCount);     progress.setCaption("@SYS90206");     errorStackBase      = new StackBase(Types::String);     try     {         for (iLoop = 1; iLoop <= totalTablesCount; iLoop++)         {             tableId     = dictionary.tableCnt2Id(iLoop);             progress.setText(dictionary.tableName(tableId));                          application.dbSynchronize(tableId, false, true, false);             progress.incCount();         }     }