Friday, April 9, 2010

FormRef and Go to the main table form

It is known fact that "go to the main table form" functionality uses FormRef property on the table to determine which form should be opened (a menu item can be specified there pointing the required form). The interesting fact is that even if FormRef is not specified on the table AX will still try to open some form. Actually AX will look for display menu item which has the name equals to the table name.
Frustrating thing is that if such menu item does not exist the warning will be shown on clicking "go to the main table form":
No object specified on menu item %TableName%.

9 comments:

  1. Even more unuseful, if the FormRef is not set and a MenuItem with the same name exists, but it does not represent the main form to administrate the data ...

    ReplyDelete
  2. Did you know that this functionality can also be used to point to a display menu item which references a class instead of a form?

    This can be useful if, for example, you want to open different forms depending on some field value in the passed-in record. In the class main() you can retrieve the record, and then open the appropriate form from code. Therefore Go To Main Table can be made dynamic.

    ReplyDelete