Jul 31, 2026
2 min read

BC Friday Tips #77 TestField Show Record Action

TestField automatically adds a Show Record action when validation fails on blank or zero values.
Share:
BC Friday Tips #77 TestField Show Record Action

#BCFridayTips is here for #msdyn365bc developers!

πŸ’‘ Did you know TestField can automatically add a Show [Record] button to the error dialog?

When TestField fails, Business Central can give users a direct action to open the record and fix the problem.

You do not need to build this with ErrorInfo. It is already built into the platform.

Business Central resolves the target page from the Card page whose SourceTable matches the failing record’s table.

βœ… TestField(Field)
βœ… TestField(Field, Value)

Both show the action for tables with a single primary key, such as Customer.
But tables with compound primary keys, such as Sales Header, do not.

trigger OnAction()
var
    Customer: Record Customer;
begin
    Customer.FindFirst();
    Customer.TestField("Name 2");
end;

Customer TestField Without Value

Why this matters:

βœ… Users can jump straight to the record instead of searching for it manually.
βœ… You get a better error experience without writing extra code.

Reference: Microsoft Learn - TestField methods.

TestField Code Customer TestField With Value Sales Header TestField

Share to help others ♻️ and follow for more tips! πŸš€

Related Posts

Join the conversation

Using LinkedIn? Drop your comments, questions and reactions there.