Skip to main content

Posts

Ax2012 Table Keys.

We are going to see the concept of keys on Tables in Ax2012. These all following keys that we are going though appears in the AOT Table properties window. Primary Key The primary key is usually the type of key that other tables, called child tables, refer to when a foreign key field in those other tables need a relational identifier. When we create a new table in AX2012 the Primary key was enforced by an index that has one field, this field should be unique, by default the primary key is based on  Recid  field. This is represented as surrogateKey in the table properties primary index. By default the  CreateRecIdIndex  property was true and ClusterIndex as surrogateKey. The  ClusterIndex  value is given to the underlying Microsoft SQL Server database system as a performance tuning choice. This choice generally controls the physical sequence in which the records are stored in the underlying database. ReplacementKey This key is used to define the repl...

AX2012 Actiavte/Deactivate Ports using X++

create enum 1. AIFPortActivorDeactive  with Acivate,Decativate as enumvalues.                     2. AIF portType with inbound and Outbound as enumvalues. class krishhAIFPortsUtil extends RunBaseBatch {     Map serviceStatusMap;     Map portWsdlUrlMap;     AIFPortActivorDeactive portActiveorDeactive;     AIFPortType aifPortType;     DialogField     dlgActiveorDeactive;     DialogField     dlgaifPortType;     #define.CurrentVersion(1)     #define.Version1(1)     #localmacro.CurrentList         portActiveorDeactive,         aifPortType     #endmacro } private void deployInboundPort(AifInboundPort port) {         startLengthyOperation();         AifPortManager::deployPort(port.Name);         this.updateServiceH...

Read xml file with namespace

static void krishh_samplexmlread(Args _args) {      XmlNode root;      XmlNode book;      XmlNodeList books;      XmlNamespaceManager nsmgr;      XmlDocument doc = new XmlDocument();       int i=1;       doc.Load(@"C:\Temp\book.xml");       //Create an XmlNamespaceManager for resolving namespaces.       nsmgr = new XmlNamespaceManager(doc.NameTable());       nsmgr.AddNamespace("bk", "urn:samples");       //Select the book node with the matching attribute value.       root = doc.DocumentElement();       books = root.selectNodes("descendant::book", nsmgr);       for (i = 0; i < books.length(); i++)       {            book = books.item(i);               info(book.selectSingleNode("bk:first-nam...