Blog

Access denied to method processReport in…

Sometimes you can face this error even if you set up security policy properly: The class that raised this error extends SRSReportDataProviderBase. public class AnkPriceListDP extends SRSReportDataProviderBase [SysEntryPointAttribute] public void processReport() The method is an entry point for the SysOperationProcess class. The access to run this method is also checked in the SysOperationProcess class. I couldn’t set up the access exactly for this method. So I fixed the problem by granting access to execute this method in the privilege’s Permission.ServerMethods node.

Read more...

Pivot table in Excel from AX 2012

Using ComExcelDocument_RU #define.xlDatabase(1) #define.xlPivotTableVersion15(5) #define.PivotTableName("Pivottable1") #define.PivotTable("PivotTable") void buildPivotTable(BookMark _sourceBookMark, container _columnFields, container _rowFields, container _dataFields, int _sourceWorkSheet = 1, BookMark _destBookMark = "", int _destWorkSheet = 1, str _destWorkSheetName = "", BookMark _destBookMarkCell = "") { COM comWorkBook, comWorkSheet; COM comPivotCaches, comPviotCache; COM comPivotTable, comPivotField; COM comCommandBars, comCommandBar; int iPivotField; BookMark destBookMark; ; comWorkBook = m_comApplication.activeWorkBook(); comWorkSheet = this.getWorkSheet(_sourceWorkSheet); comPivotCaches = comWorkBook.PivotCaches(); //xlDatabase means data is in the active workbook comPviotCache = comPivotCaches.Create(#xlDatabase, strFmt("%1!%2", comWorkSheet.name(), _sourceBookMark), #xlPivotTableVersion15); //Empty String as destination means a new WorkSheet will be created if (_destBookMark) { comWorkSheet = this.getWorkSheet(_destWorkSheet); destBookMark = strFmt("%1!%2", comWorkSheet.name(), _destBookMark); } comPivotTable = comPviotCache.CreatePivotTable(strFmt("%1!%2", _destWorkSheetName, _destBookMarkCell), #PivotTableName, #xlPivotTableVersion15); for (iPivotField = [...]

Read more...

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...