Blog

How to create only one invoice for several purchase orders in DAX012

How to create only one invoice for several purchase orders in DAX012. //Create Purchase Parameter Lines for one of the purchases: purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice); purchFormLetter.purchTable(purchTable); purchFormLetter.specQty(PurchUpdate::ALL); purchFormLetter.chooseLines(true); //Use the standard code that adds purchases to invoice purchFormLetterInvoiceContract  = purchFormLetter.getPurchFormLetterContract(); purchParmUpdate = purchFormLetterInvoiceContract.parmParmUpdate(); select firstOnly forUpdate vendInvoiceInfoTable where vendInvoiceInfoTable.ParmId == purchParmUpdate.ParmId; //delete all of the vendInvoiceInfoLine delete_from vendInvoiceInfoLine where vendInvoiceInfoLine.ParmId == _vendInvoiceInfoTable.ParmId; purchSelectLinesManager = PurchSelectLinesManager::newPurchSelectLinesManager(_vendInvoiceInfoTable.TableRefId); purchSelectLinesManager.parmPurchTableMark(parmPurchTableMark); purchSelectLinesManager.parmPurchLineMark(parmPurchLineMark); purchSelectLinesManager.parmParmId(_vendInvoiceInfoTable.ParmId); purchSelectLinesManager.lukParmBuildQuery(false);//additional parameter, it disables query creation purchSelectLinesManager.init(); while select purchLine ..where //your filters { purchSelectLinesManager.mark('', purchLine.RecId, purchLine, true, NoYes::No, true); } purchSelectLinesManager.passSets(_purchFormLetter); purchFormLetter.reArrangeNow(false);//it's very important to make this parameter false purchFormLetter.run();

Read more...

Can’t create a new employee in AX 2012 r3

Question: I did everything according to the instructions: typed employee names in the “Name” fields, chose company, after that tried to create an employee, but the “Hire new worker” button is always inactive in the “Create new worker” dialog. What do I do wrong? How to solve this problem? Answer: You have to setup the number sequence: Human resources – Setup – Parameters – Human resources shared parameters.

Read more...

How to copy roles from one user to another in Dynamics AX2012

Today we would like to share How to copy roles from one user to another in Dynamics AX2012. Code example: #static void assignRolesFromUserToUser(Args _args) #{ #    #define.fromUserId('Kudryavc') #    #define.toUserId('ax12test') # #    SecurityRole            securityRole; #    SecurityUserRole        securityUserRoleFrom,securityUserRoleTo; #    ; #    while select securityUserRoleFrom #        where   securityUserRoleFrom.User               == #fromUserId #            &&  securityUserRoleFrom.AssignmentStatus   == RoleAssignmentStatus::Enabled #        join securityRole #        where   [...]

Read more...

Selection of data using triggers OnFindRecord, OnNextRecord form in Navision

The purpose of this publication – to describe the ability to filter the data in a form on a “virtual” field using the methods and OnFindRecord OnNextRecord forms in the system Navision (Dynamics NAV). This question is partially lighted at many online resources, but complete decomposition “on the shelves” with concrete examples found in almost unreal. In preparation for publication were collected almost all the “bumps” of the filtration method. If attentive readers will find solutions in the analysis [...]

Read more...

Basics of creating SSRS reports in Axapta (AX 2012)

The current version of Axapta, namely Dynamics AX 2012 (the AX2012) all reporting is built on MS Sql Server Reporting Services (SSRS), the use of old technology reporting is possible, but not desirable, and create reports in AX2012-based SSRS not quite trivial . To help new developers, we decided to write a short article describing the minimum necessary steps to create a report based on the SSRS. In addition to creating report using Visual Studio, you need to create a set of [...]

Read more...