Posts

AX 2012 Build process using AZURE DEVOPS

Image
Deployment pipeline in AX is always been a challenge. But this has improved a lot over the years with AZURE DEVOPS. This post details how to setup your deployment pipeline using Azure DevOps (Previously VSTS). Using below process, we can build a modelstore for AX 2012 without a local Team foundation server and license cost. Firstly we need a server with windows installed and a working AX environment. Go to  https://visualstudio.microsoft.com/ Click on Azure Devops, enter the required details, select Team foundation version control and create a project. Goto Repos and create a new folder to store the code belongs to your custom model To add code to azure repo, go to AX and enable the version control parameters and check in the model to move all the custom code to Azure. Now under version control tab select Add model to version control, select the correct model and repository folder and click Ok  to move all the custom model objects to Azure r

AX 2012 X++ Export cross company vendor emails

static void AllSupplierEmailExport(Args _args) {     Dialog          dialog                  = new Dialog();     DialogField     dialogField;     AsciiIo         exportFile;     str             filePath, fileNameOnly;     filetype        type;     str             delimiter = ";";     int             totalRecords;     VendTable       vendTableAll;     VendTable       vendTable;     container       line;     dialogField =   dialog.addField(extendedTypeStr(FilenameSave), "Select File", "Select file to export");     dialog.caption("Extracting Vendor Remit To details");     dialog.filenameLookupFilter(['csv','*.csv']);     setPrefix(dialog.caption());     if(!dialog.run())     {         warning("Dialog closed.");         return;     }     startLengthyOperation();     [filePath, fileNameOnly, type] = fileNameSplit(dialogField.value());     exportFile = new AsciiIo(dialo

X++ Job to delete or update contact information through csv upload

This summary is not available. Please click here to view the post.

When unable to open the settlement screen in AX 2012 or clicking the settlement button AX just hangs

Login to the Database and execute below query to Flush the procedure cache DECLARE @DBID INT = DB_ID('AX database name') DBCC flushprocindb(@DBID) Login to AX and the settlement screen will open now.

Unable to login to AX after DB sync

update the partition for admin user to be run when you get the below error after db sync Failed to create a session, confirm that the user has proper privileges to log on to Microsoft Dynamics DECLARE @NetworkDomain nvarchar(255); DECLARE @NetworkAlias nvarchar(80); DECLARE @SID nvarchar(124); DECLARE @InitialPartition BIGINT; SELECT @InitialPartition=Recid FROM PARTITIONS WHERE PARTITIONKEY=N'Initial' SELECT @NetworkAlias=NETWORKALIAS,@NetworkDomain=NETWORKDOMAIN,@SID=SID FROM USERINFO WHERE PARTITION=@InitialPartition AND ID = N'Admin' UPDATE USERINFO SET NETWORKDOMAIN=@NetworkDomain,NETWORKALIAS=@NetworkAlias,SID=@SID WHERE PARTITION != @InitialPartition AND ID = N'Admin' --check number of partitions SELECT * FROM dbo.PARTITIONS

SQL query for AX 2012 to find number sequence Id's which are near to run out

select top 10 (1.00 * HIGHEST - 1.00 * NEXTREC) / (1.00 * HIGHEST - 1.00 * LOWEST), * from numbersequencetable with (nolock) where (1.00 * HIGHEST - 1.00 * NEXTREC) / (1.00 * HIGHEST - 1.00 * LOWEST) < 0.2 SELECT TOP 10 * FROM dbo.LEDGERJOURNALTABLE WITH (NOLOCK) WHERE JOURNALNUM LIKE 'num seq' ORDER BY RECID DESC

X++ load operating units for financial dimensions CSV import

static void LoadDepartmentCost(Args _args) {     #File     OMOperatingUnit ou,ou2;     OMOperatingUnitType t;     RecId omOpRecId;     NumberSeq num;     IO  iO;     FilenameOpen        filename;// = "c:\\share\\test.csv";//To assign file name     Container           record;     str type;     int counter = 5, alreadyExists = 0;     Dialog          dialog;     DialogField     dialogfileName;     //dialog to load the excel file of contact information         dialog = new Dialog("Upload File");         dialogFilename = dialog.addField(extendedTypeStr(FilenameOpen));         dialog.filenameLookupFilter(["All files",#AllFiles]);         //dialog.filenameLookupTitle("Employee Data");         dialog.caption("Upload");     if(dialog.run())     {        filename = dialogFilename.value();     }     iO = new CommaTextIo(filename, #IO_Read);     if (! iO || iO.status() != IO_Status::Ok)     {         throw error(