Skip to main content

#Case Object4 personnes en discutent

I have two validation Rule on Case Object, for Account Name and Contact Name. These two are lookup fields on Case object following the standard relation. I have pointed the error on field and selected the appropriate field which shows Account Name and Contact Name. But the error on page shows like the attached snap, it shows Contact ID and Account ID instaed of Labels. 

I noticed the labels are displayed if the field is mandatory on page. But for validation it is showing API Name.  

Please suggest how to get Field Labels here 

I am getting field API Name and not Field Label for Validation Rule Error

 

 

image.png

 

 

 

#Salesforce Developer  #Salesforce Admin  #Validation Rules  #Case Object

3 réponses
  1. 9 oct., 06:05

     @Sanika Chaudhari - 

    Actually those are labels but not labels of the field as it appears on the user interface i.e. page layout. Unfortunately Salesforce does not document where those labels on the error message were taken from. What is known for sure though is that Salesforce stores a lot of metadata for each field. Here is what you can do to find out:

    1. Install the Salesforce Inspector .
    2. Navigate to any Case record and open the Salesforce Inspector.
    3. Click Show All Data
    4. Within the inspector, on one of those suspect fields (Account Name a.k.a. Account Id, Contact Name a.k.a. Contact Id etc or any other field) click the dropdown arrow on extreme right and select All field metadata.
    5. Use the filter on top to search for either the label on error message or label on layout or just the word label. 
    6. You should see seperate labels for the layout, part, description etc. I think the one that says part.Label is what is used in the error message.

    For example; 

    • Field label: Web Company
    • API name: SuppliedCompany
    • part.label: Company

    Can the default system generated error notification be customized? Unfortunately, No. However when you change the error location from field to top of your page, Salesforce simply uses the custom error message as configured in your validation rule.

0/9000