function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vandana Johnvandana John 

INVALID_FIELD:Field name provided, CompanyName is not an External ID or indexed field for User

We are trying to use Bulk 2.0 to update Records. I get the above error while doing so. 
Is there a programatic way we can know wether the field is indexed or not. I didnt find anything in describe object call.
Arun Kumar 1141Arun Kumar 1141
Hi vandana John,

Try this below  query - 
SELECT EntityDefinition.QualifiedApiName, DeveloperName, IsIndexed 
FROM FieldDefinition 
WHERE EntityDefinition.QualifiedApiName = 'ObjectName__c'
AND QualifiedApiName = 'FieldName__c'
 If this helps you please mark it as a best answer
Thanks!