Wednesday, January 9, 2019

How to identify the user that was used to change an object from AOT in AX2012

  1. Get the object name for which we need to track these (user and date&time) information's.
  2. Login to SQL Server Management Studio and connect to corresponding AX Model database.
  3. Run below give query (replace element name with the object name).
  4. From the results, track the user and date&time of modifications.
SELECT ModelElement.ElementType, ModelElement.ElementHandle, ModelElement.Name, ModelElement.Origin,
 ModelElementData.CREATEDDATETIME, ModelElementData.CREATEDBY, ModelElementData.MODIFIEDDATETIME,
 ModelElementData.MODIFIEDBY, parent.ElementType AS [Parent type], Parent.Name AS [Parent name]
 FROM ModelElement
 INNER JOIN ModelElementData
 ON ModelElementData.ElementHandle = ModelElement.ElementHandle
 LEFT OUTER JOIN ModelElementData AS ParentData
 ON ParentData.ElementHandle = ModelElement.ParentHandle
 INNER JOIN ModelElement AS Parent
 ON Parent.ElementHandle = ParentData.ElementHandle
 WHERE --ModelElement.ElementType = 42 -- UtilElementType == Tables
  ModelElement.Name LIKE '%EcoResProductCategory%' --Replace object name
 AND ModelElementData.LayerId > 5 -- Customizations only. Values are in Layer table

Wednesday, January 2, 2019

Passing multiple parameter to store proc

strFmt('exec CNLAS_InventValueReportItemnew \'%1\',\'%2\',\'%3\',\'%4\'',curUserId(), curext(),ItemId,datestring) ;

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...