Skip to main content

Posts

Showing posts from 2017

How to change Company of Employee in Axapta by code

To change Company of Employee in Axapta by code you can get hint by below code. Its tedius task to update you need to do it very carefully and understand then code then apply in your customization. ttsBegin; hcmWorker=hcmWorker::findByPersonnelNumber(Personalumberid); select companyinfohsd where companyinfohsd.dataAreaId=="dat"; select companyinforss where companyinforss.dataAreaId=="ceu"; select forupdate hcmEmployment where hcmEmployment.Worker==hcmWorker.RecId && hcmEmployment.LegalEntity==companyinfohsd.RecId; hcmEmployment.LegalEntity=companyinforss.RecId; hcmEmployment.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction); hcmEmployment.doUpdate(); ttsCommit;

Insert Records in Item batch Table by code in Ax 2012

To Insert Records in Item batch Table by code in Ax 2012 you can take hints from below code. First, you need to check whether a record exists or not in the inventbatch table if it does not exist then you can insert records. if (InventBatch::exist(Itemid,Inventbatchid)) { //error("Batchnumber already exists"); } else { inventBatch.itemId=Itemid; inventBatch.inventBatchId=Inventbatchid; inventBatch.prodDate=mkDate(1,12,2017);//systemDateGet(); inventBatch.insert(); }

Product transaction cycle from Creation of item to sales , purchase and on hand in Ax 2012

By viewing below clip you will able to know Product transaction cycle from Creation of item to sales and purchase and on hand physical in Ax 2012. 1. How to create Item in ax 2012 and assign item group, tracking dimension etc 2.Create, confirm and post-purchase order in the system. 3.Create, validate and post-movement journal in the system. 4.Create, confirm and post-sales order in the system. 5. On hand effect checking on the item on each process against inventory dimension. Please visit and see the clip and subscribe on youtube to get more updates.

How to convert Amount in Accounting currency in Ax 2012

To convert Amount in Accounting currency in Ax 2012 you can take help of below code, first you need to find accounting currency then you can pass the value of currency using method calculatecurrencytocurrency . Here an example to convert delivery remainder to accounting currency. Ledger ledger; Currencycode accCurrency; CurrencyExchangeHelper currencyExchangeHelper; AmountMst amountMST; select ledger where ledger.PrimaryForLegalEntity == CompanyInfo::findByCompany_IN(curext()).RecId; accCurrency = ledger.AccountingCurrency; currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet()); amountMST = currencyExchangeHelper.calculateCurrencyToCurrency(this.CurrencyCode , accCurrency ,1 , true); return this.SalesPrice * this.RemainSalesPhysical * amountMST;

Auto Submit Workflow for Approval in Ax 2012

