Friday, April 1, 2011

AX 2009 Best Practice Violation: Display methods must be typed ('VarString, displayMethodName')

Hit a display method violation I recently hit in AX 2009: 'Display methods must be typed ('VarString displayMethodName').  There wasn't anything online about this issue outside of MSDN documentation about the BP so I thought I would put this out there for whoever wants to read it.

Display methods must be typed ('%1 %2') For more information, see Best Practices for Unique Labels. Table No Extended Return Type, @SYS60362

How to resolve the BP deviation: Check the display method in question (eg 'displayMethodName' from my example above).  Check the top line where you declare the method.  You cannot use a non-EDT string for a display method.  The line 'display str displayMethodName(CustTrans _custTrans)' would need to be (as an example) 'display CashDiscAccount displayMethodName(CustTrans _custTrans)'. Note that the 'str'was replaced with the EDT of the returned value of the display method.

Making this change to the display method will solve the issue.

No comments:

Post a Comment