|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
try { // Create an Axapta record for the StateAddress table. DynRec = DynAx.CreateAxaptaRecord("APMObjectTable"); // Execute a query to retrieve an editable record where the name is MyState. DynRec.ExecuteStmt("select forupdate * from %1 where %1.APMObjectId == 'HLH000001'"); // If the record is found then update the name. if (DynRec.Found) { // Start a transaction that can be committed. DynAx.TTSBegin(); string _text = @""; _text += "Line One\n"; _text += "Line Two\n"; _text += "Line Three\n"; _text += "Line Four\n"; DynRec.set_Field("APMObjectDescription", _text); DynRec.Update(); // Commit the transaction. DynAx.TTSCommit(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Don't Panic!"); } |
AX BC- Update a Record
This entry was posted in C# Development. Bookmark the permalink.