Sometimes we need to submit Auto Submit Workflow for Approval in Ax 2012 then you can try below code by job. One thing you need to remember submitter should not be approval in workflow designer if its then this job may create some issue on approval. Rest is fine you can use this code for your customization. Inventtable inventtable =InventTable::find("628034tr1"); Workflow::activateFromWorkflowType("InventApprWFType", //Template name inventtable.RecId, //Record id of the document that you are submitting, 'Auto-Submitted into workflow', //A comment for the workflow history to know something about how this was submitted, false,//This document wasn't submitted from the web, 'userid1'); // T info("done");

X++ code for Project Item Requirement posting in Ax 2012

Below is the X++ code for Project Item Requirement posting in Ax 2012. SalesFormLetter salesFormLetter; salesTable Salestablelocal; str 200 msg; if(this.parmSalesid()) { changeCompany(_legalentity) { select Salestablelocal where Salestablelocal.Salesid ==this.parmSalesid() && Salestablelocal.salestype==SalesType::ItemReq && Salestablelocal.SalesStatus==SalesStatus::Backorder; if(Salestablelocal) { ttsBegin; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation); salesFormLetter.update(Salestablelocal); salesFormLetter = SalesFormLetter::construct(DocumentStatus::ProjectPackingSlip); salesFormLetter.update(Salestablelocal); ttsCommit; msg = "Item Requirement with Sales order id : " + this.parmSalesid() + " Posted "; } else

Seeking help to get Miscellaneous charges for Purchase order in Ax 2012

If you are Seeking help to get Miscellaneous charges for the Purchase order in Ax 2012 then this code can help you. Sometimes we need to display Miscellaneous charges total in the report then you can get help as per below code. while select sum(Value),MarkupCode from markuptrans_txt group by MarkupCode join purchline where purchline.RecId ==markuptrans_txt.TransRecId && markuptrans_txt.TransTableId == purchline.tableid && purchline.PurchId == vendPurchOrderJour.PurchId && markuptrans_txt.Value != 0.00 { purchPurchaseOrderHeader.MiscChargeDesc = purchPurchaseOrderHeader.MiscChargeDesc+strFmt("Add %1 : \n",MarkupTable::find(MarkupModuleType::Vend,markuptrans_txt.MarkupCode).Txt ) ;

Get particular Financial dimension value from default dimension in Axapta

To get particular dimension value from default dimension you can try below code as per your requirement. DimensionAttributeValueSetItem dimvalue; DimensionAttributeValue dimAttValue; DimensionAttribute dimAtt; int length; //DimAttributeOMCostCenter viewCostCenter; DimensionFinancialTag viewCostCenter; DimAttributeOMDepartment viewDepartment; DimensionFinancialTag locations; str name; ; length = 0; Select dimvalue join dimAttValue join dimAtt Where dimvalue.DimensionAttributeValueSet == _DimensionDefault && dimvalue.DimensionAttributeValue == dimAttValue.RecId && dimAttValue.DimensionAttribute == dimAtt.RecId && dimAtt.Name == 'ProductCategory'; select viewCostCenter where viewCostCenter.Value == dimValue.DisplayValue; return viewCostCenter.Description;

Import Budget Register line In Ax 2012

To Import Budget Register line In Ax 2012, you get Idea from below code. You need to create budget register header then you can your CSV file and apply the code to import. you also need to declare variables as used in below code. budgetTransactionLine = new AxBudgetTransactionLine(); budgetTransactionLine.parmBudgetTransactionHeader(BudgetTransactionHeader::findByTransactionNumber(c1,Ledger::current()).RecId); budgetTransactionLine.parmDate(str2Date(c2,123)); budgetTransactionLine.parmTransactionCurrency(c10); budgetTransactionLine.parmBudgetType(str2enum(budgetType,c11)); budgetTransactionLine.parmTransactionCurrencyAmount(str2num(c9)); budgetTransactionLine.parmAccountingCurrencyAmount(str2num(c9)); accEntryPattern = [strFmt("%1-%2-%3-%4-%5-%6-%7",c3,c4,c5,c6,c7,c8),c3]; if(c4) { accEntryPattern += "LegalEntity";

Class and method to post packing slip for all load form in ax 2012

In warehouse management In Ax 2012, All loads form exists and load can be created from purchase orders and you can post packing slip from load form. If you have any customization during packing slip posting then you can refer below class method to put your code. \Classes\WHSPostPackingSlip\runPackingSlip If you want to update anything in vendPackingSlipJour and vendPackingSlipTrans table during packing slip posting. Then you can refer below class. \Classes\PurchPackingSlipJournalCreate Happy daxing.

Microsoft Windows : Understanding Control panel features and system settings

I want to share one interesting clip from Youtube which will show you Control panel features and settings for  Windows operating system. If you like this clip then waiting for your subscription to get daily updates on new topics.

Important thing to learn in Project Management Module in Axapta

I am sharing here one Important thing to learn in Project Management Module in Axapta. Please watch this clip to learn free and subscribe to learn more. AX 2012 Project types and Time & Material cycle. We are discussing here all the  Project types available AX 2012. This is  Microsoft Dynamics AX 2012 Demo for Project Management and Accounting concepts for Project types.

Ax 2012 Item master fields and Item Model Group understanding

Sharing Information for Ax 2012 Item master fields and Item Model Group understanding  I am sharing information of  clip which will show you Ax 2012 Item Master product Product Master, CW Catch weight Business Examples.Difference between item type service and Item, Product and product master, Element of items like name, search name etc ar properties of product in Axapta. Item master fields Item Model Group understanding  I want to share clip which will show you Ax 2012 Item Model Group properties and its  fields detail Path of Model group  in Ax 2012 is  as below Inventory management  Setup -Inventory - Item model groups. Other Important Inventory model things are as follows: FIFO LIFO LIFO date Weighted avg. Weighted avg. date Standard cost Moving average And other field related to Item Model Group. InclPhysicalValueInCost InventModel InventModelSecCur_RU MandatoryDeduct MandatoryPick MandatoryReceive

Sharing Tips quickly for Performance Improvement for Axapta

Top Tips for Ax 2012 Performance improvement. I am sharing This clip will show you Top 10 tips for SQL performances on Ax Quickly. 1. How to Check Client and Server configuration of ax 2012. 2. Check memory setting options for SQL server databases. 3. Regular checking of Disk size is required. 4. Regular Cleanup of log data from ERP. 5. Client Usage data cleanup at ax side. 6. Index optimization(use include column option in index) and new index creation at Ax. 7. Reindexing and Rebuilding Indexes. 8. Use set based operations is required to improve the performance of execution of logic. insert_recordset , update_recordset and delete_from 9. Check batch jobs running sequences on Ax side. 10.Don’t create indexes directly on SQL for Axapta. Visit below clip to get practical knowledge for the above points. If you like this video do not forget to subscribe that channel. 

View creation from other database from SQL for Ax database

To create view  from other database from SQL for Ax database you can get hint by below  script. SET QUOTED_IDENTIFIER ON GO Create VIEW [dbo].[TestCustomer] AS SELECT [CUSTGROUP] ,[ACCOUNTNUM] FROM MicrosoftDynamicsAX.dbo.CUSTTABLE group by [CUSTGROUP] ,[ACCOUNTNUM] ; GO Source database is MicrosoftDynamicsAX and destination is testDb in this clip. Just see clip to create view from custtable to other database new view .. Just need to execute script in query editor of SQL. Same way you can include more columns by alter alter THANKS FOR YOUR PATIENT ON WATCHING CLIP.YOU CAN SUBSCRIBE ON MY YOUTUBE CHANNEL TO GET FUTURE UPDATE TO IMPROVE YOUR KNOWLEDGE. GROUP BY IS REQUIRED TO MAKE VIEW  READ ONLY. SO ITS IMPORTANT.

Calculate Time Consumption in hours in Ax 2012

Code to get total time consumed between two times means if time one is 14:10 and time two is 15:40 then you want to get difference time in hours only like in this example it will be 1.5 hours. Getting time in hours in very difficult but you can get it easily by writing one simple method. # int seconds, minutes, hours, totalTime; # str timeStr = "",minstr=""; # # if (_startTime > _endTime) # { # totalTime = _endTime + (str2time('23:59:59') - _startTime); # } # else # { # totalTime = _endTime - _startTime; # } # # seconds = totalTime mod 60; # minutes = totalTime mod 3600 div 60; # hours = totalTime div 3600; # # if (hours > 0) # if (hours == 1) # timestr = timeStr + strFmt("%1", hours); # else # timestr = timeStr + strFmt("%1", hours); # #

Display time difference in hours in axapta

To Display time difference in hours in Axapta  you can use below code where timeConsumed is a method to get difference between from time and to time. You need to convert string to time first to get the right value. TimeofDay fromTime,toTime; // Time variables ; fromTime = str2time("8:50 am"); toTime = str2time("10:50 am"); info(strFmt("%1",timeConsumed(fromTime,toTime)));

Ax 2009 GST Installation hints

Prerequisites for GST Hotfix installation at Ax 2009 1.GST patch can only be installed for AX2009SP1 plus Consolidated GLS Layer for India (KB960013).  The detail information can be found at Microsoft Partner source link. Or Its  recommendation  you upgrade to RU8 for future better AX2009 hotfix supporting. However, RU8 is not a prerequisition to install GST patch but If its upgraded to RU 8 then no need to apply  (KB960013) otherwise it will show message KB already installed like that. 2.Before you install India GST hotfix, please make sure you have installed AX2009 hotfix KB971935, KB2028696, and KB971154. You can download hotfix from Microsoft partner source link for application and kernel both version.   Restart AOS and full compile after each KB gets installed.   You must Restart AOS and full compile after install the GST patch before open AX client.  3.Install both the kernel fix and the application fix  for India GST.  First you need to install kernel hotfix th

Classes to print,post sales order in ax 2012

1/To interacting with SalesEditLines form during sales invoicing the class is SalesFormLetter_Invoice . \Classes\SalesFormLetter_Invoice 2.For Creating journal data for sales order during invoice is SalesInvoiceJournalCreate \Classes\SalesInvoiceJournalCreate 3.For Posting a journal for sales order you can using below class for any code debugging and issue or customization. \Classes\SalesInvoiceJournalPost 4. If you want print customize sales order invoice report in Ax for sales order invoice then you can make changes in below class. \Classes\SalesInvoiceJournalPrint   Method to call report is printJournal. Path of method is as below.   \Classes\SalesInvoiceJournalPrint\printJournal 5.For Creating parm data during sales order  invoice below class you can check . \Classes\SalesFormletterParmDataInvoice

Hotfix for Accounting framework issue in Ax 2012 R3 CU11

KB number 3134000 is for the issue if Transfer to GL should not run taxlink queries for documents with no tax in Accounting Framework KB number  3100992  is for the issue if Introduction of Accounting Source Explorer and Source Document Reference Identities in Accounting Framework KB number  3134000  is for the issue if Final Relieving of a vendor invoice is incorrect when the product receipt is matched to a partial invoice before and after being corrected in  Accounting Framework KB number  3147787  is for the issue if SDRI mappings are not being honored for vendor invoice in  Accounting Framework

Advance query filter in Ax 2012

As you know like wildcard operator to filter bunch of record in Axapta grid. In Ax 2012 you can use like wild card operator with query build range object also. QueryBuildRange QBR; QBR =SysQuery::findOrCreateRange(DS.dataSourceTable(tablenum(custtable)),fieldNum(Custtable,AccountNum)); QBR.value(SysQuery::valueLikeAfter(testTxt.text())); In above example we used value like after same way you can use valuelike also. Other you can use like SysQuery::valueUnlimited if there is no value for range purpose.

How to Filter Records in form from Combo box in Axapta

Lets you want to to Filter Records in form from Combo box in Axapta then this is sample example you need to create one method like this. WMSPickingRoute_ds.filter(fieldNum(WMSPickingRoute,ExpeditionStatus),queryValue(God_expeditionStatus.selection())); Then you can call that method in modified field method for that combo box. Like filter1 is method name then you can call it below way. public boolean modified() { boolean ret; ret = super(); this.filter1(); return ret; } I hope you get and Idea how to filter records for form in axapta.

Get record from table on the basis of field id in Microsoft dynamics axapta x++

How to Get record from table on the basis of field id in dynamics axapta x++. just try following code in job to understand better way. emplTable emplTable; FieldId fieldId; ; fieldId = fieldNum(emplTable, Emplid); select emplTable; info(emplTable.(fieldId)); select emplTable where emplTable.(fieldId) == '1101'; info(emplTable.Name);

Resolved: Dynamics AX 2012 R3 client crashes Issue

I was facing below issue  Dynamics AX 2012 R3 client crashes after opening suddenly AX client session get crashes. There is no event log to find out what exactly is the issue.  Solution: I applied below steps. 1. I Deleted AUC files in user profile. C:\Users\user1\AppData\Local 2. Reset the usage data from menu. Click File > Tools > Options. In the Options form, click Usage data then reset button press click yes.. 3. To delete all user usage data  Go to  AOT-->SystemDocumentation-->Tables-->SysLastValue. Delete all records. After then Ax client work fine.

How to separate Fraction and Digit from Number in axapta

To separate Fraction and Digit from Number in axapta like number is 878778.3000 and you want to get 878778 and .300 then below code can help you to get the same. qty t=878778.3000; str _amount = strFmt("%1",num2str(t,0,1,0,0)); boolean decimals; TextBuffer txtAmount = new TextBuffer(); txtAmount.setText(_amount); if (txtAmount.find("^[0-9]+$")) // Regular expression inside the find method { decimals = true; } info(strFmt("%1 -- %2",trunc(t),frac(t)));

How to modify funding Source for particular Project contract In Ax 2012

How to modify funding Source for particular Project contract in Project Module. Below is the code sample to get Idea for the same. ProjFundingSource projFundingSource; ProjInvoiceTable projInvoiceTable; LogisticsLocation logisticsLocation,logisticsLocationNew; ; ttsBegin; while select projInvoiceTable where (projInvoiceTable.ProjInvoiceProjId != "PROJ_002834") { while select forUpdate projFundingSource where projFundingSource.ContractId == projInvoiceTable.ProjInvoiceProjId { projFundingSource.FundingSourceId = projInvoiceTable.fundingSourceName(); projFundingSource.InvoiceLocation = 0; projFundingSource.update(); } } ttsCommit;

What are the Reserved words in Axapta

Following are the Reserved words list in Ax 2012 1 abstract 54 implements 2 anytype 55 index 3 as 56 insert_recordset 4 asc 57 int 5 at 58 int64 6 avg 59 interface 7 break 60 is 8 breakpoint 61 join 9 by 62 like 10 byRef 63 maxOf 11 case 64 minOf 12 catch 65 mod 13 changeCompany 66 new 14 class 67 next 15 client 68 noFetch 16 container 69 notExists 17 continue 70 null 18 count 71 optimisticLock 19 crossCompany 72 order 20 date 73 outer 21 default 74 pause 22 delegate 75 pessimisticLock