ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Development questions16 of 102
DevelopmentHard 1 min read

Write a SOQL query to fetch all active ValidationRule or CustomField metadata records using the Tooling API query structure.

Asked atSalesforceDeloittePersistent

Answer

Metadata objects such as ValidationRule and CustomField are queried through the Tooling API (/services/data/vXX.0/tooling/query/?q=...), not the standard query endpoint.

soql
SELECT Id, ValidationName, Active, EntityDefinition.QualifiedApiName FROM ValidationRule WHERE Active = true
SELECT Id, DeveloperName, TableEnumOrId FROM CustomField

Only ValidationRule has an Active flag; CustomField records are queried by name or object (there is no 'active' state for fields).

soqlscenariotooling-apimetadata
Practice SOQL & Apex
PreviousWrite a SOQL query to fetch ProcessInstance and ProcessInstanceWorkitem records to find all pending Approval requests assigned to the current user (UserInfo.getUserId()).Next Write a SOSL query to search for the string 'Universal' across Account, Contact, and Lead returning specific fields from each object (FIND 'Universal*' IN ALL FIELDS RETURNING Account(Id, Name), Contact(Id, LastName, Email), Lead(Id, Company)).

More Development questions

  • What is reactivity in LWC and when does a field trigger a re-render?
  • What are the best practices to improve LWC performance?
  • How do you unit test an LWC with Jest?
  • How do you use a third-party JavaScript library or static resource in LWC?
  • Why can renderedCallback run multiple times and how do you prevent repeated execution?