Tuesday, August 16, 2016

Add SysOperation Batch Job through code

static void addSysOperationBatch(Args _args) 
 { 
   #define.recurrenceStartTime('11:00') 
   #define.recurrenceInterval(1) 
   #define.noOfRetriesOnFailure(2) 
   BatchHeader                                 batchHeader; 
   BatchInfo                                   batchInfo; 
   SysRecurrenceData                           sysRecurrenceData; 
   utcDateTime                                 batchStartTime; 
   Batch                                       batch; 
   PurchReqAuthorizationBatchService        PurchReqAuthorizationBatchService; 
   PurchReqAuthorizationTaskDataContract    PurchReqAuthorizationTaskDataContract; 
   SysOperationServiceController               PurchReqAuthorizationBatchServiceController;
   ; 
   select firstOnly RecId from batch 
     where batch.ClassNumber == classNum(PurchReqAuthorizationBatchService) && 
       batch.Company == curext() && 
       batch.DataPartition == getcurrentpartition(); 
   if (!batch.RecId) 
   { 
     PurchReqAuthorizationBatchServiceController = new SysOperationServiceController(classStr(PurchReqAuthorizationBatchService), methodStr(PurchReqAuthorizationBatchService, process), SysOperationExecutionMode::Synchronous); 
     PurchReqAuthorizationTaskDataContract = PurchReqAuthorizationBatchServiceController.getDataContractObject(classStr(PurchReqAuthorizationTaskDataContract)); 
     batchInfo = PurchReqAuthorizationBatchServiceController.batchInfo(); 
     batchInfo.parmRetriesOnFailure(#noOfRetriesOnFailure); 
     // Create the batch job 
     batchHeader = BatchHeader::construct(); 
     batchHeader.addTask(PurchReqAuthorizationBatchServiceController);  
     
     batchStartTime = DateTimeUtil::newDateTime(systemDateGet(), str2time(#recurrenceStartTime), DateTimeUtil::getUserPreferredTimeZone()); 
     // Set the recurrence data 
     sysRecurrenceData = SysRecurrence::defaultRecurrence(); 
     sysRecurrenceData = SysRecurrence::setRecurrenceStartDateTime(sysRecurrenceData, batchStartTime); 
     sysRecurrenceData = SysRecurrence::setRecurrenceNoEnd(sysRecurrenceData); 
     sysRecurrenceData = SysRecurrence::setRecurrenceUnit(sysRecurrenceData, SysRecurrenceUnit::Day, #recurrenceInterval); 
     batchHeader.parmRecurrenceData(sysRecurrenceData); 
     // Set the batch alert configurations 
     batchHeader.parmAlerts(NoYes::No, NoYes::Yes, NoYes::No, NoYes::Yes, NoYes::Yes); 
     batchHeader.parmStartDateTime(batchStartTime); 
     // Save the batch job 
     batchHeader.save(); 
   } 
 } 

Monday, February 29, 2016

New Dynamics AX (aka AX 7)

There are multiple changes in ‘New Dynamics AX’, Microsoft DynamicsTechnical conference 2016 recordings can be downloaded from below link –


Dynamics Learning Portal

New Dynamics AX (aka AX 7) VM (VHDs) can be downloaded from here -

Microsoft Connect

P.S – AIF is gone from new dynamics AX and answer to any questions related to AIF is DATA Entities (Like integrations, data migrations)

Good Luck!! Happy DAXing!!


Microsoft Dynamics AX Conference Presentations & Videos preview image