Tuesday, November 1, 2011

Table override methods in AX

In this post, I will add the Override methods available to the table Airline.  Tables in AX have 29 methods that can be overridden. Open the shared project Flight_Stats and expands the nodes Data Dictionary / Tables / Airline / Methods. Right-click on the node Methods and select Override Method. Then click on the first override method aosValidateDelete.
20110808_P01_01_Table_Override_Method
Inside the method aosValidateDelete, I added the line info(‘aosValidateDelete’); in order to study when this particular method is triggered.
20110808_P01_02_Method_aosValidateDelete
Similarly, I added the below mentioned 29 override methods to the table Airline. These override methods are available on any given AX table:
  1. aosValidateDelete
  2. aosValidateInsert
  3. aosValidateRead
  4. aosValidateUpdate
  5. caption
  6. clear
  7. delete
  8. equal
  9. getPresenceFieldData
  10. helpField
  11. initValue
  12. initValue
  13. isFormDataSource
  14. merge
  15. modifiedField
  16. new
  17. postLoad
  18. renamePrimaryKey
  19. reread
  20. toolTipField
  21. toolTipRecord
  22. toString
  23. update
  24. validateDelete
  25. validateField
  26. validateWrite
  27. wait
  28. write
  29. xml
    I added the info statement to all the above methods similar to how I added it to the method aosValidateDelete. Except the following methods required some additional changes:
new method required the lone semicolon to avoid the Syntax error.
20110808_P01_04_Airline_new
20110808_P01_05_Airline_new_Error
toString method was throwing the error Super() not allowed here. Hence, that line had to be commented out. Also, added the lone semi colon to avoid the Syntax error.
20110808_P01_06_Airline_toString
20110808_P01_07_Airline_toString_Error
wait method was throwing the error Super() not allowed here. Hence, that line had to be commented out. Also, added the lone semi colon to avoid the Syntax error.
20110808_P01_08_Airline_wait
20110808_P01_09_Airline_wait_Error
Now that I have added these info statements, I am planning to study how these methods work using Table browser.

No comments:

Post a Comment