{"id":439,"date":"2012-08-10T15:53:57","date_gmt":"2012-08-10T15:53:57","guid":{"rendered":""},"modified":"2012-08-10T15:53:57","modified_gmt":"2012-08-10T15:53:57","slug":"AX Update Example","status":"publish","type":"post","link":"http:\/\/foxware.co.uk\/?p=439","title":{"rendered":"AX Update Example"},"content":{"rendered":"<pre class=\\'lang:c# decode:true\\' >\/\/ Create an Axapta record for the StateAddress table.\r\naxRecord = ax.CreateAxaptaRecord(tableName);\r\n\r\n\/\/ Execute a query to retrieve an editable record where the name is MyState.\r\naxRecord.ExecuteStmt(\\\"select forupdate * from %1 where %1.Name == \r\n    \\'MyState\\'\\\");\r\n\r\n\/\/ If the record is found then update the name.\r\nif (axRecord.Found)\r\n{\r\n    \/\/ Start a transaction that can be committed.\r\n    ax.TTSBegin();\r\n    axRecord.set_Field(\\\"Name\\\", \\\"MyStateUpdated\\\");\r\n    axRecord.Update();\r\n\r\n    \/\/ Commit the transaction.\r\n    ax.TTSCommit();\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ Create an Axapta record for the StateAddress table. axRecord = ax.CreateAxaptaRecord(tableName); \/\/ Execute a query to retrieve an editable record where the name is MyState. axRecord.ExecuteStmt(\\&#8221;select forupdate * from %1 where %1.Name == \\&#8217;MyState\\&#8217;\\&#8221;); \/\/ If the record is &hellip; <a href=\"http:\/\/foxware.co.uk\/?p=439\">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\/439"}],"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=439"}],"version-history":[{"count":0,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions"}],"wp:attachment":[{"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/foxware.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}