{"id":522,"date":"2012-09-12T13:49:16","date_gmt":"2012-09-12T13:49:16","guid":{"rendered":"http:\/\/foxware.co.uk\/?p=522"},"modified":"2012-09-12T13:49:16","modified_gmt":"2012-09-12T13:49:16","slug":"ax-bc-insert-records","status":"publish","type":"post","link":"http:\/\/foxware.co.uk\/?p=522","title":{"rendered":"AX BC &#8211; Insert Records"},"content":{"rendered":"<pre class=\"lang:c# decode:true \"> Axapta ax;\r\n            AxaptaRecord record;\r\n            try\r\n            {\r\n                \/\/ Create AX object and logon to AX\r\n                ax = new Axapta();\r\n                ax.Logon(null, null, null, null);\r\n                \/\/ Create a new AxaptaRecord object with\r\n                \/\/ the name of the table as input parameter\r\n                using (record = ax.CreateAxaptaRecord(\"CarTable\"))\r\n                {\r\n                    \/\/ Remember to clear the tablebuffer if\r\n                    \/\/ you are inserting inside a loop\r\n                    record.Clear();\r\n                    record.InitValue();\r\n                    \/\/ Set the fields in the table\r\n                    record.set_Field(\"CARID\", \"XXX1\");\r\n                    record.set_Field(\"MODELYEAR\", 1998);\r\n                    record.set_Field(\"CARBRAND\", \"FORD\");\r\n                    record.set_Field(\"MODEL\", \"F1\");\r\n                    record.set_Field(\"MILEAGE\", 89378);\r\n                    \/\/ Insert the record\r\n                    record.Insert();\r\n                }\r\n                \/\/ End the AX session\r\n                ax.Logoff();\r\n            }\r\n            catch (Exception e)\r\n            {\r\n                Console.WriteLine(e.Message);\r\n            }<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Axapta ax; AxaptaRecord record; try { \/\/ Create AX object and logon to AX ax = new Axapta(); ax.Logon(null, null, null, null); \/\/ Create a new AxaptaRecord object with \/\/ the name of the table as input parameter using (record &hellip; <a href=\"http:\/\/foxware.co.uk\/?p=522\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/522"}],"collection":[{"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=522"}],"version-history":[{"count":1,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/522\/revisions"}],"predecessor-version":[{"id":523,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/522\/revisions\/523"}],"wp:attachment":[{"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}