简体   繁体   中英

How to display a tooltip in Dynamics AX 4.0?

I'm looking to add hover text to a given column in a grid with row specific data. I'm planning on overriding the mouse-enter event, but I'm unsure how to populate a Tooltip and have it display next to the mouse.

Any direction would be appreciated, thanks!

**Edit: It looks like the method to override is actually called "Tooltip". I was able to override this and get a tooltip to display.

The question remains: How to access the current row's data for the column that the Tooltip is on?

To show a tooltip with the description of the foreign key field, the following must be met:

  1. Base your field on an extended data type
  2. Put a relation on the extended data type
  3. Have the relation point to a base table
  4. Set the TitleField1 and TitleField2 attributes on the base table
  5. Have a unique index on the key fields of your base table

You can put the relation on the (transaction) table instead of the extended data type. Do that in AX 2012 or if the relation has more than one field to join.

Here's the tooltip code that I ended up using:

public str toolTip()
{
    ;
    return tblYourTable::find(this.value()).Description;
}

**Edit per Jan's comment to greatly simplify code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM