Standard fields are not appearing

46 views
Skip to first unread message

Raul Oliveira

unread,
Aug 22, 2024, 1:39:45 AM8/22/24
to Illuminated Cloud General Discussion
I was studying some modules in Trailhead and noticed a difference: standard fields like Owner, CreatedBy, and Id are not showing up in my local IC2 project. Is this behavior expected, or is something missing? I think I've checked all the checkboxes in my pro expecting all the metadata to be loaded, but my file structure is still not identical to the example in the VS Code mentioned in the Trailhead module. 

Here is a screenshot:
leftside is trailhead example of what my custom object files should look like image.png
Sorry for not being able to give more context to my question, I'm very new to Salesforce in general.

Raul Oliveira

unread,
Aug 22, 2024, 8:13:03 AM8/22/24
to Illuminated Cloud General Discussion, Raul Oliveira
hi, I forgot to open subfolders for the print in my local project, but there is only custom fields in fields folder, still no standard fields

Captura de tela 2024-08-22 091007.png

Scott Wells

unread,
Aug 22, 2024, 12:02:30 PM8/22/24
to Illuminated Cloud General Discussion, Raul Oliveira
Hi. What you're seeing in the Project view are the actual metadata files that you've retrieved into your local project. If you haven't retrieved the standard fields, you won't have corresponding files in the local project. Because of the way that the metadata API enumerates CustomField metadata to include only true custom fields, you must subscribe to/retrieve the parent CustomObject/SObject type to retrieve the standard fields for that type. Here's an example where I retrieved the full Account SObject type:

StandardFields.png

Note, however, that all fields should be properly reflected in the Offline Symbol Table (OST) even if you haven't retrieved those fields, making them available for code completion, reference validation, etc., e.g., the OST entry for Contact which I have not retrieved into the local project:

// Generated by Illuminated Cloud on Tue Aug 20 13:34:20 CDT 2024. Do not edit.

global class /*Schema.*/Contact extends SObject
{
    global List<AcceptedEventRelation> AcceptedEventRelations;
    global Account Account;
    global List<AccountContactRole> AccountContactRoles;
    global Id AccountId;
    global List<ActivityHistory> ActivityHistories;
    global List<AssetContactParticipant> AssetContactParticipantContact;
    global List<Asset> Assets;
    global String AssistantName;
    global String AssistantPhone;
    global List<AttachedContentDocument> AttachedContentDocuments;
    global List<Attachment> Attachments;
    global List<AuthorizationFormConsent> AuthorizationFormConsents;
    global Order BillToContact;
    global Date Birthdate;
    global EmailBounceEvent BouncedObject;
    global List<CampaignMember> CampaignMembers;
    global List<CaseContactRole> CaseContactRoles;
    global List<Case> Cases;
    global String CleanStatus;
    ...
}

Please let me know if that doesn't address your concerns.

Regards,
Scott Wells

Raul Oliveira

unread,
Aug 23, 2024, 12:21:26 AM8/23/24
to Illuminated Cloud General Discussion, sc...@illuminatedcloud.com, Raul Oliveira
  Scott, thanks for the thoughtful response.

I checked that inside OST my custom Object have all the standard fields/atributes like you said, but I still can't find how to subscribe for standard fields
They don't show up in my Retrieval Scope...

my steps:
I went to "Configure module" in order to subscribe to every metadata I could (select all)
Captura de tela 2024-08-23 011632.png

I hit Apply and then OK...

After that I try to retrieve:

Captura de tela 2024-08-23 011930.png

But even after trying to subscribe to everything in my org metadata, I cant find standard fields in my retrieval Scope 

Raul Oliveira

unread,
Aug 23, 2024, 12:27:38 AM8/23/24
to Illuminated Cloud General Discussion, Raul Oliveira, sc...@illuminatedcloud.com


// Generated by Illuminated Cloud on Thu Aug 22 23:50:26 BRT 2024. Do not edit.

global class /*Schema.*/House__c extends SObject
{
global List<ActivityHistory> ActivityHistories;
global String Address__c;
global List<AttachedContentDocument> AttachedContentDocuments;
global ProcessExceptionEvent AttachedTo;
global List<Attachment> Attachments;
global Decimal Bathrooms__c;
global Decimal Bedroom__c;
global String City__c;
global List<CombinedAttachment> CombinedAttachments;
global List<ContactRequest> ContactRequests;
global List<ContentDocumentLink> ContentDocumentLinks;
global FlowExecutionErrorEvent ContextRecord;
global User CreatedBy;
global Id CreatedById;
global Datetime CreatedDate;
global FinanceTransactionChangeEvent DestinationEntity;
global List<FinanceTransaction> DestinationFinanceTransactions;
global List<DuplicateRecordItem> DuplicateRecordItems;
global List<EmailMessage> Emails;
global List<Event> Events;
global List<House__Feed> Feeds;
global List<EntitySubscription> FeedSubscriptionsForEntity;
global static final SObjectTypeFields fields;
global List<FinanceBalanceSnapshot> FinanceBalanceSnapshots;
global List<FinanceTransaction> FinanceTransactions;
global ContentVersion FirstPublishLocation;
global List<FlowOrchestrationWorkItem> FlowOrchestrationWorkItems;
global Boolean IsDeleted;
global Date LastActivityDate;
global User LastModifiedBy;
global Id LastModifiedById;
global Datetime LastModifiedDate;
global Datetime LastReferencedDate;
global Datetime LastViewedDate;
global FinanceBalanceSnapshotChangeEvent LegalEntity;
global ContentDocumentLinkChangeEvent LinkedEntity;
global String Name;
global List<Note> Notes;
global List<NoteAndAttachment> NotesAndAttachments;
global List<OpenActivity> OpenActivities;
global SObject Owner;
global Id OwnerId;
global FeedComment Parent;
global List<FinanceTransaction> ParentFinanceTransactions;
global FinanceTransactionChangeEvent ParentReferenceEntity;
global String Picture__c;
global Decimal Price__c;
global List<ProcessException> ProcessExceptions;
global List<ProcessInstance> ProcessInstances;
global List<ProcessInstanceHistory> ProcessSteps;
global List<RecordActionHistory> RecordActionHistories;
global List<RecordAction> RecordActions;
global List<CollaborationGroupRecord> RecordAssociatedGroups;
global FinanceBalanceSnapshotChangeEvent ReferenceEntity;
global ContentDistribution RelatedRecord;
global EmailMessageChangeEvent RelatedTo;
global EventRelationChangeEvent Relation;
global List<House__Share> Shares;
global AIInsightValue SobjectLookupValue;
global static final SObjectType SObjectType;
global FinanceTransactionChangeEvent SourceEntity;
global List<FinanceTransaction> SourceFinanceTransactions;
global String State__c;
global Datetime SystemModstamp;
global AIRecordInsight Target;
global ProcessInstanceChangeEvent TargetObject;
global List<Task> Tasks;
global List<TopicAssignment> TopicAssignments;
global List<UserDefinedLabelAssignment> UserDefinedLabelAssignments;
global UserRecordAccess UserRecordAccess;
global EventChangeEvent What;
global String Zip__c;

global House__c()
{
}
}

Here is my OST/schema/house__c just to bring more info

Raul Oliveira

unread,
Aug 23, 2024, 12:29:17 AM8/23/24
to Illuminated Cloud General Discussion, Raul Oliveira, sc...@illuminatedcloud.com
Please let me know what you think of my steps, am I in the right trail or missing something?
Thanks

Scott Wells

unread,
Aug 23, 2024, 10:36:52 AM8/23/24
to Illuminated Cloud General Discussion, Raul Oliveira, Scott Wells

Hi. Apologies if I wasn’t clear, but because of limitations in the Salesforce APIs for enumerating SObject fields — specifically MetadataApi.listMetadata() — standard fields aren’t explicitly listed for subscription or retrieval. They’re available for enumeration through another API, PartnerApi.describeGlobal(), that IC2 uses to create the OST, but that’s not IC2 uses to enumerate metadata objects for subscription management and for the bulk metadata deployment/retrieval/removal dialog. I could investigate including the standard fields from the other API, but I’m honestly not sure what level of support would be offered for them.

Anyway, that’s why you see them in the OST but not in the retrieval dialog or subscription editor. Instead, you can subscribe to/retrieve standard fields by subscribing to/retrieving the containing SObject type. So if you want Account.LastModifiedDate, you can retrieve Account.

Please let me know if that doesn’t make sense.

Regards,
Scott Wells

Scott Wells

unread,
Aug 23, 2024, 11:09:55 AM8/23/24
to Illuminated Cloud General Discussion, Scott Wells, Raul Oliveira
As a quick follow-up, I just implemented a little test of adding standard fields to the list of enumerated org metadata based on a different source of information, and it does look like they retrieve, deploy, etc., just find (unsurprisingly). I'll polish this up and include it in the next build so that it's possible to work with individual standard fields distinctly.

Regards,
Scott Wells

Scott Wells

unread,
Aug 23, 2024, 1:34:14 PM8/23/24
to Illuminated Cloud General Discussion, Scott Wells, Raul Oliveira

After a bit more tinkering, I’ll back off somewhat on my previous statement about adding standard fields to the list of those available for explicit subscription/retrieval/etc. It turns out that most of them are not actually valid for retrieval. That includes the lifecycle fields such as the creation/modification dates/IDs, the Id field itself, the Name field (which is configured in the main object metadata), etc.

If you retrieve the entire standard Account object, only 43 of 192 standard fields are retrieved with it, and the other standard fields cannot be retrieved. For custom objects, none of the standard fields can be retrieved.

I’m going to try to figure how to filter standard fields on standard objects for those that can be retrieved explicitly and add those to the list of fields for selection, but otherwise the gap is much, much smaller than originally thought.

Out of curiosity, what is it that you’re trying to do exactly that motivated this question initially? Perhaps that will help to contextualize it for me.

Regards,
Scott Wells

Scott Wells

unread,
Aug 23, 2024, 1:40:28 PM8/23/24
to Illuminated Cloud General Discussion, Scott Wells, Raul Oliveira

And coming back full circle, it turns out that listMetadata() does actually already include all standard fields that are valid for explicit subscription, retrieval, etc., so as far as I can tell, no changes are needed for IC2. I’m pretty sure that if you try to retrieve fields like Id, Owner, etc., in the VS Code Extensions’ Org Browser, it will either fail or just not do anything. If you find that not to be the case, please let me know as I’ll need to discuss exactly what’s happening with Salesforce since my attempts to retrieve those via both the CLI and the API have been unsuccessful.

Regards,
Scott Wells

Reply all
Reply to author
Forward
0 new messages