Customing Dialogue/Error for Testfield Function

HI Guys

Can anyone help please, trying to apply testfield function to the Buy-From Vendor No.field ‘on validate’ to ensure there is a Department Code (alternative name for Shortcutr Dimension Code 1’) but whenever it errors it comes up with :


Microsoft Dynamics NAV Classic

You must specify Shortcut Dimension 1 Code in Purchase Header Document Type=‘Order’,No.=‘IP04457’.


OK

The error coimes up which is fine but I want it to display the caption ‘Department Code;’ instead of the real field name ‘Shortcut Dimension 1 Code’. Is there a a quick way?

Thanks

Maybe instead of using testfield, you can just make a statement to call ERROR instead? Then you can pass FIELDCAPTION(“Shortcut Dimension 1 Code”) to the error function argument expression?