Posts

Offline database creation steps for Dynamic AX 2012 R3 POS

Image
We can have offline database for the retail stores in case the channel database is offline, or the network is down. Below are the steps to follow for offline database to create in Dynamics AX 2012 R3 version. If there is an existing offline Database in fault status or not syncing, then we can re-create the offline DB by de-provision the database. If it is new offline DB creation the skip to step of running the Retail Channel Configuration Utility. Stop the offline sync service in the POS machine and delete the offline DB from SQL Server. Open the channel database system and follow below steps to de-provision the channel database. Backup Channel database. Open command prompt with elevated privilege and run the following command line: C:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Database Utility>RetailDbUtilityCmd.exe DeprovisionChannelDB                  /StoreServername:<YourStoreServerName> /St...

Create General Journal in AX 2012 from AX 2009 using X++ and webservices

Recently i came across a requirement where i need to create a daily general journal entry in AX 2012 for the data entered on custom screen in AX 2009. To achieve this, we have different options. Initially we thought of making use of AIF and XML files but we want to see the journal created with immediate effect.           So decided to consume the AX2012 AIF webservice WSDL URI directly in AX 2009 using X++ code. So below are the steps we followed. Create the Inbound service port for Ledger general journal service. Use the service operation create from LedgerGeneralJournalService . It is advisable to enable the include exceptions in fault flag to get the error message under troubleshoot fast tab. Activate the port. Copy the dll file created for inbound port from the AOS server (Typically the folder path would be - C:\Program Files\Microsoft Dynamics AX\60\Server\<your server>\bin\XppIL\AppShare\ServiceGeneration\<YourAIFPortName.dll...

Create Custom Financial Dimension in AX 2012

Image
In the Financial dimensions list we have standard dimension list provided by Microsoft. If we want to have custom dimension you have to select custom dimension & define the values. What if we want to work custom dimension just like the standard dimension eg. ProjId. The Proj Id dimension dropdown shows the projects from view. So lets create a "Project Quotation Id" custom dimension just like ProjId standard dimension. Project quotation Id is not in the standard list of dimension. Follow the below steps to create one. 1. Create a view which points to the SalesQuotationTable & define the fields as shown below. 2. The Key Field points to RecId of  SalesQuotationTable 3. Value -> QuotationId 4. Name -> QuotationName 5. Customize the DimensionEnabledType  class by writing a server static method as below public static server DimensionEnabledType ABC_constructForQuotationId(RecId _financialTagCategoryId = 0, TableLabel _viewLabel = '') ...

SalesTable2Line custom field update prompt on Sales order in AX 2012

Image
 Dynamics AX has standard functionality to show a prompt for any common fields on Sales Header & Lines are being updated on header. This prompt is based on the setup done on the AR Parameters form -> Updates -> Update order lines button If we want to have our custom field to behave in same manner, then we need to do following steps. 1. Create your new field on the SalesTable & SalesLine tables. Here for I am going to use field as "AS_TitleTransfer" 2. Add the  AS_TitleTransfer field to SalesTable field group HeaderToLineUpdate. 3. Add the new field on the Header & Lines section on SalesTable form like on General Tab. 4. In the AxSalesTable class add parm & set methods for new field. public <<your EDT>> parmAS_TitleTransfer( <<your EDT>>  _Id = '') {     if (!prmisDefault(_Id))     {         this.setField(fieldNum(SalesTable, AS_Ti...

Check if Invoice Date is in current Ledger Period using X++

public boolean AS_isInvoiceInCurrentLedgerPeriod(TransDate _transDate, TransDate _oldDate) {     FiscalCalendarPeriod         oldPeriod;     FiscalCalendarPeriod         newPeriod;     FiscalCalendarRecId          fiscalCalendarRecId = CompanyInfo::fiscalCalendarRecId();     LedgerFiscalCalendarPeriod   ledgerFiscalCalendarPeriod;     if (!FiscalCalendars::findYearEndClosingPeriodByDate(fiscalCalendarRecId, _transDate).RecId)     {         // The transaction date is not in a valid period.         return checkFailed("@GLS54501");     }     oldPeriod = FiscalCalendars::findPeriodByPeriodCodeDate(fiscalCalendarRecId, _oldDate);     newPeriod = FiscalCalendars::findPeriodByPeriodCodeDate(fiscalCalendarRecId, _transDate);     if (!newPeriod.RecId)...

Inventory period open checking using X++

public boolean isInventPeriodOpen(TransDate              testDate,                                  boolean                onDateOk = false,                                  InventTransCurrency_RU _inventTransCurrency = InventTransCurrency_RU::PrimaryCur) {     #ISOCountryRegionCodes     TransDate closingDate = InventClosing::closingDate(false, _inventTransCurrency);     if (!SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]) || testDate)     {         if ((testDate <= closingDate && !onDateOk) ||             (testDate <  closingDate &&  onDateOk))         {  ...

Purchase Order Invoice posting with using X++ with custom VendInvoiceInfoLine fields

private boolean postPOInvoice(PurchTable purchTable) {     PurchFormLetter         letter      = purchFormLetter::construct(DocumentStatus::Invoice);     PurchParmUpdate         purchParmUpdate;     PurchLine               purchLineLocal;     VendInvoiceInfoTable    vendInvoiceInfoTable;     VendInvoiceInfoLine     vendInvoiceInfoLine, vendInvoiceInfoLineFrom;          boolean                 ret = true;                   letter.purchTable(purchTable);         letter.initParmDefault();         letter.transDate          (systemdateget());         letter.specQty            (PurchUp...