Different view for required field validation?

There are different ways to define mandatory fields in Salesforce:

  1. On “database level”: When you create a new custom field, you can define this field as “required”:


    This field has to be populated, regardles of the type of populating. Through the API or Dataloader, through Apex or Flow or through the user interface. If you want to create a record in the database, you have to populate the field.
  2. On layout/ dynamic forms leve: When you add a field to a layout or a lightning page, you can define this as requried:

    If you use dynamic forms:

    In both cases the field is only required, if you create a record throug the user interface. If you use the API, Dataloader or Apex the field is NOT mandatory.

On the user interface, the behaviour of the mandatory field validation is identical, regardless of whether the mandatory field was defined at database level or layout level. However, the presentation of the objects differs slightly. The account object looks like this:


Every mandatory field is marked and at the bottom you have a pop-up which lists all missing mandatory fields. The field-name is a hyperlink. If you click on the field-name your screen will scroll to this field.

But on campaign it looks like this:


All the fields are marked the same way. But you do not have a pop-up at the bottom. Instead you have at the top the information. The field-names are no hyperlinks.

I did not find any official article/ information about this behaviour. Did you noticed this diffrence already? What do you think about it?

More Information in Lookup-Search

If you have a lookup or a master-detail field, Salesforce will show you results based on the characters you type. In my example I use the standard object “Opportunity” which has a lookup field to “Account”:

If you search for “Meyer” in the “Account Name”-Field you can see some accounts with this name:

The field which you can see in this view, you can define through the Account-Search Layout:

You can add more fields like “Phone”, “Account Number” and “Annual Revenue”:

In the lookup field you do not see all the 4 fields. You only see the first and the second field:

For standard objects (as fas as I know) the first field has to be the “Name” field of the object. For custom objects you can select another field as the first field.

When you click on “Show All Results…” you will see the other columns you defined in the search layout:

How to get more information in the lookup field?

If you want to add more then 2 fields into this screen, you can follow this approach.

As you can only show 1 additional field, you have to put the information you want to show in one field. For this we can use a formular field. For example create a formular field “Phone + Account Number + Annual Revenue” which will concat the information like this:

You do not have to add the new field to the page layouts. Add the new field into the search layout.

You see now all 3 information in the lookup field:

The currency field “Annual Amount” is not in the correct format. You can customize this also via the formula:

I hope you like my solution to solve this problem. I had this request multiple times by customers. Happy to get some feedback in the comments.