MetaData API
MetaData API
MetaData API
@salesforcedocs
Last updated: January 28, 2016
Copyright 20002016 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc.,
as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
GETTING STARTED
.................................................1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4
4
5
6
REFERENCE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Contents
checkRetrieveStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Contents
ApexTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
AppMenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
ApprovalProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
AssignmentRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
AuraDefinitionBundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
AuthProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
AutoResponseRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
CallCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Community (Zone) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
ConnectedApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
CorsWhitelistOrigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
CustomApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
CustomApplicationComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
CustomFeedFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
CustomLabels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Custom Metadata Types (CustomObject) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
CustomMetadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
CustomObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
ActionOverride . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
BusinessProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
CompactLayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
CustomField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
FieldSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
HistoryRetentionPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
ListView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
NamedFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Picklist (Including Dependent Picklist) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
RecordType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
SearchLayouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
SharingReason . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
SharingRecalculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
ValidationRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
WebLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Metadata Field Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
CustomObjectTranslation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
CustomPageWebLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
CustomPermission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
CustomSite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
CustomTab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
DataCategoryGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
DelegateGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Contents
EmailTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
EntitlementProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
EntitlementTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
EscalationRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ExternalDataSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
FlexiPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
FlowDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
FolderShare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
HomePageComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
HomePageLayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
InstalledPackage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
KeywordList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Letterhead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
LiveChatAgentConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
LiveChatButton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
LiveChatDeployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
LiveChatSensitiveDataRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
ManagedTopics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
MatchingRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
MetadataWithContent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
MilestoneType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
ModerationRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
NamedCredential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
PathAssistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
PermissionSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
PlatformCachePartition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
PostTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
QuickAction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
RemoteSiteSetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
ReportType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
RoleOrTerritory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
SamlSsoConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Contents
Scontrol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
AccountSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
ActivitiesSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
AddressSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
BusinessHoursSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
CaseSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
ChatterAnswersSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
CompanySettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
ContractSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
EntitlementSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
ForecastingSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
IdeasSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
KnowledgeSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
LiveAgentSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
MobileSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
NameSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
OpportunitySettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
OrderSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
PathAssistantSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
ProductSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
QuoteSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
SecuritySettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Territory2Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
SharedTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
SharingBaseRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
SharingRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
BaseSharingRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
CriteriaBasedSharingRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
OwnerSharingRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
SharingSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
SiteDotCom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Skill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
StaticResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
SynonymDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Territory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
Territory2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Territory2Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Territory2Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Territory2Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
TransactionSecurityPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
WaveApplication (Pilot) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
WaveDataset (Pilot) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Contents
WaveTemplateBundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
APPENDICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
GETTING STARTED
CHAPTER 1
Use Metadata API to retrieve, deploy, create, update or delete customization information, such as custom object definitions and page
layouts, for your organization. This API is intended for managing customizations and for building tools that can manage the metadata
model, not the data itself. To create, retrieve, update or delete records, such as accounts or leads, use data SOAP API or REST API.
The easiest way to access the functionality in Metadata API is to use the Force.com IDE or Force.com Migration Tool. Both tools are built
on top of Metadata API and use the standard Eclipse and Ant tools respectively to simplify working with Metadata API.
Force.com IDE is built on the Eclipse platform, for programmers familiar with integrated development environments. Code, compile,
test, and deploy from within the IDE.
The Force.com Migration Tool is ideal if you use a script or the command line for moving metadata between a local directory and a
Salesforce organization.
For more information about the Force.com IDE or Force.com Migration Tool, see developer.salesforce.com.
The underlying calls of Metadata API have been exposed for you to use directly, if you prefer to build your own client applications. This
guide gives you more information about working directly with Metadata API.
You can use the Metadata API to manage setup and customization information (metadata) for your organizations. For example:
Export the customizations in your organization as XML metadata files. See Working with the Zip File and retrieve().
Migrate configuration changes between organizations. See deploy() and retrieve().
Modify existing customizations in your organization using XML metadata files. See deploy() and retrieve().
Manage customizations in your organization programmatically. See CRUD-Based Metadata Development.
You can modify metadata in test organizations on Developer Edition or sandbox, and then deploy tested changes to production
organizations on Enterprise, Unlimited, or Performance Editions. You can also create scripts to populate a new organization with your
custom objects, custom fields, and other components.
SEE ALSO:
Deploying and Retrieving Metadata
CRUD-Based Metadata Development
Metadata Components and Types
Development Platforms
Alternatively, you can use a Developer Edition organization, which provides access to all of the features available with Enterprise Edition,
but is limited by the number of users and the amount of storage space. A Developer Edition organization is not a copy of your production
organization, but it provides an environment where you can build and test your solutions without affecting your organizations data.
Developer Edition accounts are available for free at http://developer.salesforce.com/signup.
Note: A metadata component must be visible in the organization for Metadata API to act on it. Also, a user must have the API
Enabled permission to have access to metadata components.
Development Platforms
Metadata API supports both file-based and CRUD-based development.
File-Based Development
The declarative or file-based asynchronous Metadata API deploy() and retrieve() operations deploy or retrieve a .zip file
that holds components in a set of folders, and a manifest file named package.xml. For more information, see Deploying and Retrieving
Metadata on page 14. The easiest way to access the file-based functionality is to use the Force.com IDE or Force.com Migration Tool.
CRUD-Based Development
The CRUD Metadata API calls act upon the metadata components in a manner similar to the way synchronous API calls in the enterprise
WSDL act upon objects. For more information about the enterprise WSDL, see the SOAP API Developer's Guide.
Standards Compliance
Metadata API is implemented to comply with the following specifications:
Standard Name
Website
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/
http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html
Backward Compatibility
Salesforce strives to make backward compatibility easy when using the Force.com platform.
Each new Salesforce release consists of two components:
A new release of platform software that resides on Salesforce systems
A new version of the API
For example, the Spring '07 release included API version 9.0 and the Summer '07 release included API version 10.0.
We maintain support for each API version across releases of the platform software. The API is backward compatible in that an application
created to work with a given API version will continue to work with that same API version in future platform software releases.
Salesforce does not guarantee that an application written against one API version will work with future API versions: Changes in method
signatures and data representations are often required as we continue to enhance the API. However, we strive to keep the API consistent
from version to version with minimal, if any, changes required to port applications to newer API versions.
For example, an application written using API version 9.0, which shipped with the Spring 07 release, will continue to work with API
version 9.0 on the Summer 07 release, and on future releases beyond that. However, that same application might not work with API
version 10.0 without modifications to the application.
API End-of-Life
Salesforce is committed to supporting each API version for a minimum of three years from the date of first release. In order to mature
and improve the quality and performance of the API, versions that are more than three years old might cease to be supported.
When an API version is to be deprecated, advance notice is given at least one year before support ends. Salesforce will directly notify
customers using API versions planned for deprecation.
Related Resources
The Salesforce developer website provides a full suite of developer toolkits, sample code, sample SOAP messages, community-based
support, and other resources to help you with your development projects. Be sure to visit
https://developer.salesforce.com/page/Getting_Started for more information, or visit
http://developer.salesforce.com/signup to sign up for a free Developer Edition account.
You can visit these websites to find out more about Salesforce applications:
Salesforce Developers provides a wealth of information for developers.
Salesforce for information about the Salesforce application.
Force.com AppExchange for access to apps created for Salesforce.
Salesforce.com Community for services to ensure Salesforce customer success.
CHAPTER 2
Quick Start
Use Metadata API to retrieve, deploy, create, update, or delete customizations for your organization. The most common use is to migrate
changes from a sandbox or testing organization to your production environment. Metadata API is intended for managing customizations
and for building tools that can manage the metadata model, not the data itself.
However, the underlying calls of Metadata API have been exposed for you to use directly, if you prefer to build your own client applications.
This quick start gives you all the information you need to start writing applications that directly use Metadata API to manage customizations
for your organization. It shows you how to get started with File-Based Development. For an example of CRUD-Based Development, see
Java Sample for CRUD-Based Development with Synchronous Calls.
Prerequisites
Make sure you complete these prerequisites before you start using Metadata API.
Create a development environment.
It is strongly recommended that you use a sandbox, which is an exact replica of your production organization. Enterprise, Unlimited,
and Performance Editions come with a free developer sandbox. For more information, see
http://www.salesforce.com/platform/cloud-infrastructure/sandbox.jsp.
Alternatively, you can use a Developer Edition organization, which provides access to all of the features available with Enterprise
Edition, but is limited by the number of users and the amount of storage space. A Developer Edition organization is not a copy of
your production organization, but it provides an environment where you can build and test your solutions without affecting your
organizations data. Developer Edition accounts are available for free at http://developer.salesforce.com/signup.
Identify a user that has the API Enabled and Modify All Data permissions. These permissions are required to access Metadata API
calls.
Install a SOAP client. Metadata API works with current SOAP development environments, including, but not limited to, Visual Studio
.NET and the Force.com Web Service Connector (WSC).
In this document, we provide Java examples based on WSC and JDK 6 (Java Platform Standard Edition Development Kit 6). To run
the samples, first download the latest force-wsc JAR file and its dependencies (dependencies are listed on the page when you select
a version) from mvnrepository.com/artifact/com.force.api/force-wsc/.
Note: Development platforms vary in their SOAP implementations. Implementation differences in certain development
platforms might prevent access to some or all of the features in Metadata API.
Quick Start
obtain the WSDL file from your organizations Salesforce administrator, or you can generate it yourself if you have access to the WSDL
download page in the Salesforce user interface. For more information about WSDL, see http://www.w3.org/TR/wsdl.
Before you can access Metadata API calls, you must authenticate to use the Web service using the login() call, which is defined in
the enterprise WSDL and the partner WSDL. Therefore, you must also obtain one of these WSDLs.
Any user with the Modify All Data permission can download the WSDL file to integrate and extend the Salesforce platform. (The System
Administrator profile has this permission.)
The sample code in Step 3: Walk Through the Java Sample Code on page 6 uses the enterprise WSDL, though the partner WSDL works
equally well.
To generate the metadata and enterprise WSDL files for your organization:
1. Log in to your Salesforce account. You must log in as an administrator or as a user who has the Modify All Data permission.
2. From Setup, enter API in the Quick Find box, then select API.
3. Click Generate Metadata WSDL and save the XML WSDL file to your file system.
4. Click Generate Enterprise WSDL and save the XML WSDL file to your file system.
On Mac OS X and Unix, use a colon instead of a semicolon in between items in the classpath:
java classpath force-wsc-30.0.0.jar:ST4-4.0.7.jar:antlr-runtime-3.5.jar
com.sforce.ws.tools.wsdlc metadata.wsdl metadata.jar
wsdlc generates a JAR file and Java source code and bytecode files for use in creating client applications. Repeat this process for the
Quick Start
Login Utility
Java users can use ConnectorConfig to connect to Enterprise, Partner, and Metadata SOAP API. MetadataLoginUtil creates
a ConnectorConfig object and logs in using the Enterprise WSDL login method. Then it retrieves sessionId and
metadataServerUrl to create a ConnectorConfig and connects to Metadata API endpoint. ConnectorConfig is
defined in WSC.
The MetadataLoginUtil class abstracts the login code from the other parts of the sample, allowing portions of this code to be
reused without change across different Salesforce APIs.
import
import
import
import
import
com.sforce.soap.enterprise.EnterpriseConnection;
com.sforce.soap.enterprise.LoginResult;
com.sforce.soap.metadata.MetadataConnection;
com.sforce.ws.ConnectionException;
com.sforce.ws.ConnectorConfig;
/**
* Login utility.
*/
public class MetadataLoginUtil {
public static MetadataConnection login() throws ConnectionException {
final String USERNAME = "[email protected]";
// This is only a sample. Hard coding passwords in source files is a bad practice.
final String PASSWORD = "password";
final String URL = "https://login.salesforce.com/services/Soap/c/36.0";
final LoginResult loginResult = loginToSalesforce(USERNAME, PASSWORD, URL);
return createMetadataConnection(loginResult);
}
private static MetadataConnection createMetadataConnection(
final LoginResult loginResult) throws ConnectionException {
final ConnectorConfig config = new ConnectorConfig();
config.setServiceEndpoint(loginResult.getMetadataServerUrl());
config.setSessionId(loginResult.getSessionId());
return new MetadataConnection(config);
}
Quick Start
Note the error handling code that follows each API call.
Note: This sample requires API version 34.0 or later.
import
import
import
import
import
java.io.*;
java.nio.channels.Channels;
java.nio.channels.FileChannel;
java.nio.channels.ReadableByteChannel;
java.rmi.RemoteException;
Quick Start
import java.util.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import com.sforce.soap.metadata.*;
/**
* Sample that logs in and shows a menu of retrieve and deploy metadata options.
*/
public class FileBasedDeployAndRetrieve {
private MetadataConnection metadataConnection;
private static final String ZIP_FILE = "components.zip";
// manifest file that controls which components get retrieved
private static final String MANIFEST_FILE = "package.xml";
private static final double API_VERSION = 29.0;
// one second in milliseconds
private static final long ONE_SECOND = 1000;
// maximum number of attempts to deploy the zip file
private static final int MAX_NUM_POLL_REQUESTS = 50;
private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Quick Start
choice = getUsersChoice();
}
}
/*
* Utility method to present options to retrieve or deploy.
*/
private String getUsersChoice() throws IOException {
System.out.println(" 1: Retrieve");
System.out.println(" 2: Deploy");
System.out.println("99: Exit");
System.out.println();
System.out.print("Enter 1 to retrieve, 2 to deploy, or 99 to exit: ");
// wait for the user input.
String choice = reader.readLine();
return choice != null ? choice.trim() : "";
}
private void deployZip() throws Exception {
byte zipBytes[] = readZipFile();
DeployOptions deployOptions = new DeployOptions();
deployOptions.setPerformRetrieve(false);
deployOptions.setRollbackOnError(true);
AsyncResult asyncResult = metadataConnection.deploy(zipBytes, deployOptions);
DeployResult result = waitForDeployCompletion(asyncResult.getId());
if (!result.isSuccess()) {
printErrors(result, "Final list of failures:\n");
throw new Exception("The files were not successfully deployed");
}
System.out.println("The file " + ZIP_FILE + " was successfully deployed\n");
}
/*
* Read the zip file contents into a byte array.
*/
private byte[] readZipFile() throws Exception {
byte[] result = null;
// We assume here that you have a deploy.zip file.
// See the retrieve sample for how to retrieve a zip file.
File zipFile = new File(ZIP_FILE);
if (!zipFile.exists() || !zipFile.isFile()) {
throw new Exception("Cannot find the zip file for deploy() on path:"
+ zipFile.getAbsolutePath());
}
FileInputStream fileInputStream = new FileInputStream(zipFile);
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int bytesRead = 0;
while (-1 != (bytesRead = fileInputStream.read(buffer))) {
bos.write(buffer, 0, bytesRead);
}
Quick Start
result = bos.toByteArray();
} finally {
fileInputStream.close();
}
return result;
}
/*
* Print out any errors, if any, related to the deploy.
* @param result - DeployResult
*/
private void printErrors(DeployResult result, String messageHeader) {
DeployDetails details = result.getDetails();
StringBuilder stringBuilder = new StringBuilder();
if (details != null) {
DeployMessage[] componentFailures = details.getComponentFailures();
for (DeployMessage failure : componentFailures) {
String loc = "(" + failure.getLineNumber() + ", " +
failure.getColumnNumber();
if (loc.length() == 0 &&
!failure.getFileName().equals(failure.getFullName()))
{
loc = "(" + failure.getFullName() + ")";
}
stringBuilder.append(failure.getFileName() + loc + ":"
+ failure.getProblem()).append('\n');
}
RunTestsResult rtr = details.getRunTestResult();
if (rtr.getFailures() != null) {
for (RunTestFailure failure : rtr.getFailures()) {
String n = (failure.getNamespace() == null ? "" :
(failure.getNamespace() + ".")) + failure.getName();
stringBuilder.append("Test failure, method: " + n + "." +
failure.getMethodName() + " -- " + failure.getMessage() +
" stack " + failure.getStackTrace() + "\n\n");
}
}
if (rtr.getCodeCoverageWarnings() != null) {
for (CodeCoverageWarning ccw : rtr.getCodeCoverageWarnings()) {
stringBuilder.append("Code coverage issue");
if (ccw.getName() != null) {
String n = (ccw.getNamespace() == null ? "" :
(ccw.getNamespace() + ".")) + ccw.getName();
stringBuilder.append(", class: " + n);
}
stringBuilder.append(" -- " + ccw.getMessage() + "\n");
}
}
}
if (stringBuilder.length() > 0) {
stringBuilder.insert(0, messageHeader);
System.out.println(stringBuilder.toString());
}
}
10
Quick Start
11
Quick Start
12
Quick Start
13
CHAPTER 3
Use the deploy() and retrieve() calls to move metadata (XML files) between a Salesforce organization and a local file system.
Once you retrieve your XML files into a file system, you can manage changes in a source-code control system, copy and paste code or
setup configurations, diff changes to components, and perform many other file-based development operations. At any time you can
deploy those changes to another Salesforce organization.
Note: The Force.com IDE and the Force.com Migration Tool use the deploy() and retrieve() calls to move metadata. If
you use these tools, interaction with Metadata API is seamless and invisible. Therefore, most developers will find it much easier to
use these tools than write code that calls deploy() and retrieve() directly.
Data in XML files is formatted using the English (United States) locale. This ensures that fields that depend on locale, such as date fields,
are interpreted consistently during data migrations between organizations using different languages. Organizations can support multiple
languages for presentation to their users.
The deploy() and retrieve() calls are used primarily for the following development scenarios:
Development of a custom application (or customization) in a sandbox organization. After development and testing is completed,
the application or customization is then deployed into a production organization using Metadata API.
Team development of an application in a Developer Edition organization. After development and testing is completed, you can then
distribute the application via Force.com AppExchange.
SEE ALSO:
Metadata Components and Types
Unsupported Metadata Types
14
The following is a sample package.xml file. Note that you can retrieve an individual component for a metadata type by specifying
its fullName field value in a members element, or you can also retrieve all components of a metadata type by using
<members>*</members>.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MyCustomObject__c</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>CustomTab</name>
</types>
<types>
<members>Standard</members>
<name>Profile</name>
</types>
<version>36.0</version>
</Package>
15
Standard Objects
This sample package.xml manifest file illustrates how to work with the standard Account object. Retrieving or deploying a standard
object includes all custom and standard fields except for standard fields that arent customizable. All custom fields are supported. Only
standard fields that you can customize are supported, that is, standard fields to which you can add help text or enable history tracking
or Chatter feed tracking. Other standard fields aren't supported, including system fields (such as CreatedById or
LastModifiedDate) and autonumber fields.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account</members>
<name>CustomObject</name>
</types>
<version>36.0</version>
</Package>
Note how you work with the standard Account object by specifying it as a member of a CustomObject type. However, you cannot use
an asterisk wildcard to work with all standard objects; each standard object must be specified by name.
16
<version>36.0</version>
</Package>
This manifest file can be used to retrieve or deploy all custom objects. This does not include all standard objects.
Note the objectName.picklistField syntax in the <members> field where objectName is the name of the object, such
as Account, and picklistField is the name of the standard picklist field, such as Industry.
This sample package.xml manifest file illustrates how to get the opportunity team roles (the same picklist values as the account
team roles) using the TeamMemberRole picklist field values on the OpportunityTeamMember object. You need to have team selling
enabled in your organization to retrieve these values.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>OpportunityTeamMember.TeamMemberRole</members>
<name>CustomField</name>
</types>
<version>36.0</version>
</Package>
17
Note the objectName.field syntax in the <members> field where objectName is the name of the object, such as Account,
and field is the name of the custom or standard field, such as an SLA picklist field representing a service-level agreement option.
The MyCustomField custom field in the MyCustomObject custom object is uniquely identified by its full name,
MyCustomObject__c.MyCustomField__c. Similarly, the Phone standard field in the Account standard object is uniquely
identified by its full name, Account.Phone.
All custom fields are supported. Only standard fields that you can customize are supported, that is, standard fields to which you can add
help text or enable history tracking or Chatter feed tracking. Other standard fields aren't supported, including system fields (such as
CreatedById or LastModifiedDate) and autonumber fields.
Note the objectName.listViewUniqueName syntax in the <members> field where objectName is the name of the
object, such as Account, and listViewUniqueName is the View Unique Name for the list view. If you retrieve this list view,
the component is stored in objects/Account.object.
Packages
To retrieve a package, set the name of the package in the packageNames field in RetrieveRequest when you call retrieve().
The package.xml manifest file is automatically populated in the retrieved .zip file. The <fullName> element in package.xml
contains the name of the retrieved package.
If you use an asterisk wildcard in a <members> element to retrieve all the components of a particular metadata type, the retrieved
contents do not include components in managed packages. For more information about managed packages, see the ISVforce Guide.
The easiest way to retrieve a component in a managed package is to retrieve the complete package by setting the name of the package
in the packageNames field in RetrieveRequest, as described above. The following sample package.xml manifest file illustrates
an alternative to retrieve an individual component in a package.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>myns__MyCustomObject__c</members>
<name>CustomObject</name>
</types>
<version>36.0</version>
</Package>
18
Note the namespacePrefix__objectName syntax in the <members> field where namespacePrefix is the namespace
prefix of the package and objectName is the name of the object. A namespace prefix is a 1 to 15-character alphanumeric identifier
that distinguishes your package and its contents from other publishers packages. For more information, see Register a Namespace
Prefix in the Salesforce Help.
Security Settings
This sample package.xml manifest file illustrates how to work with an organizations security settings. You specify Security in the
<members> element and Settings in the name element when retrieving the SecuritySettings component type.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Security</members>
<name>Settings</name>
</types>
<version>36.0</version>
</Package>
The following sample package.xml manifest file illustrates how to access just the samplerule Case assignment rule and the
newrule Lead assignment rule. Notice that the type name is AssignmentRule and not AssignmentRules.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Case.samplerule</members>
<members>Lead.newrule</members>
<name>AssignmentRule</name>
</types>
<version>36.0</version>
</Package>
Similarly, for accessing individual auto-response rules and escalation rules, use AutoResponseRule and EscalationRule
instead of AutoResponseRules and EscalationRules.
19
Sharing Rules
In API version 33.0 and later, you can retrieve and deploy sharing rules for all standard and custom objects. This sample package.xml
manifest file illustrates how to work with an organizations sharing rules, which includes retrieving a specific criteria-based sharing rule
for the lead object, retrieving all ownership-based sharing rules for all objects, and retrieving all territory-based sharing rules for the
account object.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Lead.testShareRule</members>
<name>SharingCriteriaRule</name>
</types>
<types>
<members>*</members>
<name>SharingOwnerRule</name>
</types>
<types>
<members>Account.*</members>
<name>SharingTerritoryRule</name>
</types>
<version>33.0</version>
</Package>
20
<viewAllRecords>false</viewAllRecords>
<modifyAllRecords>false</modifyAllRecords>
<object>MyNamespace__JobRequest__c</object>
</objectPermissions>
To retrieve:
<types>
<members>MyNamespace__JobRequest__c</members>
<name>CustomObject</name>
</types>
<types>
<members>MyProfile</members>
<name>Profile</name>
</types>
When retrieving permission sets and profiles, make sure that you also retrieve any components that are related to the permissions and
settings. For example, when retrieving app visibilities, you must also retrieve the associated app, and when retrieving object or field
permissions, you must also retrieve the associated object.
Default Test Execution in Production for API Version 33.0 and Earlier
For deployment to a production organization, all local tests in your organization are run by default. Tests that originate from installed
managed packages arent run by default. If any test fails, the entire deployment is rolled back.
If the deployment includes components for the following metadata types, all local tests are run. For change sets, this test execution
behavior applies to all API versions.
ApexClass
ApexComponent
21
ApexPage
ApexTrigger
ArticleType
BaseSharingRule
CriteriaBasedSharingRule
CustomDataType
CustomField
CustomObject
DataCategoryGroup
Flow
InstalledPackage
NamedFilter
OwnerSharingRule
PermissionSet
Profile
Queue
RecordType
RemoteSiteSetting
Role
SharingReason
Territory
Validation Rules
Workflow
For example, no tests are run for the following deployments:
1 CustomApplication component
100 Report components and 40 Dashboard components
All tests are run for the following deployments:
1 CustomField component
1 ApexComponent component and 1 ApexClass component
5 CustomField components and 1 ApexPage component
100 Report components, 40 Dashboard components, and 1 CustomField component
SEE ALSO:
deploy()
22
If the code coverage of an Apex component in the deployment is less than 75%, the deployment fails. If one of the specified tests fails,
the deployment also fails. We recommend that you test your deployment in sandbox first to ensure that the specified tests cover each
component sufficiently. Even if your organizations overall code coverage is 75% or more, the individual coverage of the Apex components
being deployed can be less. If the code coverage requirement isnt met, write more tests and include them in the deployment.
To run a subset of tests, set the RunSpecifiedTests test level on the DeployOptions object. Next, specify each test class to
run in DeployOptions. Finally, pass DeployOptions as an argument to the deploy() call. The following example performs
those steps to run only the specified test classes.
// Create the DeployOptions object.
DeployOptions deployOptions = new DeployOptions();
// Set the appropriate test level.
deployOptions.setTestLevel(TestLevel.RunSpecifiedTests);
// Specify the test classes to run.
// String array contains test class names.
String[] tests = {"TestClass1", "TestClass2", "TestClass3"};
// Add the test class names array to the deployment options.
deployOptions.setRunTests(tests);
// Call deploy() by passing the deployment options object as an argument.
AsyncResult asyncResult = metadatabinding.deploy(zipBytes,deployOptions);
23
Note: The RunLocalTests test level is enforced regardless of the contents of the deployment package. In contrast, tests are
executed by default in production only if your deployment package contains Apex classes or triggers. You can use
RunLocalTests for sandbox and production deployments.
24
CHAPTER 4
Use the CRUD-based metadata calls to create, update, or delete setup and configuration components for your organization or application.
These configuration components include custom objects, custom fields, and other configuration metadata. The metadata calls mimic
the behavior in the Salesforce user interface for creating, updating, or deleting components. Whatever rules apply there also apply to
these calls.
Metadata calls are different from the core, synchronous API calls in the following ways:
Metadata API calls are available in a separate WSDL. To download the WSDL, log into Salesforce, from Setup, enter API in the
Quick Find box, then select API and click the Download Metadata WSDL link.
After logging in, you must send Metadata API calls to the Metadata API endpoint, which has a different URL than the SOAP API.
Retrieve the metadataServerUrl from the LoginResult returned by your SOAP API login() call. For more information
about the SOAP API, see the SOAP API Developer's Guide.
Metadata calls are either synchronous or asynchronous. CRUD calls are synchronous in API version 30.0 and later, and similar to the
API core calls the results are returned in a single call. In earlier API versions, create, update, and delete are only asynchronous, which
means that the results are not immediately returned in one call.
There are synchronous metadata calls that map to the corresponding core SOAP API synchronous calls.
createMetadata() maps to the create() SOAP API call.
updateMetadata() maps to the update() SOAP API call.
deleteMetadata() maps to the delete() SOAP API call.
Note: Metadata API also supports retrieve() and deploy() calls for retrieving and deploying metadata components.
For more information, see Deploying and Retrieving Metadata.
25
26
}
}
private void runCreate() throws Exception {
metadataConnection = MetadataLoginUtil.login();
// Custom objects and fields must have __c suffix in the full name.
final String uniqueObjectName = "MyCustomObject__c";
createCustomObjectSync(uniqueObjectName);
}
}
27
*/
private void createCustomObject(final String uniqueName) throws Exception {
final String label = "My Custom Object";
CustomObject customObject = new CustomObject();
customObject.setFullName(uniqueName);
customObject.setDeploymentStatus(DeploymentStatus.Deployed);
customObject.setDescription("Created by the Metadata API Sample");
customObject.setLabel(label);
customObject.setPluralLabel(label + "s");
customObject.setSharingModel(SharingModel.ReadWrite);
// The name field appears in page layouts, related lists, and elsewhere.
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setDescription("The custom object identifier on page layouts, related lists
etc");
nf.setLabel(label);
nf.setFullName(uniqueName);
customObject.setNameField(nf);
AsyncResult[] asyncResults = metadataConnection.create(
new CustomObject[]{customObject});
if (asyncResults == null) {
System.out.println("The object was not created successfully");
return;
}
long waitTimeMilliSecs = ONE_SECOND;
// After the create() call completes, we must poll the results of the checkStatus()
// call until it indicates that the create operation has completed.
do {
printAsyncResultStatus(asyncResults);
waitTimeMilliSecs *= 2;
Thread.sleep(waitTimeMilliSecs);
asyncResults = metadataConnection.checkStatus(new
String[]{asyncResults[0].getId()});
} while (!asyncResults[0].isDone());
printAsyncResultStatus(asyncResults);
}
private void printAsyncResultStatus(AsyncResult[] asyncResults) throws Exception {
if (asyncResults == null || asyncResults.length == 0 || asyncResults[0] == null)
{
throw new Exception("The object status cannot be retrieved");
}
AsyncResult asyncResult = asyncResults[0]; //we are creating only 1 metadata object
if (asyncResult.getStatusCode() != null) {
System.out.println("Error status code: " +
28
asyncResult.getStatusCode());
System.out.println("Error message: " + asyncResult.getMessage());
}
System.out.println("Object with id:" + asyncResult.getId() + " is " +
asyncResult.getState());
}
private void runCreate() throws Exception {
metadataConnection = MetadataLoginUtil.login();
// Custom objects and fields must have __c suffix in the full name.
final String uniqueObjectName = "MyCustomObject__c";
createCustomObject(uniqueObjectName);
}
}
29
CHAPTER 5
Error Handling
Metadata API calls return error information that your client application can use to identify and resolve runtime errors. The Metadata API
provides the following types of error handling:
Since the Metadata API uses the enterprise or partner WSDLs to authenticate, it uses SOAP fault messages defined in those WSDLs
for errors resulting from badly formed messages, failed authentication, or similar problems. Each SOAP fault has an associated
ExceptionCode. For more details, see Error Handling in the SOAP API Developer's Guide.
For errors with the asynchronous create(), update(), and delete() calls, see the error status code in the statusCode
field in the AsyncResult object for the associated component.
For errors with the synchronous CRUD calls, see the error status code in the statusCode field of the Error object corresponding
to each error in the array returned by the errors field of the appropriate result object. For example, the result object of
createMetadata() is SaveResult.
For errors with deploy(), see the problem and success fields in the DeployMessage object for the associated component.
For errors with retrieve(), see the problem field in the RetrieveMessage object for the associated component.
For sample code, see Step 3: Walk Through the Java Sample Code on page 6.
30
REFERENCE
CHAPTER 6
File-Based Calls
deploy()
Uses file representations of components to create, update, or delete those components in an organization.
Syntax
AsyncResult = metadatabinding.deploy(base64 zipFile, DeployOptions deployOptions)
Usage
Use this call to take file representations of components and deploy them into an organization by creating, updating, or deleting the
components they represent.
Note: Metadata API can deploy and retrieve up to 10,000 files or 400 MB at one time. If either of these limits is exceeded, the
deployment or retrieval fails.
In API version 29.0, Salesforce improved the deployment status properties and removed the requirement to use checkStatus()
after a deploy() call to get information about deployments. Salesforce continues to support the use of checkStatus() when
using deploy() with API version 28.0 or earlier.
For API version 29.0 or later, deploy (create or update) packaged or unpackaged components using the following steps.
1. Issue a deploy() call to start the asynchronous deployment. An AsyncResult object is returned. Note the value in the id field
and use it for the next step.
2. Issue a checkDeployStatus() call in a loop until the done field of the returned DeployResult contains true, which means
that the call is completed. The DeployResult object contains information about an in-progress or completed deployment started
using the deploy() call. When calling checkDeployStatus(), pass in the id value from the AsyncResult object from the
first step.
For API version 28.0 or earlier, deploy (create or update) packaged or unpackaged components using the following steps.
1. Issue a deploy() call to start the asynchronous deployment. An AsyncResult object is returned. If the call is completed, the done
field contains true. Most often, the call is not completed quickly enough to be noted in the first result. If it is completed, note the
value in the id field returned and skip the next step.
31
File-Based Calls
deploy()
2. If the call is not complete, issue a checkStatus() call in a loop using the value in the id field of the AsyncResult object returned
by the deploy() call in the previous step. Check the AsyncResult object which is returned until the done field contains true.
The time taken to complete a deploy() call depends on the size of the zip file being deployed, so a longer wait time between
iterations should be used as the size of the zip file increases.
3. Issue a checkDeployStatus() call to obtain the results of the deploy() call, using the id value returned in the first step.
To track the status of deployments that are in progress or completed in the last 30 days, from Setup, enter Deployment Status
in the Quick Find box, then select Deployment Status.
You can cancel a deployment while its in progress or in the queue by clicking Cancel next to the deployment. The deployment then
has the status Cancel Requested until the deployment is completely canceled. A canceled deployment is listed in the Failed
section.
The package.xml file is a project manifest that lists all the components that you want to retrieve or deploy. You can use
package.xml to add components. To delete components, add another manifest file. See Deleting Components from an Organization.
Permissions
Your client application must be logged in with the Modify All Data permission.
Arguments
Name
Type
Description
zipFile
base64
Base 64-encoded binary data. Client applications must encode the binary data as base64.
deployOptions DeployOptions Encapsulates options for determining which packages or files are deployed.
DeployOptions
The following deployment options can be selected for this call:
Name
Type
Description
allowMissingFiles
boolean
autoUpdatePackage
boolean
32
File-Based Calls
deploy()
Name
Type
Description
checkOnly
boolean
ignoreWarnings
boolean
performRetrieve
boolean
purgeOnDelete
boolean
rollbackOnError
boolean
runAllTests
boolean
33
File-Based Calls
Name
deploy()
Type
Description
Note: Apex tests that run as part of a deployment
always run synchronously and serially.
runTests
string[]
singlePackage
boolean
testLevel
34
File-Based Calls
deploy()
Response
AsyncResult
Sample CodeJava
This sample shows how to deploy components in a zip file. See the retrieve() sample code for details on how to retrieve a zip file.
package com.doc.samples;
import java.io.*;
import java.rmi.RemoteException;
import
import
import
import
import
import
import
import
import
import
import
import
import
com.sforce.soap.metadata.AsyncResult;
com.sforce.soap.metadata.DeployDetails;
com.sforce.soap.metadata.MetadataConnection;
com.sforce.soap.metadata.DeployOptions;
com.sforce.soap.metadata.DeployResult;
com.sforce.soap.metadata.DeployMessage;
com.sforce.soap.metadata.RunTestsResult;
com.sforce.soap.metadata.RunTestFailure;
com.sforce.soap.metadata.CodeCoverageWarning;
com.sforce.soap.enterprise.LoginResult;
com.sforce.soap.enterprise.EnterpriseConnection;
com.sforce.ws.ConnectionException;
com.sforce.ws.ConnectorConfig;
/**
* Deploy a zip file of metadata components.
* Prerequisite: Have a deploy.zip file that includes a package.xml manifest file that
* details the contents of the zip file.
*/
public class DeploySample {
// binding for the metadata WSDL used for making metadata API calls
private MetadataConnection metadataConnection;
static BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
private static final String ZIP_FILE = "deploy.zip";
// one second in milliseconds
private static final long ONE_SECOND = 1000;
// maximum number of attempts to deploy the zip file
private static final int MAX_NUM_POLL_REQUESTS = 50;
public static void main(String[] args) throws Exception {
final String USERNAME = "[email protected]";
// This is only a sample. Hard coding passwords in source files is a bad practice.
final String PASSWORD = "password";
final String URL = "https://login.salesforce.com/services/Soap/c/29.0";
DeploySample sample = new DeploySample(USERNAME, PASSWORD, URL);
35
File-Based Calls
deploy()
sample.deployZip();
}
public DeploySample(String username, String password, String loginUrl)
throws ConnectionException {
createMetadataConnection(username, password, loginUrl);
}
public void deployZip()
throws RemoteException, Exception
{
byte zipBytes[] = readZipFile();
DeployOptions deployOptions = new DeployOptions();
deployOptions.setPerformRetrieve(false);
deployOptions.setRollbackOnError(true);
AsyncResult asyncResult = metadataConnection.deploy(zipBytes, deployOptions);
String asyncResultId = asyncResult.getId();
// Wait for the deploy to complete
int poll = 0;
long waitTimeMilliSecs = ONE_SECOND;
DeployResult deployResult = null;
boolean fetchDetails;
do {
Thread.sleep(waitTimeMilliSecs);
// double the wait time for the next iteration
waitTimeMilliSecs *= 2;
if (poll++ > MAX_NUM_POLL_REQUESTS) {
throw new Exception("Request timed out. If this is a large set " +
"of metadata components, check that the time allowed by " +
"MAX_NUM_POLL_REQUESTS is sufficient.");
}
// Fetch in-progress details once for every 3 polls
fetchDetails = (poll % 3 == 0);
deployResult = metadataConnection.checkDeployStatus(asyncResultId, fetchDetails);
System.out.println("Status is: " + deployResult.getStatus());
if (!deployResult.isDone() && fetchDetails) {
printErrors(deployResult, "Failures for deployment in progress:\n");
}
}
while (!deployResult.isDone());
if (!deployResult.isSuccess() && deployResult.getErrorStatusCode() != null) {
throw new Exception(deployResult.getErrorStatusCode() + " msg: " +
deployResult.getErrorMessage());
}
if (!fetchDetails) {
// Get the final result with details if we didn't do it in the last attempt.
deployResult = metadataConnection.checkDeployStatus(asyncResultId, true);
}
36
File-Based Calls
deploy()
if (!deployResult.isSuccess()) {
printErrors(deployResult, "Final list of failures:\n");
throw new Exception("The files were not successfully deployed");
}
System.out.println("The file " + ZIP_FILE + " was successfully deployed");
}
/**
* Read the zip file contents into a byte array.
* @return byte[]
* @throws Exception - if cannot find the zip file to deploy
*/
private byte[] readZipFile()
throws Exception
{
// We assume here that you have a deploy.zip file.
// See the retrieve sample for how to retrieve a zip file.
File deployZip = new File(ZIP_FILE);
if (!deployZip.exists() || !deployZip.isFile())
throw new Exception("Cannot find the zip file to deploy. Looking for " +
deployZip.getAbsolutePath());
FileInputStream fos = new FileInputStream(deployZip);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
int readbyte = -1;
while ((readbyte = fos.read()) != -1) {
bos.write(readbyte);
}
fos.close();
bos.close();
return bos.toByteArray();
}
/**
* Print out any errors, if any, related to the deploy.
* @param result - DeployResult
*/
private void printErrors(DeployResult result, String messageHeader)
{
DeployDetails deployDetails = result.getDetails();
StringBuilder errorMessageBuilder = new StringBuilder();
if (deployDetails != null) {
DeployMessage[] componentFailures = deployDetails.getComponentFailures();
for (DeployMessage message : componentFailures) {
String loc = (message.getLineNumber() == 0 ? "" :
("(" + message.getLineNumber() + "," +
message.getColumnNumber() + ")"));
if (loc.length() == 0
&& !message.getFileName().equals(message.getFullName())) {
loc = "(" + message.getFullName() + ")";
}
37
File-Based Calls
deploy()
38
File-Based Calls
IN THIS SECTION:
1. Deleting Components from an Organization
To delete components, perform a deployment with the deploy() call by using a destructive changes manifest file that lists the
components to remove from your organization. You can perform a deployment that only deletes components, or a deployment
that deletes and adds components. In API version 33.0 and later, you can specify components to delete before and after other
components are added or updated. In earlier API versions, if deletions and additions are specified for the same deployment, the
deploy() call performs the deletions first.
2. checkDeployStatus()
3. cancelDeploy()
SEE ALSO:
Running Tests in a Deployment
To deploy the destructive changes, you must also have a package.xml file that lists no components to deploy, includes the API
version, and is in the same directory as destructiveChanges.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>36.0</version>
</Package>
Note:
To bypass the Recycle Bin, set the purgeOnDelete option to true.
If you try to delete some components that dont exist in the organization, the rest of the deletions are still attempted.
39
File-Based Calls
checkDeployStatus()
Sample destructiveChangesPost.xml, which specifies the custom object to delete after the class update:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MyCustomObject__c</members>
<name>CustomObject</name>
</types>
</Package>
Note: The API version that the deployment uses is the API version thats specified in package.xml.
checkDeployStatus()
Checks the status of declarative metadata call deploy().
Syntax
DeployResult = metadatabinding.checkDeployStatus(ID id, includeDetails boolean);
40
File-Based Calls
cancelDeploy()
Usage
checkDeployStatus is used as part of the process for deploying packaged or unpackaged components to an organization:
1. Issue a deploy() call to start the asynchronous deployment. An AsyncResult object is returned. Note the value in the id field
and use it for the next step.
2. Issue a checkDeployStatus() call in a loop until the done field of the returned DeployResult contains true, which means
that the call is completed. The DeployResult object contains information about an in-progress or completed deployment started
using the deploy() call. When calling checkDeployStatus(), pass in the id value from the AsyncResult object from the
first step.
In API version 29.0, Salesforce improved the deployment status properties and removed the requirement to use checkStatus()
after a deploy() call to get information about deployments. Salesforce continues to support the use of checkStatus() when
using deploy() with API version 28.0 or earlier.
Sample CodeJava
See the deploy() sample code for sample usage of this call.
Arguments
Name
Type
Description
id
ID
includeDetails boolean
Sets the DeployResult object to include DeployDetails information ((true) or not (false).
The default is false. Available in API version 29.0 and later.
Response
DeployResult
cancelDeploy()
Cancels a deployment that hasnt completed yet.
Syntax
CancelDeployResult = metadatabinding.cancelDeploy(string id)
Usage
Use the cancelDeploy() operation to cancel a deployment in your organization started by the deploy() operation, which
includes deployments started by the Force.com Migration Tool and the Force.com IDE. The deployment can be in a queue waiting to
get started, or can be in progress. This operation takes the ID of the deployment you wish to cancel and returns a CancelDeployResult
object. When the deployment is in the queue and hasnt started yet, calling cancelDeploy() cancels the deployment immediately.
41
File-Based Calls
cancelDeploy()
When the deployment has started and is in progress, it might not get canceled immediately, so you should call
checkDeployStatus() to check the status of the cancellation.
Cancel a deployment using these steps.
1. Obtain the ID of the deployment you wish to cancel. For example, you can obtain the ID from the deploy() call in the
AsyncResult object id field. Alternatively, you can obtain the ID in the Salesforce user interface from Setup by entering
Deployment Status in the Quick Find box, selecting Deployment Status, and then noting the ID of a deployment
started by the API.
2. Issue a cancelDeploy() call to start the cancellation process. This call returns a CancelDeployResult object.
3. Check the value in the done field of the returned CancelDeployResult. If the done field value is true, the deployment
has been canceled and youre done. If the done field value is false, the cancellation is in progress, and follow these steps to
check the cancellation status.
a. Call checkDeployStatus() using the deployment ID you obtained earlier.
b. In the returned DeployResult object, check the status field. If the status is Canceling, this means the cancellation is still
in progress, and repeat steps a and b. Otherwise, if the status is Canceled, this means the deployment has been canceled
and youre done.
The deploy() operation throws these API faults.
INVALID_ID_FIELD with the message Invalid deploy ID
The specified ID argument doesnt correspond to a valid deployment.
INVALID_ID_FIELD with the message Deployment already completed
The specified deployment has already completed.
Version
Available in API version 30.0 and later.
Permissions
Your client application must be logged in with the Modify All Data permission.
Arguments
Name
Type
Description
id
string
Response
CancelDeployResult
42
File-Based Calls
deployRecentValidation()
Sample CodeJava
This sample shows how to cancel a deployment. The sample calls cancelDeploy() by passing it a given deployment ID. Next, it
checks whether the cancellation has completed, and if not, calls checkDeployStatus in a loop.
public void cancelDeploy(String asyncId) throws Exception {
// Issue the deployment cancellation request
CancelDeployResult result = metadataConnection.cancelDeploy(asyncId);
// If the deployment cancellation completed, write a message to the output.
if (result.isDone()) {
System.out.println("Your deployment was canceled successfully!");
}
else {
// The deployment cancellation is still in progress, so get a new status
DeployResult deployResult = metadataConnection.checkDeployStatus(asyncId, false);
deployRecentValidation()
Deploys a recently validated component set without running Apex tests.
Syntax
string = metadatabinding.deployRecentValidation(ID validationID)
Usage
Use deployRecentValidation() to deploy your components to production in less time by skipping the execution of Apex
tests. Ensure that the following requirements are met before deploying a recent validation.
43
File-Based Calls
deployRecentValidation()
The components have been validated successfully for the target environment within the last four days (96 hours).
As part of the validation, Apex tests in the target org have passed.
Code coverage requirements are met.
If all tests in the org or all local tests are run, overall code coverage is at least 75%, and Apex triggers have some coverage.
If specific tests are run with the RunSpecifiedTests test level, each class and trigger that was deployed is covered by at
least 75% individually.
This call is equivalent to performing a quick deployment of a recent validation on the Deployment Status page in the Salesforce user
interface.
Before you call deployRecentValidation(), your organization must have a validation that was recently run. You can run a
validation on a set of components by calling deploy() with the checkOnly property of the deployOptions parameter set to
true. Note the ID that you obtained from the deploy() call. Youll use this ID for the deployRecentValidation() call in
the next step.
After youve run a validation successfully, use these steps to quick-deploy the validation to the same target environment.
1. To start an asynchronous quick deployment, call deployRecentValidation() and pass it the ID of a recent validation. This
ID is obtained from the previous deploy() call. The deployRecentValidation() call returns the ID of the quick deployment.
Note this value. Youll use it in the next step.
2. Check for the completion of the call. This process is similar to that of deploy(). Issue a checkDeployStatus() call in a loop
until the done field of the returned DeployResult contains true, which means that the call is completed. The DeployResult object
contains information about an in-progress or completed deployment that was started by using the
deployRecentValidation() call. When calling checkDeployStatus(), pass in the ID value that you obtained in
the first step.
Version
Available in API version 33.0 and later.
Arguments
Name
Type
validationID string
Description
The ID of a recent validation.
Response
Type: string
The ID of the quick deployment.
Sample CodeJava
package com.salesforce.test.metadata;
import java.rmi.RemoteException;
import com.sforce.soap.metadata.CodeCoverageWarning;
44
File-Based Calls
import
import
import
import
import
import
import
import
import
deployRecentValidation()
com.sforce.soap.metadata.DeployDetails;
com.sforce.soap.metadata.DeployMessage;
com.sforce.soap.metadata.DeployResult;
com.sforce.soap.metadata.MetadataConnection;
com.sforce.soap.metadata.RunTestFailure;
com.sforce.soap.metadata.RunTestsResult;
com.sforce.soap.partner.Connector;
com.sforce.ws.ConnectionException;
com.sforce.ws.ConnectorConfig;
/**
* Quick-deploy a recent validation.
* Prerequisite: A successful validation (check-only deploy) has been done in the org
recently.
*/
public class DeployRecentValidationSample {
// binding for the metadata WSDL used for making metadata API calls
private MetadataConnection metadataConnection;
// one second in milliseconds
private static final long ONE_SECOND = 1000;
// maximum number of attempts to deploy the zip file
private static final int MAX_NUM_POLL_REQUESTS = 50;
public static void main(String[] args) throws Exception {
final String USERNAME = args[0];
final String PASSWORD = args[1];
final String URL = args[2];
final String recentValidationId = args[3];
DeployRecentValidationSample sample = new DeployRecentValidationSample(
USERNAME, PASSWORD, URL);
sample.deployRecentValidation(recentValidationId);
}
public DeployRecentValidationSample(String username, String password, String loginUrl)
throws ConnectionException {
createMetadataConnection(username, password, loginUrl);
}
public void deployRecentValidation(String recentValidationId)
throws RemoteException, Exception
{
String asyncResultId = metadataConnection.deployRecentValidation(recentValidationId);
45
File-Based Calls
deployRecentValidation()
Thread.sleep(waitTimeMilliSecs);
// double the wait time for the next iteration
waitTimeMilliSecs *= 2;
if (poll++ > MAX_NUM_POLL_REQUESTS) {
throw new Exception("Request timed out. If this is a large set " +
"of metadata components, check that the time allowed by " +
"MAX_NUM_POLL_REQUESTS is sufficient.");
}
// Fetch in-progress details once for every 3 polls
fetchDetails = (poll % 3 == 0);
deployResult = metadataConnection.checkDeployStatus(asyncResultId, fetchDetails);
System.out.println("Status is: " + deployResult.getStatus());
if (!deployResult.isDone() && fetchDetails) {
printErrors(deployResult, "Failures for deployment in progress:\n");
}
}
while (!deployResult.isDone());
if (!deployResult.isSuccess() && deployResult.getErrorStatusCode() != null) {
throw new Exception(deployResult.getErrorStatusCode() + " msg: " +
deployResult.getErrorMessage());
}
if (!fetchDetails) {
// Get the final result with details if we didn't do it in the last attempt.
deployResult = metadataConnection.checkDeployStatus(asyncResultId, true);
}
if (!deployResult.isSuccess()) {
printErrors(deployResult, "Final list of failures:\n");
throw new Exception("The files were not successfully deployed");
}
System.out.println("The recent validation " + recentValidationId +
" was successfully deployed");
}
/**
* Print out any errors, if any, related to the deploy.
* @param result - DeployResult
*/
private void printErrors(DeployResult result, String messageHeader)
{
DeployDetails deployDetails = result.getDetails();
StringBuilder errorMessageBuilder = new StringBuilder();
if (deployDetails != null) {
DeployMessage[] componentFailures = deployDetails.getComponentFailures();
for (DeployMessage message : componentFailures) {
String loc = (message.getLineNumber() == 0 ? "" :
("(" + message.getLineNumber() + "," +
message.getColumnNumber() + ")"));
46
File-Based Calls
deployRecentValidation()
if (loc.length() == 0
&& !message.getFileName().equals(message.getFullName())) {
loc = "(" + message.getFullName() + ")";
}
errorMessageBuilder.append(message.getFileName() + loc + ":" +
message.getProblem()).append('\n');
}
RunTestsResult rtr = deployDetails.getRunTestResult();
if (rtr.getFailures() != null) {
for (RunTestFailure failure : rtr.getFailures()) {
String n = (failure.getNamespace() == null ? "" :
(failure.getNamespace() + ".")) + failure.getName();
errorMessageBuilder.append("Test failure, method: " + n + "." +
failure.getMethodName() + " -- " +
failure.getMessage() + " stack " +
failure.getStackTrace() + "\n\n");
}
}
if (rtr.getCodeCoverageWarnings() != null) {
for (CodeCoverageWarning ccw : rtr.getCodeCoverageWarnings()) {
errorMessageBuilder.append("Code coverage issue");
if (ccw.getName() != null) {
String n = (ccw.getNamespace() == null ? "" :
(ccw.getNamespace() + ".")) + ccw.getName();
errorMessageBuilder.append(", class: " + n);
}
errorMessageBuilder.append(" -- " + ccw.getMessage() + "\n");
}
}
}
if (errorMessageBuilder.length() > 0) {
errorMessageBuilder.insert(0, messageHeader);
System.out.println(errorMessageBuilder.toString());
}
}
private void createMetadataConnection(
final String username,
final String password,
final String loginUrl) throws ConnectionException {
final ConnectorConfig loginConfig = new ConnectorConfig();
loginConfig.setUsername(username);
loginConfig.setPassword(password);
loginConfig.setAuthEndpoint(loginUrl);
Connector.newConnection(loginConfig);
47
File-Based Calls
retrieve()
this.metadataConnection = com.sforce.soap.metadata.Connector.
newConnection(metadataConfig);
}
}
retrieve()
This call retrieves XML file representations of components in an organization.
Syntax
AsyncResult = metadatabinding.retrieve(RetrieveRequest retrieveRequest)
Usage
Use this call to retrieve file representations of components in an organization.
Note: Metadata API can deploy and retrieve up to 10,000 files or 400 MB at one time. If either of these limits is exceeded, the
deployment or retrieval fails.
In API version 31.0 and later, the process of making a retrieve() call has been simplified. You no longer have to call
checkStatus() after a retrieve() call to obtain the status of the retrieve operation. Instead, make calls to
checkRetrieveStatus() only. If the retrieve operation is in progress, call checkRetrieveStatus() again until the
retrieve operation is completed. The checkStatus() call is still supported in versions API version 30.0 or earlier, but is not available
in API version 31.0 and later.
For API version 31.0 or later, retrieve packaged or unpackaged components by using the following steps.
1. Issue a retrieve() call to start the asynchronous retrieval. An AsyncResult object is returned. Note the value in the id field and
use it for the next step.
2. Issue a checkRetrieveStatus() call and pass in the id value from the AsyncResult object from the first step. Check the
value of the done field of the returned RetrieveResult. If it is true, this means that the call is completed and proceed to the next
step. Otherwise, repeat this step to call checkRetrieveStatus() again until the done field is true.
3. Retrieve the zip file (zipFile field) and other desired fields from RetrieveResult that was returned by the final call to
checkRetrieveStatus() in the previous step.
For API version 30.0 or earlier, retrieve packaged or unpackaged components by using the following steps.
1. Issue a retrieve() call to start the asynchronous retrieval. An AsyncResult object is returned. If the call is completed, the done
field contains true. Most often, the call is not completed quickly enough to be noted in the result. If it is completed, note the value
in the id field returned and skip the next step.
2. If the call is not complete, issue a checkStatus() call in a loop using the value in the id field of the AsyncResult object, returned
by the retrieve() call in the previous step. Check the AsyncResult object returned until the done field contains true. The
time taken to complete a retrieve() call depends on the size of the zip file being deployed, so use a longer wait time between
iterations as the size of the zip file increases.
3. Issue a checkRetrieveStatus() call to obtain the results of the retrieve() call, using the id value returned in the first
step.
For examples of manifest files, see Sample package.xml Manifest Files.
48
File-Based Calls
retrieve()
Permissions
Your client application must be logged in with the Modify All Data permission.
Arguments
Name
Type
Description
retrieveRequest RetrieveRequest Encapsulates options for determining which packages or files are retrieved.
Response
AsyncResult
Sample CodeJava
This sample shows how to retrieve components into a zip file. See the deploy() sample code for details on how to deploy a zip file.
Note: This sample requires API version 34.0 or later.
package com.doc.samples;
import
import
import
import
import
import
import
import
import
import
import
import
java.io.*;
java.util.*;
java.nio.ByteBuffer;
java.nio.channels.*;
java.rmi.RemoteException;
javax.xml.parsers.DocumentBuilder;
javax.xml.parsers.DocumentBuilderFactory;
javax.xml.parsers.ParserConfigurationException;
org.w3c.dom.Element;
org.w3c.dom.Node;
org.w3c.dom.NodeList;
org.xml.sax.SAXException;
import
import
import
import
import
import
import
import
import
import
import
com.sforce.soap.metadata.AsyncResult;
com.sforce.soap.metadata.MetadataConnection;
com.sforce.soap.enterprise.EnterpriseConnection;
com.sforce.soap.metadata.RetrieveMessage;
com.sforce.soap.metadata.RetrieveRequest;
com.sforce.soap.metadata.RetrieveResult;
com.sforce.soap.metadata.RetrieveStatus;
com.sforce.soap.enterprise.LoginResult;
com.sforce.ws.ConnectionException;
com.sforce.ws.ConnectorConfig;
com.sforce.soap.metadata.PackageTypeMembers;
49
File-Based Calls
retrieve()
50
File-Based Calls
retrieve()
result = metadataConnection.checkRetrieveStatus(
asyncResultId, true);
System.out.println("Retrieve Status: " + result.getStatus());
} while (!result.isDone());
if (result.getStatus() == RetrieveStatus.Failed) {
throw new Exception(result.getErrorStatusCode() + " msg: " +
result.getErrorMessage());
} else if (result.getStatus() == RetrieveStatus.Succeeded) {
// Print out any warning messages
StringBuilder buf = new StringBuilder();
if (result.getMessages() != null) {
for (RetrieveMessage rm : result.getMessages()) {
buf.append(rm.getFileName() + " - " + rm.getProblem());
}
}
if (buf.length() > 0) {
System.out.println("Retrieve warnings:\n" + buf);
}
// Write the zip to the file system
System.out.println("Writing results to zip file");
ByteArrayInputStream bais = new ByteArrayInputStream(result.getZipFile());
File resultsFile = new File("retrieveResults.zip");
FileOutputStream os = new FileOutputStream(resultsFile);
try {
ReadableByteChannel src = Channels.newChannel(bais);
FileChannel dest = os.getChannel();
copy(src, dest);
System.out.println("Results written to " + resultsFile.getAbsolutePath());
} finally {
os.close();
}
}
}
/**
* Helper method to copy from a readable channel to a writable channel,
* using an in-memory buffer.
*/
private void copy(ReadableByteChannel src, WritableByteChannel dest)
throws IOException
{
// Use an in-memory byte buffer
ByteBuffer buffer = ByteBuffer.allocate(8092);
while (src.read(buffer) != -1) {
buffer.flip();
while(buffer.hasRemaining()) {
dest.write(buffer);
}
buffer.clear();
}
51
File-Based Calls
retrieve()
}
private void setUnpackaged(RetrieveRequest request) throws Exception
{
// Edit the path, if necessary, if your package.xml file is located elsewhere
File unpackedManifest = new File(MANIFEST_FILE);
System.out.println("Manifest file: " + unpackedManifest.getAbsolutePath());
if (!unpackedManifest.exists() || !unpackedManifest.isFile())
throw new Exception("Should provide a valid retrieve manifest " +
"for unpackaged content. " +
"Looking for " + unpackedManifest.getAbsolutePath());
// Note that we populate the _package object by parsing a manifest file here.
// You could populate the _package based on any source for your
// particular application.
com.sforce.soap.metadata.Package p = parsePackage(unpackedManifest);
request.setUnpackaged(p);
}
private com.sforce.soap.metadata.Package parsePackage(File file) throws Exception {
try {
InputStream is = new FileInputStream(file);
List<PackageTypeMembers> pd = new ArrayList<PackageTypeMembers>();
DocumentBuilder db =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Element d = db.parse(is).getDocumentElement();
for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling()) {
if (c instanceof Element) {
Element ce = (Element)c;
//
NodeList namee = ce.getElementsByTagName("name");
if (namee.getLength() == 0) {
// not
continue;
}
String name = namee.item(0).getTextContent();
NodeList m = ce.getElementsByTagName("members");
List<String> members = new ArrayList<String>();
for (int i = 0; i < m.getLength(); i++) {
Node mm = m.item(i);
members.add(mm.getTextContent());
}
PackageTypeMembers pdi = new PackageTypeMembers();
pdi.setName(name);
pdi.setMembers(members.toArray(new String[members.size()]));
pd.add(pdi);
}
}
com.sforce.soap.metadata.Package r = new com.sforce.soap.metadata.Package();
r.setTypes(pd.toArray(new PackageTypeMembers[pd.size()]));
r.setVersion(API_VERSION + "");
return r;
} catch (ParserConfigurationException pce) {
52
File-Based Calls
RetrieveRequest
RetrieveRequest
The RetrieveRequest object specified in a retrieve() call consists of the following properties:
Name
Type
Description
apiVersion
double
Required. The API version for the retrieve request. The API
version determines the fields retrieved for each metadata type.
For example, an icon field was added to the CustomTab
for API version 14.0. If you retrieve components for version 13.0
or earlier, the components will not include the icon field.
53
File-Based Calls
Name
checkRetrieveStatus()
Type
Description
Note: In API version 31.0 and later, the API version
thats specified in package.xml is used for the
retrieve() call and overrides the version in the
apiVersion field. If the version is not specified in
package.xml, the version in this field is used.
packageNames
string[]
singlePackage
boolean
specificFiles
string[]
unpackaged
Package
checkRetrieveStatus()
Checks the status of the declarative metadata call retrieve() and returns the zip file contents.
Syntax
In API version 34.0 and later:
RetrieveResult = metadatabinding.checkRetrieveStatus(ID id, boolean includeZip);
Usage
Use checkRetrieveStatus() to check the progress of the metadata retrieve() operation. The RetrieveResult object that
this method returns indicates when the asynchronous retrieve() call is completed. If the retrieval is completed, RetrieveResult
contains the zip file contents by default. Use the following process to retrieve metadata components with the retrieve() call.
1. Issue a retrieve() call to start the asynchronous retrieval. An AsyncResult object is returned. Note the value in the id field and
use it for the next step.
2. Issue a checkRetrieveStatus() call and pass in the id value from the AsyncResult object from the first step. Check the
value of the done field of the returned RetrieveResult. If it is true, this means that the call is completed and proceed to the next
step. Otherwise, repeat this step to call checkRetrieveStatus() again until the done field is true.
3. Retrieve the zip file (zipFile field) and other desired fields from RetrieveResult that was returned by the final call to
checkRetrieveStatus() in the previous step.
54
File-Based Calls
checkRetrieveStatus()
In API version 31.0 and later, the process of making a retrieve() call has been simplified. You no longer have to call
checkStatus() after a retrieve() call to obtain the status of the retrieve operation. Instead, make calls to
checkRetrieveStatus() only. If the retrieve operation is in progress, call checkRetrieveStatus() again until the
retrieve operation is completed. The checkStatus() call is still supported in versions API version 30.0 or earlier, but is not available
in API version 31.0 and later.
Sample CodeJava
See the retrieve() sample code for sample usage of this call.
Arguments
Name
Type
Description
id
ID
55
File-Based Calls
checkRetrieveStatus()
Name
Type
Description
includeZip
boolean
Set to true to retrieve the zip file. You can retrieve the zip file only after the retrieval operation
is completed. After the zip file is retrieved, it is deleted from the server. Set to false to check
the status of the retrieval without attempting to retrieve the zip file. If set to null, this argument
defaults to true, which means that the zip file is retrieved on the last call to
checkRetrieveStatus() when the retrieval has finished.
This argument is available in API version 34.0 and later.
Response
RetrieveResult
56
CHAPTER 7
CRUD-Based Calls
Use the following CRUD-based calls to work with metadata components in a manner similar to how synchronous API calls in the enterprise
WSDL act upon objects.
IN THIS SECTION:
createMetadata()
Adds one or more new metadata components to your organization synchronously.
readMetadata()
Returns one or more metadata components from your organization synchronously.
updateMetadata()
Updates one or more metadata components in your organization synchronously.
upsertMetadata()
Creates or updates one or more metadata components in your organization synchronously.
deleteMetadata()
Deletes one or more metadata components from your organization synchronously.
renameMetadata()
Renames a metadata component in your organization synchronously.
create()
Deprecated. Adds one or more new metadata components to your organization asynchronously. This call is removed as of API version
31.0 and is available in earlier versions only. Use createMetadata() instead.
delete()
Deprecated. Deletes one or more components from your organization asynchronously. This call is removed as of API version 31.0
and is available in earlier versions only. Use deleteMetadata() instead.
update()
Deprecated. Updates one or more components in your organization asynchronously. This call is removed as of API version 31.0 and
is available in earlier versions only. Use updateMetadata() or renameMetadata() instead.
createMetadata()
Adds one or more new metadata components to your organization synchronously.
Syntax
SaveResult[] = metadatabinding.createMetadata(Metadata[] metadata);
57
CRUD-Based Calls
createMetadata()
Usage
Use the createMetadata() call to create any component that extends Metadata. All components must be of the same type in
the same call. For more details, see Metadata Components and Types.
This call executes synchronously, which means that the call returns only when the operation completes.
Starting in API version 34.0, this call supports the AllOrNoneHeader header. By default, if AllOrNoneHeader isnt used in API version
34.0 and later, this call can save a partial set of records for records with no errors (equivalent to AllOrNoneHeader=false). In API
version 33.0 and earlier, the default behavior is to only save all records when there are no failures in any record in the call (equivalent to
AllOrNoneHeader=true).
Version
Available in API version 30.0 and later.
Permissions
Your client application must be logged in with the Modify All Data permission.
Required Fields
Required fields are determined by the metadata components being created. For more information about specific component types, see
Metadata Components and Types.
String Values
When storing values in string fields, the API trims any leading and trailing whitespace. For example, if the value of a label field is
entered as "MyObject ", the value is stored in the database as "MyObject".
58
CRUD-Based Calls
createMetadata()
Sample CodeJava
public void createCustomObjectSync() {
try {
CustomObject co = new CustomObject();
String name = "MyCustomObject1";
co.setFullName(name + "__c");
co.setDeploymentStatus(DeploymentStatus.Deployed);
co.setDescription("Created by the Metadata API");
co.setEnableActivities(true);
co.setLabel(name + " Object");
co.setPluralLabel(co.getLabel() + "s");
co.setSharingModel(SharingModel.ReadWrite);
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setLabel(co.getFullName() + " Name");
co.setNameField(nf);
SaveResult[] results = metadataConnection
.createMetadata(new Metadata[] { co });
for (SaveResult r : results) {
if (r.isSuccess()) {
System.out.println("Created component: " + r.getFullName());
} else {
System.out
.println("Errors were encountered while creating "
+ r.getFullName());
for (Error e : r.getErrors()) {
System.out.println("Error message: " + e.getMessage());
System.out.println("Status code: " + e.getStatusCode());
}
}
}
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
Arguments
Name
Type
Description
metadata
Metadata[]
59
CRUD-Based Calls
readMetadata()
Response
SaveResult[]
readMetadata()
Returns one or more metadata components from your organization synchronously.
Syntax
ReadResult = metadataConnection.readMetadata(string metadataType, string[] fullNames);
Usage
Use the readMetadata() call to retrieve any component that extends Metadata. All components must be of the same type in the
same call. For more details, see Metadata Components and Types.
This call executes synchronously, which means that the call returns only when the operation completes.
Version
Available in API version 30.0 and later.
Permissions
Your client application must be logged in with the Modify All Data permission.
Sample CodeJava
public void readCustomObjectSync() {
try {
ReadResult readResult = metadataConnection
.readMetadata("CustomObject", new String[] {
"MyCustomObject1__c", "MyCustomObject2__c" });
60
CRUD-Based Calls
updateMetadata()
Arguments
Name
Type
metadataType string
fullNames
string[]
Description
The metadata type of the components to read.
Array of full names of the components to read.
Limit: 10. (For CustomMetadata only, the limit is 200.)
You must submit arrays of only one type of component. For example, you can submit an array
of 10 custom objects or 10 profiles, but not a mix of both types.
Response
ReadResult
updateMetadata()
Updates one or more metadata components in your organization synchronously.
Syntax
SaveResult[] = metadataConnection.updateMetadata(Metadata[] metadata);
61
CRUD-Based Calls
updateMetadata()
Usage
Use the updateMetadata() call to update any component that extends Metadata. All components must be of the same type in
the same call. For more details, see Metadata Components and Types.
This call executes synchronously, which means that the call returns only when the operation completes.
Starting in API version 34.0, this call supports the AllOrNoneHeader header. By default, if AllOrNoneHeader isnt used in API version
34.0 and later, this call can save a partial set of records for records with no errors (equivalent to AllOrNoneHeader=false). In API
version 33.0 and earlier, the default behavior is to only save all records when there are no failures in any record in the call (equivalent to
AllOrNoneHeader=true).
Version
Available in API version 30.0 and later.
Permissions
Your client application must be logged in with the Modify All Data permission.
Required Fields
You must supply values for all the required fields in the component.
String Values
When storing values in string fields, the API trims any leading and trailing white space. For example, if the value of a label field is
entered as "MyObject " the value is stored in the database as "MyObject".
Sample CodeJava
public void updateCustomObjectSync() {
try {
62
CRUD-Based Calls
updateMetadata()
Arguments
Name
Type
Description
metadata
Metadata[]
Response
SaveResult[]
63
CRUD-Based Calls
upsertMetadata()
upsertMetadata()
Creates or updates one or more metadata components in your organization synchronously.
Syntax
UpsertResult[] = metadataConnection.upsertMetadata(Metadata[] metadata);
Usage
Use the upsertMetadata() call to create or update any component that extends Metadata. All components must be of the same
type in the same call. For more details, see Metadata Components and Types.
If the specified components already exist in your organization, the upsertMetadata() call updates them. Otherwise,
upsertMetadata() creates these components. Components are matched by the fullname field. This call executes synchronously,
which means that the call returns only after the operation is completed.
Starting in API version 34.0, this call supports the AllOrNoneHeader header. By default, if AllOrNoneHeader isnt used in API version
34.0 and later, this call can save a partial set of records for records with no errors (equivalent to AllOrNoneHeader=false). In API
version 33.0 and earlier, the default behavior is to only save all records when there are no failures in any record in the call (equivalent to
AllOrNoneHeader=true).
Version
Available in API version 31.0 and later.
Permissions
Your client application must be logged in with the Modify All Data permission.
Required Fields
You must supply values for all the required fields in the component.
String Values
The API trims any leading and trailing white space when storing values in string fields. For example, if the value of a label field is
entered as " MyObject ", the value is stored in the database as "MyObject".
64
CRUD-Based Calls
upsertMetadata()
Sample CodeJava
public void upsertMetadataSample() {
try {
// Create custom object to upsert
CustomObject co = new CustomObject();
String name = "MyCustomObject";
co.setFullName(name + "__c");
co.setDeploymentStatus(DeploymentStatus.Deployed);
co.setDescription("Upserted by the Metadata API");
co.setEnableActivities(true);
co.setLabel(name + " Object");
co.setPluralLabel(co.getLabel() + "s");
co.setSharingModel(SharingModel.ReadWrite);
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setLabel("CustomField1");
co.setNameField(nf);
// Upsert the custom object
UpsertResult[] results = metadataConnection
.upsertMetadata(new Metadata[] { co });
for (UpsertResult r : results) {
if (r.isSuccess()) {
System.out.println("Success!");
if (r.isCreated()) {
System.out.println("Created component: "
+ r.getFullName());
} else {
System.out.println("Updated component: "
+ r.getFullName());
}
} else {
System.out
.println("Errors were encountered while upserting "
+ r.getFullName());
for (Error e : r.getErrors()) {
System.out.println("Error message: " + e.getMessage());
65
CRUD-Based Calls
deleteMetadata()
Arguments
Name
Type
Description
metadata
Metadata[]
Response
UpsertResult[]
deleteMetadata()
Deletes one or more metadata components from your organization synchronously.
Syntax
DeleteResult[] = metadataConnection.delete(string metadataType, string[] fullNames);
Usage
Use the deleteMetadata() call to delete any component that extends Metadata. All components must be of the same type in
the same call. For more details, see Metadata Components and Types.
This call executes synchronously, which means that the call returns only when the operation completes.
Starting in API version 34.0, this call supports the AllOrNoneHeader header. By default, if the AllOrNoneHeader isnt used in any
API version, this call can delete a partial set of records for records with no errors (equivalent to AllOrNoneHeader=false). If
AllOrNoneHeader is set to true, no records are deleted if one or more records cause a failure.
Version
Available in API version 30.0 and later.
66
CRUD-Based Calls
deleteMetadata()
Permissions
Your client application must be logged in with the Modify All Data permission.
Sample CodeJava
public void deleteCustomObjectSync() {
try {
DeleteResult[] results = metadataConnection.deleteMetadata(
"CustomObject", new String[] { "MyCustomObject1__c",
"MyCustomObject2__c" });
for (DeleteResult r : results) {
if (r.isSuccess()) {
System.out.println("Deleted component: " + r.getFullName());
} else {
System.out
.println("Errors were encountered while deleting "
+ r.getFullName());
for (Error e : r.getErrors()) {
System.out.println("Error message: " + e.getMessage());
System.out.println("Status code: " + e.getStatusCode());
}
}
}
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
67
CRUD-Based Calls
renameMetadata()
Arguments
Name
Type
metadataType string
fullNames
string[]
Description
The metadata type of the components to delete.
Array of full names of the components to delete.
Limit: 10. (For CustomMetadata only, the limit is 200.)
You must submit arrays of only one type of component. For example, you can submit an array
of 10 custom objects or 10 profiles, but not a mix of both types.
Response
DeleteResult[]
renameMetadata()
Renames a metadata component in your organization synchronously.
Syntax
SaveResult = metadataConnection.renameMetadata(string metadataType, String oldFullname,
String newFullname);
Usage
Use the renameMetadata() call to rename one metadata component in your organization. This call executes synchronously,
meaning the call returns only when the operation completes.
You can use this call to rename any of the objects that extend Metadata. For more details, see Metadata Components and Types.
Version
Available in API version 30.0 and later.
Permissions
Your client application must be logged in with the Modify All Data permission.
68
CRUD-Based Calls
create()
2. Invoke the renameMetadata() call. For the first argument, pass in the name of the metadata type. Pass in the old full name
as the second argument and the new full name as the last argument.
A SaveResult object is returned that contains information about whether the operation was successful, the name of the renamed
component (which is the new name if the renaming was successful), and any errors returned if the operation wasnt successful.
Sample CodeJava
public void renameCustomObjectSync() {
try {
SaveResult[] results = metadataConnection.renameMetadata(
"CustomObject", "MyCustomObject1__c","MyCustomObject1New__c");
for (SaveResult r : results) {
if (r.isSuccess()) {
System.out.println("Renamed component: " + r.getName());
}
else {
System.out.println("Errors were encountered while renaming " + r.getName());
for(Error e : r.getErrors()) {
System.out.println("Error message: " + e.getMessage());
System.out.println("Status code: " + e.getStatusCode());
}
}
}
} catch (ConnectionException ce) {
ce.printStackTrace();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
Arguments
Name
Type
metadataType string
Description
The metadata type of the components to rename.
oldFullName
string
newFullName
string
Response
SaveResult
create()
Deprecated. Adds one or more new metadata components to your organization asynchronously. This call is removed as of API version
31.0 and is available in earlier versions only. Use createMetadata() instead.
69
CRUD-Based Calls
create()
This call can be used to create any of the objects that extend Metadata. For more details, see Metadata Components and Types on page
112.
Syntax
AsyncResult[] = metadatabinding.create(Metadata[] metadata);
Usage
Use this call to add one or more metadata components to your organization.
Version
This call is available in API version 30.0 and earlier only. This call is not available in API version 31.0 and later. Use createMetadata()
instead.
Permissions
Your client application must be logged in with the Modify All Data permission.
Required Fields
Required fields are determined by the metadata components being created. For more information about specific component types, see
Metadata Components and Types on page 112.
String Values
When storing values in string fields, the API trims any leading and trailing whitespace. For example, if the value of a label field is
entered as "MyObject " the value is stored in the database as "MyObject".
70
CRUD-Based Calls
delete()
Sample CodeJava
See Step 3: Walk Through the Java Sample Code on page 6 for sample Java code using the create() call.
Arguments
Name
Type
Description
metadata
Metadata[]
Response
AsyncResult[]
SEE ALSO:
createMetadata()
update()
delete()
checkStatus()
delete()
Deprecated. Deletes one or more components from your organization asynchronously. This call is removed as of API version 31.0 and is
available in earlier versions only. Use deleteMetadata() instead.
You can use this call to delete any of the objects that extend Metadata. For more details, see Metadata Components and Types on page
112.
Syntax
AsyncResult[] = metadataConnection.delete(Metadata[] metadata);
Usage
Use this call to delete one or more components from your organization.
Version
This call is available in API version 30.0 and earlier only. This call is not available in API version 31.0 and later. Use deleteMetadata()
instead.
71
CRUD-Based Calls
delete()
Permissions
Your client application must be logged in with the Modify All Data permission.
Sample CodeJava
public void deleteCustomObject() {
try {
CustomObject co = new CustomObject();
co.setFullName("MyCustomObject__c");
AsyncResult[] ars = metadataConnection.create(new Metadata[]
{co});
AsyncResult asyncResult = ars[0];
long waitTimeMilliSecs = 1000;
while (!asyncResult.isDone()) {
Thread.sleep(waitTimeMilliSecs);
// double the wait time for the next iteration
waitTimeMilliSecs *= 2;
asyncResult = mdConnection.checkStatus(
new String[] {asyncResult.getId()})[0];
System.out.println("Status is: " + asyncResult.getState());
}
} catch (ConnectionException ce) {
ce.printStackTrace();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
72
CRUD-Based Calls
update()
Arguments
Name
Type
Description
metadata
Metadata[]
Array of one or more metadata components. You only need to set the fullName field in
the Metadata object.
Limit: 10.
You must submit arrays of only one type of component. For example, you could submit an
array of 10 custom objects or 10 profiles, but not a mix of both types.
Response
AsyncResult[]
SEE ALSO:
deleteMetadata()
create()
update()
checkStatus()
update()
Deprecated. Updates one or more components in your organization asynchronously. This call is removed as of API version 31.0 and is
available in earlier versions only. Use updateMetadata() or renameMetadata() instead.
This call can be used to update any of the objects that extend Metadata. For more details, see Metadata Components and Types on page
112.
Syntax
AsyncResult[] = metadataConnection.update(UpdateMetadata[] metadata);
Usage
Use this call to update one or more components. This call is analogous to the ALTER TABLE statement in SQL.
Version
This call is available in API version 30.0 and earlier only. This call is not available in API version 31.0 and later. Use updateMetadata()
instead to update metadata components or renameMetadata() to rename a metadata component.
73
CRUD-Based Calls
update()
Permissions
Your client application must be logged in with the Modify All Data permission.
Required Fields
You must supply values for all the required fields in the component.
String Values
When storing values in string fields, the API trims any leading and trailing white space. For example, if the value of a label field is
entered as "MyObject " the value is stored in the database as "MyObject".
Sample CodeJava
public void updateCustomObject() {
try {
CustomObject co = new CustomObject();
String name = "MyCustomObject";
co.setFullName(name + "__c");
co.setDeploymentStatus(DeploymentStatus.Deployed);
co.setDescription("Created by the Metadata API");
co.setEnableActivities(true);
co.setLabel(name + " Object");
co.setPluralLabel(co.getLabel() + "s");
co.setSharingModel(SharingModel.ReadWrite);
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setLabel(co.getFullName() + " Name");
74
CRUD-Based Calls
update()
co.setNameField(nf);
UpdateMetadata updateMetadata = new UpdateMetadata();
updateMetadata.setMetadata(co);
updateMetadata.setCurrentName("TheCurrentName");
AsyncResult[] ars = metadataConnection.update(new UpdateMetadata[]
{ updateMetadata });
AsyncResult asyncResult = ars[0];
// set initial wait time to one second in milliseconds
long waitTimeMilliSecs = 1000;
while (!asyncResult.isDone()) {
Thread.sleep(waitTimeMilliSecs);
// double the wait time for the next iteration
waitTimeMilliSecs *= 2;
asyncResult = metadataConnection.checkStatus(
new String[] {asyncResult.getId()})[0];
System.out.println("Status is: " + asyncResult.getState());
}
if (asyncResult.getState() != AsyncRequestState.Completed) {
System.out.println(asyncResult.getStatusCode() + " msg: " +
asyncResult.getMessage());
}
} catch (InterruptedException ie) {
ie.printStackTrace();
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
Arguments
Name
Type
Description
metadata
UpdateMetadata[]
UpdateMetadata
One or more UpdateMetadata objects are defined in the metadata argument. This object can be used to update any of the objects
that extend Metadata. For more details, see Metadata Components and Types on page 112. Each UpdateMetadata object has the following
fields:
75
CRUD-Based Calls
update()
Field
Field Type
Description
currentName
string
The API name of the component or field before the update. For example,
if you wanted to update a CustomObject named Foo, the value of this
field would be Foo__c. This value is supplied because this call may
change the name, and the value here provides mapping.
metadata
Metadata
Response
AsyncResult[]
SEE ALSO:
updateMetadata()
create()
delete()
checkStatus()
76
CHAPTER 8
Utility Calls
Use the following utility calls to gather information that is useful for working with the file-based or CRUD-based calls.
(Deprecated) checkStatus()
describeMetadata()
describeValueType()
listMetadata()
checkStatus()
Deprecated. Checks the status of asynchronous metadata calls create(), update(), or delete(), or the declarative metadata
call retrieve(). This call is removed as of API version 31.0 and is available only in earlier versions.
Note: Starting in API version 29.0, you no longer have to call checkStatus() after a deploy() call to get information
about deployments. Similarly, starting in API version 31.0, you no longer have to call checkStatus() after a retrieve()
call. The checkStatus() call has been replaced by checkDeployStatus() and checkRetrieveStatus() for deploy and retrieve
operations respectively.
Syntax
AsyncResult[] = metadatabinding.checkStatus(ID[] ids);
Usage
Use this call to check whether or not an asynchronous metadata call or declarative metadata call has completed.
Version
This call is available only in API version 30.0 and earlier. This call is not available in API version 31.0 and later.
Sample CodeJava
See Step 3: Walk Through the Java Sample Code on page 6 for sample Java code using this call.
77
Utility Calls
describeMetadata()
Arguments
Name
Type
Description
ids
ID[]
Array of one or more IDs. Each ID is returned in an AsyncResult and corresponds to a component
being created, updated, deleted, deployed, or retrieved.
Response
AsyncResult[]
describeMetadata()
This call retrieves the metadata that describes your organization. This information includes Apex classes and triggers, custom objects,
custom fields on standard objects, tab sets that define an app, and many other metadata types.
Syntax
DescribeMetadataResult = metadataConnection.describeMetadata(double apiVersion);
Arguments
Name
Type
Description
apiVersion
double
The API version for which you want metadata; for example, 36.0.
Permissions
Your client application must be logged in with the Modify All Data permission.
Sample CodeJava
public void describeMetadata() {
try {
double apiVersion = 21.0;
// Assuming that the SOAP binding has already been established.
DescribeMetadataResult res =
metadataConnection.describeMetadata(apiVersion);
StringBuffer sb = new StringBuffer();
if (res != null && res.getMetadataObjects().length > 0) {
for (DescribeMetadataObject obj : res.getMetadataObjects()) {
sb.append("***************************************************\n");
sb.append("XMLName: " + obj.getXmlName() + "\n");
sb.append("DirName: " + obj.getDirectoryName() + "\n");
sb.append("Suffix: " + obj.getSuffix() + "\n");
78
Utility Calls
describeValueType()
sb.append("***************************************************\n");
}
} else {
sb.append("Failed to obtain metadata types.");
}
System.out.println(sb.toString());
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
Response
DescribeMetadataResult
describeValueType()
Retrieves the metadata describing a given metadata type (value type).
describeValueType() accepts a namespace and a type name, and returns a DescribeValueTypeResult object. This
Syntax
DescribeValueTypeResult = connection.describeValueType("{namespace}type_name");
Example
Describe Apex class metadata in the Metadata namespace:
DescribeValueTypeResult =
metadataConnection.describeValueType("{http://soap.sforce.com/2006/04/metadata}ApexClass");
79
Utility Calls
describeValueType()
Arguments
Name
Type
Description
type
string
The name of the metadata type for which you want metadata; for example, ApexClass.
Include the namespace.
Permissions
Your client application must be logged in with the Modify All Data permission.
Sample CodeJava
The following example describes several metadata types by specifying the Metadata namespace. Each metadata type is described using
the helper method, doDescribe(), which calls the describeValueType() Metadata API call. The sample retrieves information
from the returned DescribeValueTypeResult: a property, the parent field (if any), and the fields. Next, the sample iterates
through the fields and outputs information about each field.
public void describeValueType() throws ConnectionException {
doDescribe("{http://soap.sforce.com/2006/04/metadata}CustomObject");
doDescribe("{http://soap.sforce.com/2006/04/metadata}CustomField");
doDescribe("{http://soap.sforce.com/2006/04/metadata}EmailTemplate");
}
public void doDescribe(String type) throws ConnectionException {
DescribeValueTypeResult result = metadataConnection.describeValueType(type);
StringBuffer sb = new StringBuffer();
sb.append("Describing " + type + " ...\n");
if (result.getApiCreatable() == true) {
sb.append("Is API creatable.\n");
} else {
sb.append("Is not API creatable.\n");
}
ValueTypeField parentField = result.getParentField();
if (parentField != null) {
sb.append("** Parent type fields **\n");
if (parentField.getIsForeignKey()) {
sb.append("This field is a foreign key.\n");
for (String fkDomain : parentField.getForeignKeyDomain()) {
sb.append("Foreign key domain: " + fkDomain + "\n");
}
}
}
sb.append("** Value type fields **\n");
for(ValueTypeField field : result.getValueTypeFields()) {
sb.append("***************************************************\n");
sb.append("Name: " + field.getName() + "\n");
80
Utility Calls
describeValueType()
To run the previous example with the Tooling WSDL, replace the namespace with the Tooling namespace in the helper function call as
follows. Also, use the Tooling connection instead of the Metadata connection to make the describeValueType() call.
doDescribe("{urn:metadata.tooling.soap.sforce.com}CustomObject");
doDescribe("{urn:metadata.tooling.soap.sforce.com}CustomField");
doDescribe("{urn:metadata.tooling.soap.sforce.com}EmailTemplate");
After you run the sample, the output looks similar to the following.
Describing {http://soap.sforce.com/2006/04/metadata}CustomObject ...
Is API creatable.
** Value type fields **
***************************************************
Name: actionOverrides
SoapType: ActionOverride
***************************************************
***************************************************
Name: allowInChatterGroups
SoapType: boolean
***************************************************
***************************************************
Name: articleTypeChannelDisplay
SoapType: ArticleTypeChannelDisplay
***************************************************
***************************************************
Name: businessProcesses
SoapType: BusinessProcess
***************************************************
***************************************************
Name: compactLayoutAssignment
SoapType: string
***************************************************
***************************************************
Name: compactLayouts
SoapType: CompactLayout
***************************************************
***************************************************
Name: customHelp
SoapType: string
This field is a foreign key.
Foreign key domain: ApexPage
Foreign key domain: Scontrol
81
Utility Calls
listMetadata()
***************************************************
<The rest of the output for CustomObject has been omitted for brevity.>
Describing {http://soap.sforce.com/2006/04/metadata}CustomField ...
Is API creatable.
** Parent type fields **
This field is a foreign key.
Foreign key domain: CustomObject
** Value type fields **
***************************************************
Name: caseSensitive
SoapType: boolean
***************************************************
***************************************************
Name: customDataType
SoapType: string
***************************************************
***************************************************
Name: defaultValue
SoapType: string
***************************************************
<The rest of the output has been omitted for brevity.>
Response
DescribeValueTypeResult
listMetadata()
This call retrieves property information about metadata components in your organization. Data is returned for the components that
match the criteria specified in the queries parameter. The queries array can contain up to three ListMetadataQuery queries for
each call. This call supports every metadata type: both top-level, such as CustomObject and ApexClass, and child types, such as CustomField
and RecordType.
Syntax
FileProperties[] = metadataConnection.listMetadata(ListMetadataQuery[] queries, double
asOfVersion);
Usage
This call is useful when you want to identify individual components in package.xml for a retrieve() call or if you want a
high-level view of particular metadata types in your organization. For example, you could use this call to return a list of names of all the
CustomObject or Layout components in your organization, and use this information to make a subsequent retrieve() call to return
a subset of these components. For more information about working with package.xml, see Deploying and Retrieving Metadata on
page 14.
82
Utility Calls
listMetadata()
Note: This is a synchronous call so the results are returned in one call. This differs from asynchronous calls, such as retrieve(),
where at least one subsequent call is needed to get the results.
Permissions
Your client application must be logged in with the Modify All Data permission.
Sample CodeJava
The sample code below lists information about your custom objects. The code assumes that the SOAP binding has already been
established.
public void listMetadata() {
try {
ListMetadataQuery query = new ListMetadataQuery();
query.setType("CustomObject");
//query.setFolder(null);
double asOfVersion = 36.0;
// Assuming that the SOAP binding has already been established.
FileProperties[] lmr = metadataConnection.listMetadata(
new ListMetadataQuery[] {query}, asOfVersion);
if (lmr != null) {
for (FileProperties n : lmr) {
System.out.println("Component fullName: " + n.getFullName());
System.out.println("Component type: " + n.getType());
}
}
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
Arguments
Name
Type
Description
queries
ListMetadataQuery[] A list of objects that specify which components you are interested in.
asOfVersion
double
The API version for the metadata listing request. If you don't specify a value in this field, it
defaults to the API version specified when you logged in. This field allows you to override
the default and set another API version so that, for example, you could list the metadata for
a metadata type that was added in a later version than the API version specified when you
logged in. This field is available in API version 18.0 and later.
Response
FileProperties
83
Utility Calls
ListMetadataQuery
ListMetadataQuery
The ListMetadataQuery parameter specified in a listMetadata() call consists of the following properties:
Name
Type
Description
folder
string
type
string
84
CHAPTER 9
Result Objects
Use the following objects to get the results of your file-based or CRUD-based calls.
IN THIS SECTION:
AsyncResult
Contains the ID of a deployment or retrieval. In API version 28.0 and earlier, contains status information of any asynchronous metadata
call.
CancelDeployResult
Contains information about a deployment cancellationwhether the cancellation completed and the deployment ID.
DeployResult
Contains information about the success or failure of the associated deploy() call.
DescribeMetadataResult
Contains information about the organization that is useful for developers working with declarative metadata.
DescribeValueTypeResult
Contains information about a value type that is useful for developers working with declarative metadata.
ReadResult
Contains result information for the readMetadata call.
RetrieveResult
Contains information about the success or failure of the associated retrieve() call.
SaveResult
Contains result information for the createMetadata, updateMetadata, or renameMetadata call.
DeleteResult
Contains result information for the deleteMetadata call.
UpsertResult
Contains information about the result of the associated upsertMetadata() call.
Error
Represents an error that occurred during a synchronous CRUD (createMetadata(), updateMetadata(), or
deleteMetadata()) operation.
AsyncResult
Contains the ID of a deployment or retrieval. In API version 28.0 and earlier, contains status information of any asynchronous metadata
call.
85
Result Objects
AsyncResult
Type
Description
id
ID
All fields in AsyncResult other than id are deprecated as of API version 31.0. These fields exist but are no longer in use.
done
message
state
statusCode
Type
Description
done
boolean
Required. Indicates whether the call has been completed (true) or not
(false).
id
ID
message
string
state
AsyncRequestState Required. The AsyncRequestState object has one of four possible values.
(enumeration of Queued: This call has not started. It is waiting in a queue.
type string)
InProgress: This call has started but has not been completed.
Completed: This call has been completed.
Error: An error occurred. See the statusCode for more information.
86
Result Objects
AsyncResult
Name
Type
Description
statusCode
StatusCode
(enumeration of
type string)
Type
Description
checkOnly
boolean
Indicates whether this deployment is being used to check the validity of the
deployed files without making any changes in the organization (true) or not
(false). A check-only deployment does not deploy any components or
change the organization in any way. This field is available in API version 16.0
and later and is relevant only for the deploy() call.
done
boolean
Required. Indicates whether the call has been completed (true) or not
(false).
id
ID
message
string
numberComponentErrors int
numberComponentsDeployed int
The number of components that have been deployed for this deployment.
This field in conjunction with the numberComponentsTotal field gives
you an indication of the progress of the deployment. This field is available in
API version 16.0 and later and is relevant only for the deploy() call.
87
Result Objects
Name
AsyncResult
Type
Description
numberComponentsTotal int
numberTestErrors
int
The number of Apex tests that generated errors during this deployment. This
field is available in API version 16.0 and later and is relevant only for the
deploy() call.
numberTestsCompleted
int
The number of Apex tests that have been completed for this deployment. This
field in conjunction with the numberTestsTotal field gives you an
indication of the progress of tests for the deployment. This field is available in
API version 16.0 and later and is relevant only for the deploy() call.
numberTestsTotal
int
The total number of Apex tests in the deployment. This field in conjunction
with the numberTestsCompleted field gives you an indication of the
progress of tests for the deployment. The value in this field is not accurate until
the deployment has started running tests for the components that are being
deployed. This field is available in API version 16.0 and later and is relevant only
for the deploy() call.
secondsToWait
int
This field is no longer supported for API version 13.0 and later and is provided
only for backward compatibility. The field was removed in API version 17.0.
Indicates the number of seconds before the call is likel to be completed. This
is an estimate only. A reasonable approach is to wait one second before calling
checkStatus() to see if the operation is complete. Double your wait time
for each successive iteration of checkStatus() calls until the operation
is complete.
state
AsyncRequestState Required. The AsyncRequestState object has one of four possible values.
(enumeration of Queued: This call has not started. It is waiting in a queue.
type string)
InProgress: This call has started but has not been completed.
Completed: This call has been completed.
Error: An error occurred. See the statusCode for more information.
stateDetail
string
stateDetailLastModifiedDate dateTime
statusCode
StatusCode
(enumeration of
type string)
88
Result Objects
CancelDeployResult
CancelDeployResult
Contains information about a deployment cancellationwhether the cancellation completed and the deployment ID.
The asynchronous metadata call cancelDeploy() returns a CancelDeployResult object.
Version
Available in API version 30.0 and later.
CancelDeployResult has the following properties.
Name
Type
Description
done
boolean
id
ID
DeployResult
Contains information about the success or failure of the associated deploy() call.
The asynchronous metadata call checkDeployStatus() returns a DeployResult object.
In API version 29.0, Salesforce moved several properties from the AsyncResult on page 85 object to the DeployResult object to improve
the process for getting information about deployments. For more information about these changes, see deploy() on page 31.
For API version 29.0 and later, the DeployResult object has the following properties.
Name
Type
Description
id
ID
canceledBy
ID
canceledByName
string
checkOnly
boolean
Indicates whether this deployment is being used to check the validity of the
deployed files without making any changes in the organization (true) or not
(false). A check-only deployment does not deploy any components or change
the organization in any way.
completedDate
dateTime
89
Result Objects
DeployResult
Name
Type
Description
createdBy
ID
createdByName
string
createdDate
dateTime
details
DeployDetails[]
done
boolean
Indicates whether the server finished processing the deploy() call for the
specified id.
errorMessage
string
errorStatusCode
string
If an error occurred during the deploy() call, a status code is returned, and the
message corresponding to the status code is returned in the
errorMessagefield.
For a description of each StatusCode value, see StatusCode in the SOAP API
Developer's Guide.
ignoreWarnings
boolean
lastModifiedDate
dateTime
numberComponentErrors int
numberComponentsDeployed int
The number of components deployed in the deployment process. Use this value
with the numberComponentsTotal value to get an estimate of the
deployments progress.
numberComponentsTotal int
The total number of components in the deployment. Use this value with the
numberComponentsDeployed value to get an estimate of the deployments
progress.
numberTestErrors
int
The number of Apex tests that have generated errors during this deployment.
numberTestsCompleted int
The number of completedApex tests for this deployment. Use this value with the
numberTestsTotal value to get an estimate of the deployments test
progress.
int
The total number of Apex tests for this deployment. Use this value with the
numberTestsCompleted value to get an estimate of the deployments test
progress. The value in this field is not accurate until the deployment has started
running tests for the components being deployed.
numberTestsTotal
90
Result Objects
DeployResult
Name
Type
Description
runTestsEnabled
boolean
Indicates whether Apex tests were run as part of this deployment (true) or not
(false). Tests are either automatically run as part of a deployment or can be set
to run in DeployOptions for the deploy() call. For information on when
tests are automatically run, see Running Tests in a Deployment.
This field is available in API version 30.0 and later.
rollbackOnError
boolean
Optional. Defaults to true. Indicates whether any failure causes a complete rollback
(true) or not (false). If false, whatever set of actions can be performed
without errors are performed, and errors are returned for the remaining actions.
This parameter must be set to true if you are deploying to a production
organization.
startDate
dateTime
stateDetail
string
Indicates which component is being deployed or which Apex test class is running.
status
DeployStatus
(enumeration of
type string)
Indicates the current state of the deployment. The valid values are:
Pending
InProgress
Succeeded
SucceededPartial
Failed
Canceling
Canceled
success
boolean
DeployDetails
These fields provide more information for the details field of the DeployResult object, if the includeDetails parameter is set
to (true in the deploy() call.
Note: While a deployment is still in-progress, the DeployDetails object only contains componentFailures data. After the
deployment process finishes, the other fields populate with the data for the entire deployment.
Name
Type
Description
componentFailures DeployMessage[]
componentSuccesses DeployMessage[]
retrieveResult
RetrieveResult
91
Result Objects
DeployResult
Name
Type
Description
runTestResult
RunTestsResult
If tests were run for the deploy() call, this field contains the test results. While a
deployment is still in-progress, this field only contains error data. After the deployment
process finishes, this field populates with the data for the entire deployment.
For API version 28.0 and earlier, the DeployResult object has the following properties.
Name
Type
Description
id
ID
messages
DeployMessage[]
retrieveResult RetrieveResult
runTestResult RunTestsResult
If tests were run for the deploy() call, this field contains the test results.
success
boolean
DeployMessage
Each DeployResult object contains one or more DeployMessage objects. Each DeployMessage object contains information about the
deployment success or failure of a component in the deployment .zip file:
Name
Type
Description
changed
boolean
If true, the component was changed as a result of this deployment. If false, the
deployed component was the same as the corresponding component already in the
organization.
columnNumber
int
componentType
string
created
boolean
If true, the component was created as a result of this deployment. If false, the
component was either deleted or modified as a result of the deployment.
createdDate
dateTime
The date and time when the component was created as a result of this deployment.
This field is available in API version 30.0 and later.
deleted
boolean
If true, the component was deleted as a result of this deployment. If false, the
component was either new or modified as result of the deployment.
fileName
string
The name of the file in the .zip file used to deploy this component.
92
Result Objects
DeployResult
Name
Type
Description
fullName
string
id
ID
lineNumber
int
problem
string
If an error or warning occurred, this field contains a description of the problem that
caused the compile to fail.
problemType
DeployProblemType Indicates the problem type. The problem details are tracked in the problem field.
(enumeration of
The valid values are:
type string)
Warning
Error
This field is available in API version 18.0 and later. Prior to version 18.0, there was no
distinction between warnings and errors. All problems were treated as errors and
prevented a successful deployment.
success
boolean
Indicates whether the component was successfully deployed (true) or not (false).
RunTestsResult
Contains information about the execution of unit tests, including whether unit tests were completed successfully, code coverage results,
and failures.
A RunTestsResult object has the following properties
Name
Type
Description
apexLogId
string
The ID of an ApexLog object that is created at the end of a test run. The ApexLog
object is created if there is an active trace flag on the user running an Apex test,
or on a class or trigger being executed.
This field is available in API version 35.0 and later.
codeCoverage
CodeCoverageResult[]
codeCoverageWarnings CodeCoverageWarning[] An array of one or more code coverage warnings for the test run. The results
include both the total number of lines that could have been executed, as well
as the number, line, and column positions of code that was not executed.
failures
RunTestFailure[]
numFailures
int
93
Result Objects
DeployResult
Name
Type
Description
numTestsRun
int
successes
RunTestSuccess[]
totalTime
double
The total cumulative time spent running tests. This can be helpful for
performance monitoring.
CodeCoverageResult
The RunTestsResult object contains this object. It contains information about whether or not the compile of the specified Apex and run
of the unit tests was successful.
Name
Type
Description
dmlInfo
CodeLocation[]
For each class or trigger tested, for each portion of code tested, this property contains
the DML statement locations, the number of times the code was executed, and the
total cumulative time spent in these calls. This can be helpful for performance
monitoring.
id
ID
locationsNotCovered CodeLocation[]
For each class or trigger tested, if any code is not covered, the line and column of the
code not tested, and the number of times the code was executed.
methodInfo
CodeLocation[]
For each class or trigger tested, the method invocation locations, the number of times
the code was executed, and the total cumulative time spent in these calls. This can
be helpful for performance monitoring.
name
string
namespace
string
numLocations
int
soqlInfo
CodeLocation[]
For each class or trigger tested, the location of SOQL statements in the code, the
number of times this code was executed, and the total cumulative time spent in
these calls. This can be helpful for performance monitoring.
type
string
CodeCoverageWarning
The RunTestsResult object contains this object. It contains information about the Apex class which generated warnings.
This object has the following properties.
Name
Type
Description
id
ID
message
string
94
Result Objects
DeployResult
Name
Type
Description
name
string
namespace
string
RunTestFailure
The RunTestsResult object returns information about failures during the unit test run.
This object has the following properties.
Name
Type
Description
id
ID
message
string
methodName
string
name
string
namespace
string
seeAllData
boolean
Indicates whether the test method has access to organization data (true) or not
(false).
This field is available in API version 33.0 and later.
stackTrace
string
time
double
The time spent running tests for this failed operation. This can be helpful for
performance monitoring.
type
string
RunTestSuccess
The RunTestsResult object returns information about successes during the unit test run.
This object has the following properties.
Name
Type
Description
id
ID
methodName
string
name
string
namespace
string
seeAllData
boolean
Indicates whether the test method has access to organization data (true) or not
(false).
This field is available in API version 33.0 and later.
95
Result Objects
DescribeMetadataResult
Name
Type
Description
time
double
The time spent running tests for this operation. This can be helpful for performance
monitoring.
CodeLocation
The RunTestsResult object contains this object in a number of fields.
This object has the following properties.
Name
Type
Description
column
int
line
int
numExecutions
int
The number of times the Apex was executed in the test run.
time
double
The total cumulative time spent at this location. This can be helpful for performance
monitoring.
DescribeMetadataResult
Contains information about the organization that is useful for developers working with declarative metadata.
The describeMetadata() call returns a DescribeMetadataResult object.
Each DescribeMetadataResult object has the following properties:
Name
Type
Description
metadataObjects
organizationNamespace string
partialSaveAllowed boolean
testRequired
boolean
DescribeMetadataObject
This object is returned as part of the DescribeMetadataResult. Each DescribeMetadataObject has the following properties:
96
Result Objects
Name
DescribeValueTypeResult
Type
Description
childXmlNames string[]
directoryName string
The name of the directory in the .zip file that contains this component.
inFolder
boolean
Indicates whether the component is in a folder (true) or not (false). For example,
documents, email templates and reports are stored in folders.
metaFile
boolean
Indicates whether the component requires an accompanying metadata file. For example,
documents, classes, and s-controls are components that require an additional metadata
file.
suffix
string
xmlName
string
The name of the root element in the metadata file for this component. This name also
appears in the Packages > types > name field in the manifest file package.xml.
DescribeValueTypeResult
Contains information about a value type that is useful for developers working with declarative metadata.
The describeValueType() call returns a DescribeValueTypeResult object.
Each DescribeValueTypeResult object has the following properties.
Name
Type
Description
apiCreatable
boolean
Indicates whether this value type can be created through the createMetadata()
call (true) or not (false).
This field is available in API version 36.0 and later.
apiDeletable
boolean
Indicates whether this value type can be created through the deleteMetadata()
call (true) or not (false).
This field is available in API version 36.0 and later.
apiReadable
boolean
Indicates whether this value type can be created through the readMetadata()
call (true) or not (false).
This field is available in API version 36.0 and later.
apiUpdatable
boolean
Indicates whether this value type can be created through the updateMetadata()
call (true) or not (false).
This field is available in API version 36.0 and later.
parentField
ValueTypeField
Information about the parent of this value type. Parent field information is useful
for metadata types that are specified with the parent in their name, such as
custom fields, email templates, workflow rules, and reports. For example, the
full name of a custom field includes the sObject that contains it (for example,
Account.field1__c). Similarly, the full name of an email template includes
97
Result Objects
Name
ReadResult
Type
Description
the folder where the template is stored (for example,
MyFolder/EmailTemplate1).
If the value type has no parent, this field is null.
This field is available in API version 36.0 and later.
valueTypeFields
ValueTypeField[]
ValueTypeField
This object is returned as part of the DescribeValueTypeResult and represents the metadata for one field. Each ValueTypeField has the
following properties.
Name
Type
Description
fields
ValueTypeField
foreignKeyDomain string
isForeignKey
boolean
boolean
minOccurs
int
name
string
The name of this value type field. The name is null for parent fields.
picklistValues
PicklistEntry
soapType
string
valueRequired
boolean
Required. Indicates whether this value type field must have a value
(true) or can be null (false).
ReadResult
Contains result information for the readMetadata call.
Version
Available in API version 30.0 and later.
98
Result Objects
RetrieveResult
Properties
Name
Type
Description
records
Metadata[]
RetrieveResult
Contains information about the success or failure of the associated retrieve() call.
The metadata retrieve() call returns a RetrieveResult object.
Each RetrieveResult object has the following fields:
Name
Type
Description
done
boolean
Required. Indicates whether the retrieve() call is completed (true) or not (false).
This field is available in API version 31.0 and later.
errorMessage
string
If an error occurs during the retrieve() call, this field contains a descriptive message
about this error. This field is available in API version 31.0 and later.
errorStatusCode StatusCode
If an error occurs during the retrieve() call, this field contains the status code for
this error. This field is available in API version 31.0 and later.
For a description of each StatusCode value, see StatusCode in the SOAP API Developer's
Guide.
fileProperties FileProperties[]
Contains information about the properties of each component in the .zip file, and the
manifest file package.xml. One object per component is returned.
id
ID
messages
RetrieveMessage[]
status
RetrieveStatus
The status of the retrieve() call. Valid values are:
(enumeration of type Pending
string)
InProgress
Succeeded
Failed
This field is available in API version 31.0 and later.
success
boolean
Indicates whether the retrieve() call was successful (true) or not (false). This
field is available in API version 31.0 and later.
zipFile
base64Binary
The zip file returned by the retrieve request. Base 64-encoded binary data. Prior to making
an API call, client applications must encode the binary attachment data as base64. Upon
receiving a response, client applications must decode the base64 data to binary. This
conversion is usually handled for you by a SOAP client.
99
Result Objects
RetrieveResult
FileProperties
This component contains information about the properties of each component in the .zip file, and the manifest file package.xml.
One object per component is returned. Note that this component does not contain information about any associated metadata files in
the .zip file, only the component files and manifest file. FileProperties contains the following properties:
Name
Type
Description
createdById
string
createdByName
string
createdDate
dateTime
fileName
string
fullName
string
Required. The file developer name used as a unique identifier for API access.
The value is based on the fileName but the characters allowed are more
restrictive. The fullName can contain only underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces, not end
with an underscore, and not contain two consecutive underscores.
id
string
lastModifiedById string
lastModifiedByName string
lastModifiedDate dateTime
Required. Date and time that the file was last modified.
manageableState
ManageableState
(enumeration of type
string)
namespacePrefix
string
type
string
RetrieveMessage
RetrieveResult returns this object, which contains information about the success or failure of the retrieve() call. One object per
problem is returned:
100
Result Objects
SaveResult
Name
Type
Description
fileName
string
The name of the file in the retrieved .zip file where a problem occurred.
problem
string
SEE ALSO:
retrieve()
SaveResult
Contains result information for the createMetadata, updateMetadata, or renameMetadata call.
Version
Available in API version 30.0 and later.
Properties
Name
Type
Description
errors
Error[]
fullName
string
success
boolean
DeleteResult
Contains result information for the deleteMetadata call.
Version
Available in API version 30.0 and later.
Properties
Name
Type
Description
errors
Error[]
fullName
string
success
boolean
101
Result Objects
UpsertResult
UpsertResult
Contains information about the result of the associated upsertMetadata() call.
Version
Available in API version 31.0 and later.
Properties
Name
Type
Description
created
boolean
errors
Error[]
fullName
string
The full name of the component that was created or updated if the operation
was successful.
success
boolean
Error
Represents an error that occurred during a synchronous CRUD (createMetadata(), updateMetadata(), or
deleteMetadata()) operation.
Version
Available in API version 30.0 and later.
Properties
Name
Type
Description
fields
string[]
message
string
statusCode
StatusCode
102
Allows Wildcard
(*)?
Description
AccountSettings
Yes
ActionLinkGroupTemplate
Yes
Represents the action link group template. Action link templates let you reuse
action link definitions and package and distribute action links. An action link
is a button on a feed element. Clicking on an action link can take a user to
another Web page, initiate a file download, or invoke an API call to an external
server or Salesforce. Use action links to integrate Salesforce and third-party
services into the feed. Every action link belongs to an action link group and
action links within the group are mutually exclusive.
ActionOverride
No
ActivitiesSettings
Yes
AddressSettings
Yes
AnalyticSnapshot
No
ApexClass
Yes
103
Metadata Types
Metadata Type
Allows Wildcard
(*)?
ApexComponent
Yes
ApexPage
Yes
ApexTrigger
Yes
AppMenu
Yes
ApprovalProcess
Yes
(See description.)
Description
Use the wildcard (*) symbol to retrieve all approval processes for all objects.
You cant use it to retrieve a subset of approval processes; syntax such as
Lead.* is not supported.
ArticleType
Yes
AssignmentRules
Yes
AuthProvider
Yes
AuraDefinitionBundle
Yes
AutoResponseRules
Yes
BaseSharingRule
Yes
BusinessHoursSettings
Yes
Represents the metadata used to manage settings for business hours and
holidays in entitlements, entitlement templates, campaigns, and cases.
(See description.)
BusinessProcess
104
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
CallCenter
Yes
CaseSettings
Yes
Certificate
Yes
Represents a certificate used for digital signatures which verify that requests
are coming from your org. Certificates are used for either authenticated single
sign-on with an external website, or when using your org as an identity
provider.
ChatterAnswersSettings
Yes
CompanySettings
Yes
Community (Zone)
Yes
Represents a zone that contains Ideas or Chatter Answers objects. Zones are
shared by the Ideas, Answers, and Chatter Answers features, allowing you to
view and create zones from those locations.
CompactLayout
Yes
ConnectedApp
Yes
ContractSettings
Yes
CorsWhitelistOrigin
Yes
CriteriaBasedSharingRule
Yes
CustomApplication
Yes
CustomApplicationComponent
Yes
CustomFeedFilter
Yes
Represents a custom feed filter that limits the feed view to feeds from the
Cases object. The custom feed filter shows only feed items that satisfy the
criteria specified in the CustomFeedFilter definition.
105
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
CustomField
No
Represents the metadata associated with a field. Use this metadata type to
create, update, or delete custom field definitions on standard, custom, and
external objects or standard field definitions on standard objects.
CustomLabel
No
Yes
CustomMetadata
Yes
CustomLabels
Yes
This metadata type allows you to create custom labels that can be localized
for use in different languages, countries, and currencies.
CustomObject
(See description.)
CustomObjectTranslation
Yes
This metadata type allows you to translate custom objects for a variety of
languages.
CustomPageWebLink
Yes
CustomPermission
Yes
CustomSite
Yes
CustomTab
Yes
Represents a custom tab. Display custom object data or other Web content
using custom tabs in Salesforce. When a tab displays a custom object, the
tab name is the same as the custom object name; for page, s-control, or URL
tabs, the name is arbitrary.
Dashboard
No
DataCategoryGroup
Yes
DelegateGroup
Yes
106
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
Document
No
EmailTemplate
No
EntitlementProcess
Yes
EntitlementSettings
Yes
EntitlementTemplate
Yes
EventDelivery
Yes
EventSubscription
Yes
EventType
Yes
ExternalDataSource
Yes
FieldSet
Yes
Represents a field set. A field set is a grouping of fields. For example, you could
have a field set that contains fields describing a user's first name, middle name,
last name, and business title.
FlexiPage
Yes
Flow
Yes
Represents the metadata associated with a flow. With Flow, you can create
an application that navigates users through a series of screens to query and
update records in the database. You can also execute logic and provide
branching capability based on user input to build dynamic applications.
Folder
No
FolderShare
No
Represents the settings for enhanced analytics folder sharing. Users can control
access to reports or dashboards by giving others Viewer, Editor or Manager
access to the folder that contains the report or dashboard.
ForecastingSettings
Yes
Group
Yes
Represents a set of public groups, which can have users, roles, and other
groups.
HomePageComponent
Yes
Represents the metadata associated with a home page component. You can
customize the Home tab to include components such as sidebar links, a
company logo, a dashboard snapshot, or custom components that you create.
107
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
HomePageLayout
Yes
Represents the metadata associated with a home page layout. You can
customize home page layouts and assign the layouts to users based on their
user profile.
IdeasSettings
Yes
InstalledPackage
Yes
KeywordList
Yes
KnowledgeSettings
Yes
Layout
Yes
Letterhead
No
ListView
No
ListView allows you to see a filtered list of records, such as contacts, accounts,
or custom objects.
LiveAgentSettings
Yes
LiveChatAgentConfig
Yes
LiveChatButton
Yes
Represents a Live Agent deployments settings for the button that customers
click to chat with an agent and the chat window, such as the label that appears
on the button and the pre-chat form that appears before a live chat begins.
LiveChatDeployment
Yes
LiveChatSensitiveDataRule
Yes
ManagedTopics
Yes
MatchingRule
Yes
Metadata
No
This is the base class for all metadata types. You cannot edit this object. A
component is an instance of a metadata type.
MetadataWithContent
No
This is the base type for all metadata types that contain content, such as
documents or email templates.
108
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
MilestoneType
Yes
Represents the name and description of a milestone, which you can use in
an entitlement process to track important steps in cases.
MobileSettings
Yes
ModerationRule
Yes
NamedCredential
Yes
NamedFilter
No
This component has been removed as of API version 30.0 and is only provided
for backward compatibility. The metadata associated with a lookup filter is
now represented by the lookupFilter field in the CustomField
component.
Represents the metadata associated with a lookup filter. Use this metadata
type to create, update, or delete lookup filter definitions.
NameSettings
Yes
Enables or disables middle name and suffix attributes for the following person
objects: Contact, Lead, Person Account, and User.
Network
Yes
OpportunitySettings
No
OrderSettings
Yes
OwnerSharingRule
Yes
Package
No
PathAssistant
Yes
PathAssistantSettings
No
109
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
PermissionSet
Yes
No
PlatformCachePartition
Yes
Portal
Yes
PostTemplate
Yes
ProductSettings
No
Profile
Yes
Queue
Yes
QuickAction
Yes
Represents a specified create or update quick action for an object that then
becomes available in the Chatter publisher. For example, you can create an
action that, on the detail page of an account, allows a user to create a contact
related to that account from the Chatter feed on that page. QuickAction can
be created on objects that allow custom fields.
QuoteSettings
No
Enables or disables Quotes, which show proposed prices for products and
services.
RecordType
No
Represents the metadata associated with a record type. Record types let you
offer different business processes, picklist values, and page layouts to different
users.
RemoteSiteSetting
Yes
Represents a remote site setting. Before any Visualforce page, Apex callout,
or JavaScript code using XmlHttpRequest in an s-control or custom button
can call an external site, that site must be registered in the Remote Site Settings
page, or the call will fail.
Report
No
ReportType
Yes
Represents the metadata associated with a custom report type. Custom report
types allow you to build a framework from which users can create and
customize reports.
Role
Yes
SamlSsoConfig
Yes
110
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
Scontrol
Yes
SearchLayouts
No
Represents the metadata associated with the Search Layouts for an object.
You can customize which fields to display for users in search results, search
filter fields, lookup dialogs, and recent record lists on tab home pages.
SecuritySettings
Yes
SharingBaseRule
No
Represents sharing rule settings such as access level and to whom access is
granted.
SharingReason
No
SharingRecalculation
No
Represents Apex classes that recalculate the Apex managed sharing for a
specific custom object.
SharingRules
Yes
Represents the base container for sharing rules, which can be criteria-based,
ownership-based, or territory-based. SharingRules enables you to share records
with a set of users, using rules that specify the access level for the target user
group.
SharingSet
Yes
Represents a sharing set. A sharing set defines an access mapping that grants
portal or community users access to objects that are associated with their
accounts or contacts.
SiteDotCom
Yes
Skill
Yes
Represents the settings for a skill used to route chats to agents in Live Agent,
such as the name of the skill and which agents the skills are assigned to.
StaticResource
Yes
SynonymDictionary
Yes
Territory
Yes
Territory2
Yes
Territory2Model
Yes
Territory2Rule
Yes
111
Metadata Types
Metadata Type
Allows Wildcard
(*)?
Description
Territory2Settings
No
Represents the metadata for the default settings for Territory Management
2.0 users to access and modify records associated with sales territories. The
standard record access settings apply to accounts and opportunities. If your
organization uses Private default internal access for contacts or cases,
you can also set access for those records.
Territory2Type
Yes
TransactionSecurityPolicy
Yes
Translations
Yes
This metadata type allows you to work with translations for various supported
languages.
ValidationRule
No
Represents a validation rule, which is used to verify that the data a user enters
in a record is valid and can be saved. A validation rule contains a formula or
expression that evaluates the data in one or more fields and returns a value
of true or false. Validation rules also include an error message that your
client application can display to the user when the rule returns a value of
true due to invalid data.
WaveTemplateBundle
Yes
WebLink
No
Workflow
Yes
CustomObject and BusinessProcess extend Metadata so they are metadata types; ActionOverride doesn't extend Metadata so it's not a
metadata type.
You can individually deploy or retrieve a component for a metadata type. For example, you can retrieve an individual BusinessProcess
component, but you can't retrieve an individual ActionOverride component. You can only retrieve an ActionOverride component by
retrieving its encompassing CustomObject component.
112
Metadata Types
Metadata components can be manipulated by asynchronous Metadata API calls or declarative (or file-based) Metadata API calls.
Most of the components can be accessed using Force.com IDE. Exceptions are noted in the description of the object.
Enumeration Fields
Some component fields have a data type that is an enumeration. An enumeration is the API equivalent of a picklist. The valid values of
the field are restricted to a strict set of possible values, all having the same data type. These values are listed in the field description
column for each enumeration field. See sortBy for an example of an enumeration field of type string. The XML below shows a sample
definition of an enumeration of type string in the WSDL.
<xsd:simpleType name="DashboardComponentFilter">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="RowLabelAscending"/>
<xsd:enumeration value="RowLabelDescending"/>
<xsd:enumeration value="RowValueAscending"/>
<xsd:enumeration value="RowValueDescending"/>
</xsd:restriction>
</xsd:simpleType>
Supported Calls
All of the metadata types are supported by the main calls, unless it is stated otherwise in the individual component sections. The main
Metadata API calls are:
CRUD calls, such as createMetadata() and deleteMetadata()
File-based calls, such as deploy() and retrieve()
Utility calls, such as listMetadata() and describeMetadata()
113
Metadata Types
Campaign Influences
Case Contact Roles
Case Feed Layouts
Case Team Roles
Console Layouts
Currency Exchange Rates
Data Category Visibility Settings
Delegated Administration
Divisions
Email Services
Fiscal Year
HTML Document and Attachment Settings
Lead Settings
Mail Merge Templates
Mobile Administration
Mobile Users and Devices
Multiline layout fields for opportunity teams
Offline Briefcase Configurations
Opportunity Big Deal Alerts
Opportunity Update Reminders
Organization Wide Email Addresses
Partner Management
The following standard picklists: Lead.CampaignMemberStatus, Opportunity.ForecastCategoryName, and Order.Status. (All other
standard picklists are supported.)
Predefined Case Teams
Product Schedule Setup
Public and Resource Calendars
Quote Templates
Salesforce to Salesforce
Standard fields that arent customizable, such as autonumber fields or system fields
Search Settings
Self-Service Portal Font and Colors
Self-Service Portal Settings
Self-Service Portal Users
Self-Service Public Solutions
Self-Service Web-to-Case
Site.com
Social Account/Contact Settings
Solution Categories
Solution Settings
114
Metadata Types
Tag Settings
Territory Assignment Rules
User Interface Settings (except calendar features, which are supported in ActivitiesSettings on page 506)
Web Links on Person Account Page Layouts
Web-to-Lead
115
Metadata Types
ActionLinkGroupTemplate
Named Credentials
The following callout options for named credentials can be set only via the user interface. If the default values arent appropriate in
the destination organization, the admin for that organization must manually configure the named credential after deployment.
Generate Authorization HeaderDefault: Enabled
Allow Merge Fields in HTTP HeaderDefault: Disabled
Allow Merge Fields in HTTP BodyDefault: Disabled
Page Layout
A deployment containing page layout assignments replaces all existing page layout assignments in the destination org with those
specified in the .zip file. Existing page layouts in the org disappear if theyre not included in the .zip file. Always include all page
layouts for all required record types in the .zip file.
Profiles
If a package includes a profile with a name that doesnt exist in the target org, a new profile is created with that name. If the deployed
profile doesnt specify any permissions or settings, the resulting profile consists of all the permissions and settings in the Standard
Profile.
Sharing
Simultaneously updating the sharingModel field for an object and adding a new sharing rule isnt supported in the Metadata
API, regardless of which object youre updating. For example, you can add a sharing rule when the org-wide default is public,
and subsequently update the sharingModel. This would result in a single sharing recalculation.
You might encounter an error if youre deploying a change set with a custom object that has a parent-child relationship without
the master/detail field in the same change set. To resolve this error, include the master/detail custom field in the change set,
even if you havent changed the org-wide default.
Workflow
Test mode for flow triggers isnt supported in the Metadata API. If you want a flow trigger to run the latest flow version when an
administrator causes the workflow rule to fire, enable test mode via the user interface after deployment.
ActionLinkGroupTemplate
Represents the action link group template. Action link templates let you reuse action link definitions and package and distribute action
links. An action link is a button on a feed element. Clicking on an action link can take a user to another Web page, initiate a file download,
or invoke an API call to an external server or Salesforce. Use action links to integrate Salesforce and third-party services into the feed.
Every action link belongs to an action link group and action links within the group are mutually exclusive. This type extends the Metadata
metadata type and inherits its fullName field.
Version
ActionLinkGroupTemplate components are available in API version 33.0 and later.
116
Metadata Types
ActionLinkGroupTemplate
Fields
Field Name
Field Type
Description
actionLinkTemplates
ActionLinkTemplate Action link templates that are associated with the action link group
on page 117[]
template.
category
PlatformAction
GroupCategory
(enumeration of
type string)
Required. The location of the action link group within the feed element.
Values are:
PrimaryThe action link group is displayed in the body of the
feed element.
OverflowThe action link group is displayed in the overflow
menu of the feed element.
ActionLink
Required. The number of times an action link can be executed. Values
ExecutionsAllowed are:
(enumeration of
OnceAn action link can be executed only once across all users.
type string)
OncePerUserAn action link can be executed only once for
each user.
executionsAllowed
int
Required. The number of hours from when the action link group is
created until it's removed from associated feed elements and can no
longer be executed. The maximum value is 8,760.
isPublished
boolean
name
string
Required. The name of the action link group template to use in code.
ActionLinkTemplate
ActionLinkTemplate components are used to create multiple action links that share properties.
Field Name
Field Type
Description
actionUrl
string
Required. The action link URL. For example, a Ui action link URL is a Web page.
A Download action link URL is a link to the file to download. Ui and
Download action link URLs are provided to clients. An Api or ApiAsync
action link URL is a REST resource. Api and ApiAsync action link URLs
arent provided to clients. Links to Salesforce can be relative. All other links
must be absolute and start with https://.
headers
string
Template for the HTTP headers sent when corresponding action links are
invoked. This field can be used only for Api and ApiAsync action links.
117
Metadata Types
Field Name
ActionLinkGroupTemplate
Field Type
Description
This field can contain context variables and binding variables in the form
{!Bindings.key}.
isConfirmationRequired boolean
isGroupDefault
boolean
Required. If true, action links derived from this template are the default or
primary action in their action groups. There can be only one default action per
action group.
label
string
A custom label to display on the action link button. If none of the LabelKey
values make sense for an action link, use a custom label. Set the LabelKey
field to None and enter a label name in the Label field.
labelKey
string
Required. Key for the set of labels to display for these action link states: new,
pending, success, failed. For example, the Approve set contains these labels:
Approve, Pending, Approved, Failed. For a complete list of keys and labels, see
Action Links Labels in the Chatter REST API Developer Guide or the Apex Developer
Guide.
linkType
ActionLinkType
Required. The type of action link. One of these values:
(enumeration of type ApiThe action link calls a synchronous API at the action URL. Salesforce
string)
sets the status to SuccessfulStatus or FailedStatus based
on the HTTP status code returned by your server.
ApiAsyncThe action link calls an asynchronous API at the action URL.
The action remains in a PendingStatus state until a third party makes
a request to /connect/action-links/actionLinkId to set
the status to SuccessfulStatus or FailedStatus when the
asynchronous operation is complete.
DownloadThe action link downloads a file from the action URL.
UiThe action link takes the user to a Web page at the action URL.
method
ActionLink
Required. HTTP method for the action URL. One of these values:
HttpMethod
HttpDeleteReturns HTTP 204 on success. Response body or output
(enumeration of type
class is empty.
string)
HttpGetReturns HTTP 200 on success.
HttpHeadReturns HTTP 200 on success. Response body or output
class is empty.
HttpPatchReturns HTTP 200 on success or HTTP 204 if the response
body or output class is empty.
HttpPostReturns HTTP 201 on success or HTTP 204 if the response
body or output class is empty. Exceptions are the batch posting resources
and methods, which return HTTP 200 on success.
HttpPutReturn HTTP 200 on success or HTTP 204 if the response body
or output class is empty.
Ui and Download action links must use HttpGet.
118
Metadata Types
ActionLinkGroupTemplate
Field Name
Field Type
Description
position
int
Required. An integer specifying the position of the action link template relative
to other action links in the group. 0 is the first position.
requestBody
string
Template for the HTTP request body sent when corresponding action links are
invoked. This field can be used only for Api and ApiAsync action links.
This field can contain context variables and binding variables in the form
{!Bindings.key}.
userAlias
string
userVisibility
ActionLink
Required. Who can see the action link. This value is set per action link, not per
UserVisibility
action link group. Values are:
(enumeration of type CreatorOnly the creator of the action link can see the action link.
string)
EveryoneEveryone can see the action link.
EveryoneButCreatorEveryone but the creator of the action link
can see the action link.
ManagerOnly the manager of the creator of the action link can see
the action link.
CustomUserOnly the custom user can see the action link.
CustomExcludedUserEveryone but the custom user can see the
action link.
119
Metadata Types
AnalyticSnapshot
<hoursUntilExpiration>10</hoursUntilExpiration>
<isPublished>true</isPublished>
<name>MyPackage</name>
</ActionLinkGroupTemplate>
Usage
If you modify action link group templates, you overwrite the related action link templates.
If you delete a published action link group template, you delete all related action link information which includes deleting all action links
that were instantiated using the template from feed items.
AnalyticSnapshot
Represents a reporting snapshot. A reporting snapshot lets you report on historical data. Authorized users can save tabular or summary
report results to fields on a custom object, then map those fields to corresponding fields on a target object. They can then schedule
when to run the report to load the custom object's fields with the report's data. Reporting snapshots enable you to work with report
data similarly to how you work with other records in Salesforce.
Version
Force.com AnalyticSnapshot components are available in API version 16.0 and later.
Fields
Field
Field Type
Description
description
string
fullName
string
The reporting snapshot name used for API access. The name
can only contain characters, letters, and the underscore (_)
character, must start with a letter, and cannot end with an
120
Metadata Types
AnalyticSnapshot
Field
Field Type
Description
underscore or contain two consecutive underscore characters.
This field is inherited from the Metadata component.
groupColumn
string
mappings
AnalyticSnapshotMapping[]
name
string
runningUser
string
The username of the user whose role and sharing settings are
used to run the reporting snapshot.
sourceReport
string
targetObject
string
AnalyticSnapshotMapping
AnalyticSnapshotMapping defines the mapping for the reporting snapshot. Valid values are:
Field
Field Type
Description
aggregateType
ReportSummaryType[]
List that defines if and how each report field is summarized. For valid
(enumeration of type string) values, see ReportSummaryType.
sourceField
string
sourceType
ReportJobSourceTypes[]
List that defines the report format for the reporting snapshot. For valid
(enumeration of type string) values, see ReportJobSourceTypes.
targetField
string
ReportJobSourceTypes
An enumeration of type string that defines the report format for the reporting snapshot. Valid values are:
Enumeration Value
Description
snapshot
Use this option if the sourceField contains snapshot-specific information such as JobName,
RunningUser, or ExecutionTime.
121
Metadata Types
ArticleType
Enumeration Value
Description
summary
Use this option if referencing a summary (Sum, Average, Minimum, Maximum) of a field from
the sourceReport.
tabular
SEE ALSO:
Report
ArticleType
Represents the metadata associated with an article type. All articles in Salesforce Knowledge are assigned to an article type. An article's
type determines the type of content it contains, its appearance, and which users can access it. For example, a simple FAQ article type
might have two custom fields, Question and Answer, where article managers enter data when creating or updating FAQ articles.
A more complex article type may require dozens of fields organized into several sections. Using layouts and templates, administrators
can structure the article type in the most effective way for its particular content. User access to article types is controlled by permissions.
For each article type, an administrator can grant Create, Read, Edit, or Delete permissions to users. For example, the article manager
might want to allow internal users to read, create, and edit FAQ article types, but let partner users only read FAQs. See Managing Article
Types in the Salesforce online help and Articles in the SOAP API Developer's Guide.
122
Metadata Types
ArticleType
Version
ArticleTypes are available in API version 19.0 and later.
Fields
Field Name
Field Type
articleTypeChannel articleTypeChannelDisplay
Display
deploymentStatus
DeploymentStatus
(enumeration of type string)
Description
Represents the article-type templates used to display an article in the
various channels. See Assigning Article-Type Templates in the Salesforce
online help.
A string which represents the deployment status of a custom object or
field. Valid values are:
InDevelopment
Deployed
description
string
fields
CustomField[]
gender
Gender
Indicates the gender of the noun that represents the object. This is used
for languages where words need different treatment depending on their
gender.
label
string
Label that represents the object throughout the Salesforce user interface.
pluralLabel
string
123
Metadata Types
ArticleType
Field Name
Field Type
Description
startsWith
StartsWith (enumeration of
type string)
articleTypeChannelDisplay
Determines the article-type templates that are used to display an article in its channels. Unless otherwise noted, all fields are createable,
filterable, and nillable.
Field Name
Field Type
articleTypeTemplates articleTypeTemplates
Description
Indicates which article-type template applies in the specified channel.
articleTypeTemplates
Sets the article-type template for a specific channel. If not specified, the default article-type template applies.
Field Name
Field Type
Description
channel
string
page
string
template
string
124
Metadata Types
ArticleType Layout
SEE ALSO:
ArticleType Layout
ArticleType CustomField
ArticleType Layout
Represents the metadata associated with an article type page layout. Article type layouts determine which fields users can view and edit
when entering data for an article, they also determine which sections appear when users view articles. The format of the article, for
example whether layout sections display as subtabs or as a single page with links, is defined by the article-type template. Each article
type has only one layout, but you can choose a different template for each of the article type's four channels. For more information, see
"Managing Article Types" in the Salesforce online help and Articles in the SOAP API Developer's Guide
125
Metadata Types
ArticleType Layout
Version
ArticleType layouts are available in API version 19.0 and later.
Fields
Field Name
Field Type
Description
layoutSections
LayoutSection[]
The main sections of the layout containing the article fields. The
order here determines the layout order.
LayoutSection
LayoutSection represents a section of an ArticleType layout.
Field Name
Field Type
Description
customLabel
boolean
label
string
layoutColumns
LayoutColumn[]
style
LayoutSectionStyle
(enumeration of type
string)
The style of the layout. Salesforce Knowledge only supports the value
OneColumn which displays a one column page.
LayoutColumn
LayoutColumn represents the items in a column within a layout section.
Field Name
Field Type
Description
layoutItems
LayoutItem[]
LayoutItem
LayoutItem represents the valid values that define a layout item.
126
Metadata Types
ArticleType CustomField
Field Name
Field Type
Description
field
string
SEE ALSO:
ArticleType
ArticleType CustomField
ArticleType CustomField
Represents the metadata associated with an article type custom field. Use this metadata type to create, update, or delete article type
custom field definitions. This type extends the Metadata metadata type and inherits its fullName field.
Always specify the full name whenever you create or update a custom field. For example, a custom field on a custom object:
MyArticleType__kav.MyCustomField__c
127
Metadata Types
ArticleType CustomField
Version
ArticleTypes custom fields are available in API version 19.0 and later.
Field Type
Description
defaultValue
string
deleteConstraint
DeleteConstraint
(enumeration of type
string)
string
formula
string
formulaTreatBlankAs
TreatBlanksAs
(enumeration of type
string)
128
Metadata Types
ArticleType CustomField
Field Name
Field Type
Description
fullName
string
inlineHelpText
string
label
string
Label for the field. You cannot update the label for standard
fields in Article Type such as Title, UrlName, Summary, etc.
length
int
picklist
Picklist (Including
Dependent Picklist)
referenceTo
string
relationshipLabel
string
relationshipName
string
required
boolean
type
FieldType
Required. Indicates the field type for the field. Valid values are:
Checkbox available in version 30.0 and later
Currency
ArticleCurrency
Date
DateTime
Email
File
Formula
Html
Lookup
Number
Percent
Phone
Picklist
DependentPicklist
MultiselectPicklist
Text
129
Metadata Types
Field Name
ApexClass
Field Type
Description
TextArea
LongTextArea
URL
visibleLines
int
SEE ALSO:
ArticleType
ArticleType Layout
ApexClass
Represents an Apex class. An Apex class is a template or blueprint from which Apex objects are created. Classes consist of other classes,
user-defined methods, variables, exception types, and static initialization code. For more information, see the Force.com Apex Code
Developer's Guide. This metadata type extends the MetadataWithContent component and shares its fields.
Note: By default, you cant deploy updates to an Apex class if there are one or more active jobs for that class. To deploy updates
in this case, do one of the following.
Cancel Apex jobs before deploying changes to Apex code. Reschedule the jobs after the deployment.
Enable deployments with Apex jobs in the Salesforce user interface in the Deployment Settings page.
Supported Calls
deploy(), retrieve(), describeMetadata(), listMetadata()
Note: This metadata type is not supported by the create(), delete(), and update() calls.
130
Metadata Types
ApexClass
Version
Apex classes are available in API version 10.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
apiVersion
double
The API version for this class. Every class has an API version specified at creation.
content
base64
The Apex class definition. Base 64-encoded binary data. Prior to making an API
call, client applications must encode the binary attachment data as base64. Upon
receiving a response, client applications must decode the base64 data to binary.
This conversion is usually handled for you by a SOAP client. This field is inherited
from the MetadataWithContent component.
fullName
string
The Apex class name. The name can only contain characters, letters, and the
underscore (_) character, must start with a letter, and cannot end with an
underscore or contain two consecutive underscore characters. This field is
inherited from the Metadata component.
packageVersions PackageVersion[]
The list of installed managed package versions that are referenced by this Apex
class.
For more information about managed packages, see the Force.com Quick
Reference for Developing Packages. For more information about package
versions, see About Package Versions in the Salesforce online help. This field
is available in API version 16.0 and later.
status
ApexCodeUnitStatus
The current status of the Apex class. The following string values are valid:
(enumeration of type string)
Active - The class is active.
Deleted - The class is marked for deletion. This is useful for managed
packages, because it allows a class to be deleted when a managed package
is updated.
Note: ApexCodeUnitStatus includes an Inactive option, but it is
only supported for ApexTrigger; it is not supported for ApexClass.
131
Metadata Types
ApexClass
PackageVersion
PackageVersion identifies a version of a managed package. A package version is a number that identifies the set of components uploaded
in a package. The version number has the format majorNumber.minorNumber.patchNumber (for example, 2.1.3). The major
and minor numbers increase to a chosen value during every major release. The patchNumber is generated and updated only for a
patch release. It is available in API version 16.0 and later.
Field Name
Field Type
Description
namespace
string
majorNumber
int
Required. The major number of the package version. A package version number
has a majorNumber.minorNumber format.
minorNumber
int
Required. The minor number of the package version. A package version number
has a majorNumber.minorNumber format.
MyHelloWorld.cls-meta.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
132
Metadata Types
ApexComponent
<apiVersion>36.0</apiVersion>
</ApexClass>
SEE ALSO:
ApexTrigger
ApexComponent
Represents a Visualforce component. For more information, see Visualforce in the Salesforce online help. This metadata type extends
the MetadataWithContent component and shares its fields.
Version
Visualforce components are available in API version 12.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
apiVersion
double
The API version for this Visualforce component. Every component has an API
version specified at creation. This field is available in API version 16.0 and later.
content
base64Binary
The component content. Base 64-encoded binary data. Prior to making an API
call, client applications must encode the binary attachment data as base64. Upon
receiving a response, client applications must decode the base64 data to binary.
This conversion is usually handled for you by a SOAP client. This field is inherited
from the MetadataWithContent component.
description
string
fullName
string
The component developer name used as a unique identifier for API access. The
fullName can contain only underscores and alphanumeric characters. It must
be unique, begin with a letter, not include spaces, not end with an underscore,
and not contain two consecutive underscores. This field is inherited from the
Metadata component.
label
string
133
Metadata Types
Field Name
ApexPage
Field Type
Description
packageVersions PackageVersion[]
The list of installed managed package versions that are referenced by this
Visualforce component.
Note: Package components and Visualforce custom component are
distinct concepts. A package is comprised of many elements, such as
custom objects, Apex classes and triggers, and custom pages and
components.
For more information about managed packages, see the Force.com Quick
Reference for Developing Packages. For more information about package
versions, see About Package Versions in the Salesforce online help. This field
is available in API version 16.0 and later.
SEE ALSO:
ApexPage
ApexPage
Represents a Visualforce page. For more information, see Visualforce in the Salesforce online help. This metadata type extends the
MetadataWithContent component and shares its fields.
Version
Visualforce pages are available in API version 11.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
apiVersion
double
Required. The API version for this page. Every page has an API version
specified at creation. This field is available in API version 15.0 and later.
If you set this field to a number lower than 15.0, it will be changed to
15.0.
content
base64Binary
134
Metadata Types
Field Name
ApexPage
Field Type
Description
by a SOAP client. This field is inherited from the MetadataWithContent
component.
description
string
fullName
string
The page developer name used as a unique identifier for API access.
The fullName can contain only underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces,
not end with an underscore, and not contain two consecutive
underscores. This field is inherited from the Metadata component.
availableInTouch
boolean
confirmationTokenRequired boolean
label
string
packageVersions
PackageVersion[]
SampleApexPage.page-meta.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ApexPage xmlns="http://soap.sforce.com/2006/04/metadata">
135
Metadata Types
ApexTrigger
SEE ALSO:
ApexComponent
ApexTrigger
Represents an Apex trigger. A trigger is Apex code that executes before or after specific data manipulation language (DML) events occur,
such as before object records are inserted into the database, or after records have been deleted. For more information, see Manage
Apex Triggers in the Salesforce online help. This metadata type extends the MetadataWithContent component and shares its fields.
Supported Calls
deploy(), retrieve(), describeMetadata(), listMetadata()
Note: This metadata type is not supported by the create(), delete(), and update() calls.
Version
Triggers are available in API version 10.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
apiVersion
double
Required. The API version for this trigger. Every trigger has an API version specified
at creation.
content
base64
The Apex trigger definition. This field is inherited from the MetadataWithContent
component.
fullName
string
The Apex trigger name. The name can only contain characters, letters, and the
underscore (_) character, must start with a letter, and cannot end with an
underscore or contain two consecutive underscore characters. This field is
inherited from the Metadata component.
136
Metadata Types
Field Name
AppMenu
Field Type
packageVersions PackageVersion[]
Description
The list of installed managed package versions that are referenced by this Apex
trigger.
For more information about managed packages, see the Force.com Quick
Reference for Developing Packages. For more information about package
versions, see About Package Versions in the Salesforce online help. This field
is available in API version 16.0 and later.
status
ApexCodeUnitStatus
Required. The current status of the Apex trigger. The following string values are
(enumeration of type string) valid:
Active - The trigger is active.
Inactive - The trigger is inactive, but not deleted.
Deleted - The trigger is marked for deletion. This is useful for managed
packages, because it allows a trigger to be deleted when a managed package
is updated.
MyHelloWorld.trigger-meta.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>36.0</apiVersion>
</ApexTrigger>
SEE ALSO:
ApexClass
AppMenu
Represents the Force.com app menu or the Salesforce1 navigation menu.
137
Metadata Types
AppMenu
Version
AppMenu components are available in API version 30.0 and later.
Fields
Field Name
Field Type
Description
appMenuItems
AppMenuItem[]
AppMenuItem
Represents a menu item in the app menu.
Field Name
Field Type
Description
name
string
type
string
138
Metadata Types
Field Name
AppMenu
Field Type
Description
Groups (available only when Chatter is enabled)
139
Metadata Types
ApprovalProcess
<name>StandardItem2</name>
<type>StandardAppMenuItem</type>
</appMenuItem>
<appMenuItem>
<name>StandardItem3</name>
<type>StandardAppMenuItem</type>
</appMenuItem>
<appMenuItem>
<name>CustomTab1</name>
<type>CustomTab</type>
</appMenuItem>
</appMenuItems>
</AppMenu>
The following is an example of a package manifest used to deploy or retrieve all the available app menu metadata for an organization,
using a wildcard:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>AppMenu</name>
</types>
<version>30.0</version>
</Package>
Usage
Use AppSwitcher.appMenu to reorder the list of menu items that appears in the Force.com app menu. You cant add app menu
items to or remove app menu items from AppSwitcher.appMenu.
Use Salesforce1.appMenu to customize the list of menu items that appears in the Salesforce1 navigation menu by reordering,
adding, or removing the app menu items.
ApprovalProcess
Represents the metadata associated with an approval process. An approval process is an automated process your organization can use
to approve records in Salesforce. An approval process specifies the steps necessary for a record to be approved and who must approve
it at each step. A step can apply to all records included in the process, or just records that meet certain administrator-defined criteria.
An approval process also specifies the actions to take when a record is approved, rejected, recalled, or first submitted for approval. This
type extends the Metadata metadata type and inherits its fullName field.
140
Metadata Types
ApprovalProcess
Note:
To use approval processes on Salesforce Knowledge articles with the Metadata API, the article type must be deployed. For
article version (_kav) in approval processes, the supported action types are: Knowledge Action, Email Alert, Field Update, and
Outbound Message.
Send actions and approval processes for email drafts arent supported in the Metadata API.
The metadata doesnt include the order of active approval processes. You may need to reorder the approval processes in the
destination organization after deployment.
Before you implement an approval process for your organization, see Considerations for Approval Processes in the Salesforce
Help.
Version
ApprovalProcess components are available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
active
boolean
allowRecall
boolean
allowedSubmitters
ApprovalSubmitter[]
approvalPageFields
ApprovalPageField
141
Metadata Types
ApprovalProcess
Field Name
Field Type
Description
approvalStep
ApprovalStep[]
description
string
emailTemplate
string
enableMobileDeviceAccess boolean
entryCriteria
ApprovalEntryCriteria
finalApprovalActions
ApprovalAction
finalApprovalRecordLock
boolean
finalRejectionActions
ApprovalAction
finalRejectionRecordLock boolean
initialSubmissionActions ApprovalAction
label
string
nextAutomatedApprover
NextAutomatedApprover
142
Metadata Types
ApprovalProcess
Field Name
Field Type
Description
postTemplate
string
recallActions
ApprovalAction
recordEditability
RecordEditabilityType
(enumeration of type string)
showApprovalHistory
boolean
ApprovalSubmitter
Represents a user or set of users who can submit records for approval.
143
Metadata Types
ApprovalProcess
Field Name
Field Type
Description
submitter
string
Identifies a specific user or set of users who can submit records for approval. This field
is required, except when the following types are specified and the submitter
field is ignored:
owner
creator
allInternalUsers
Example:
<allowedSubmitters>
<type>allInternalUsers</type>
</allowedSubmitters>
<allowedSubmitters>
<submitter>myGroup</submitter>
<type>group</type>
</allowedSubmitters>
type
ProcessSubmitterType
(enumeration of type
string)
Required. Type of user or set of users who can submit records for approval. Valid values
are:
group
role
user
roleSubordinates
roleSubordinatesInternal
owner
creator
partnerUser
customerPortalUser
portalRole
portalRoleSubordinates
allInternalUsersall Salesforce users in the organization
ApprovalPageField
Represents the selection of fields to display on the approval page, where an approver can view the approval request details and approve
or reject the record.
Field Name
Field Type
Description
field
string[]
An array of fields that are displayed on the page for the approver to approve
or reject the record.
144
Metadata Types
ApprovalProcess
ApprovalStep
Represents a step in the approval process. Approval steps assign approval requests to various users and define the chain of approval for
a particular approval process. Each approval step specifies the attributes a record must have to advance to that approval step, the user
who can approve requests for those records, and whether to allow the delegate of the approver to approve the requests. The first
approval step in a process specifies the action to take if a record does not advance to that step. Subsequent steps in the process allow
you to specify what happens if an approver rejects the request.
Note:
The order of the ApprovalStep entries in the approval process definition determines the order in which the approval
steps are executed.
After an approval process is activated, you can't add, delete, or change the order of the steps or change reject or skip behavior
for that process, even if you make the process inactive.
There is a limit of 30 steps.
Field Name
Field Type
Description
allowDelegate
boolean
approvalActions
ApprovalAction
assignedApprover
ApprovalStepApprover
description
string
entryCriteria
ApprovalEntryCriteria
ifCriteriaNotMet
StepCriteriaNotMetType
(enumeration of type string)
label
string
name
string
145
Metadata Types
ApprovalProcess
Field Name
Field Type
Description
rejectBehavior
ApprovalStepRejectBehavior
rejectionActions
ApprovalAction
ApprovalAction
Represents the actions that occur as a result of an approval process.
Field Name
Field Type
Description
action
WorkflowActionReference[]
ApprovalStepApprover
Represents the assigned approvers for an approval step. There is a limit of 25 approvers per step.
Field Name
Field Type
Description
approver
Approver[]
whenMultipleApprovers
RoutingType
(enumeration of
type string)
Approver
Represents an assigned approver for an approval step.
Note: When specifying approvers, note the following:
Make sure the assigned approver has access to read the records for the approval requests. For example, a user who does not
have read access to an Expenses custom object will not be able to view expense approval requests.
You can't use email approval response with approval processes in which the assigned approver is a queue.
Approvers must have the API Enabled system permission to approve or reject approval requests via email.
146
Metadata Types
ApprovalProcess
You can assign an approval request to the same user multiple times in a single step; however, Salesforce recognizes such
redundancies and only requests a single approval from the user.
After a record enters an approval step, the designated approvers for that step don't change even if the approval process returns
to that step and the values of related user fields that designate the approvers have changed. For example, consider an approval
process in which the first step requests approval from a user's manager. If the approval request is rejected in the second step
and sent back to the first step, the user's original manager receives the approval request again even if the user's manager has
changed.
When the assigned approver is a queue:
Any queue member can approve or reject an approval request that is assigned to the queue.
Approval request emails are sent to the queue email address. If the queue is set up to send email to members, then approval
request emails are also sent to the queue members, except those whose approval user preferences are set to never receive
approval request emails.
When an approval request is assigned to a queue, each queue member's delegated approver also receives an approval
request email notification.
Because email notifications to a queue arent intended for an external audience, any instances of the merge field
{!ApprovalRequest.External_URL} in the email template are sent as the equivalent internal URL.
Salesforce1 notifications for approval requests arent sent to queues. For each approval step involving a queue, we
recommend adding individual users as assigned approvers, so at least those individuals can receive the approval request
notifications in Salesforce1. To have both queues and individual users as assigned approvers, select Automatically
assign to approver(s) instead of Automatically assign to queue in the approval step.
When an approval request is rejected and returned to the previous approver and the previous approver was a queue, the
approval request is assigned to the user who approved it instead of the queue.
The Approval History related list displays the queue name in the Assigned To column and the actual user who
approved or rejected the approval request in the Actual Approver column.
Field Name
Field Type
Description
name
string
Identifies an assigned approver. This field is required, except when the type is one of
the following and the name is ignored:
adhoc
userHierarchyField
type
NextOwnerType
(enumeration of type
string)
Combined with the specified name, this identifies an assigned approver. Valid values are:
adhocThe approver for the step must be selected manually. For the first step, the
submitter selects the approver. For the second and later steps, the approver for the
previous step selects the approver. For this value, exclude the name field.
userA user in your organization. For this value, enter a username for the name
field.
userHierarchyFieldA user specified in a standard or custom user hierarchy
field, such as the standard Manager field. For this value, exclude the name field.
The user hierarchy field must be defined in the nextAutomatedApprover for
the approval process.
relatedUserFieldA user specified in a user lookup field on the submitted
record, such as the Last Modified By field. For this value, enter the name of
the user lookup field for the name field.
147
Metadata Types
Field Name
ApprovalProcess
Field Type
Description
queueAutomatically assign to a queue. For this value, enter the name of the queue
for the name field.
ApprovalEntryCriteria
Represents the criteria that records must meet to enter the approval process or an approval step. Specify either filter criteria or a formula,
but not both.
Field Name
Field Type
Description
booleanFilter
string
Filter logic for criteriaItems. Exclude this field if you enter a formula.
criteriaItems
FilterItem[]
Filter criteria that a record must meet to enter the approval process or approval
step.
Approval processes don't support valueField entries in filter criteria.
string
formula
Formula that must evaluate to true for a record to enter the approval process
or approval step.
ApprovalStepRejectBehavior
Represents what happens if the approver rejects the request during this approval step, unless its the first step in the approval process.
For the first step in the approval process, the reject behavior is determined by the approval processs final rejection actions.
Field Name
Field Type
Description
type
StepRejectBehaviorType
Valid values are:
(enumeration of type string) RejectRequestAutomatically rejects the request completely regardless of
any previous steps that were approved. Salesforce performs all rejection actions
specified for this step and all final rejection actions.
BackToPreviousAutomatically rejects the request and returns the approval
request to the previous approver. Salesforce performs all rejection actions specified
for this step. Not allowed in the first step of the approval process.
NextAutomatedApprover
Represents the user hierarchy field to use as the next automated approver for the approval process. If defined, the user specified in the
hierarchy field can be automatically assigned as the approver in one or more approval steps.
Field Name
Field
Type
useApproverFieldOfRecordOwner boolean
Description
Required. Whether the first executed approval step should use the
specified userHierarchyField in the record owners user
recordinstead of the submitters user recordas the approver. All
148
Metadata Types
Field Name
ApprovalProcess
Field
Type
Description
remaining steps use the specified userHierarchyField in the
user record of the preceding steps approver.
userHierarchyField
string
149
Metadata Types
ApprovalProcess
<name>LeadApprovedTask2</name>
<type>Task</type>
</action>
</approvalActions>
<assignedApprover>
<approver>
<type>adhoc</type>
</approver>
</assignedApprover>
<label>Step1</label>
<name>Step1</name>
<rejectionActions>
<action>
<name>LeadRejectedTask</name>
<type>Task</type>
</action>
</rejectionActions>
</approvalStep>
<approvalStep>
<allowDelegate>false</allowDelegate>
<assignedApprover>
<approver>
<type>userHierarchyField</type>
</approver>
</assignedApprover>
<entryCriteria>
<criteriaItems>
<field>Lead.CreatedDate</field>
<operation>greaterThan</operation>
<value>3/25/2013</value>
</criteriaItems>
<criteriaItems>
<field>User.IsActive</field>
<operation>notEqual</operation>
<value>true</value>
</criteriaItems>
</entryCriteria>
<ifCriteriaNotMet>ApproveRecord</ifCriteriaNotMet>
<label>Step2</label>
<name>Step2</name>
<rejectBehavior>
<type>RejectRequest</type>
</rejectBehavior>
</approvalStep>
<approvalStep>
<allowDelegate>true</allowDelegate>
<assignedApprover>
<approver>
<name>MarketingTeamQueue</name>
<type>queue</type>
</approver>
<approver>
<name>LastModifiedBy</name>
<type>relatedUserField</type>
150
Metadata Types
ApprovalProcess
</approver>
<approver>
<name>[email protected]</name>
<type>user</type>
</approver>
<whenMultipleApprovers>FirstResponse</whenMultipleApprovers>
</assignedApprover>
<entryCriteria>
<formula>CONTAINS( MyLeadCustomField__c , 'Salesforce')</formula>
</entryCriteria>
<label>Step3</label>
<name>Step3</name>
<rejectBehavior>
<type>BackToPrevious</type>
</rejectBehavior>
</approvalStep>
<emailTemplate>MyFolder/LeadsNewassignmentnotification</emailTemplate>
<enableMobileDeviceAccess>false</enableMobileDeviceAccess>
<entryCriteria>
<criteriaItems>
<field>Lead.AnnualRevenue</field>
<operation>greaterThan</operation>
<value>10500</value>
</criteriaItems>
<criteriaItems>
<field>Lead.MyLeadCustomField__c</field>
<operation>equals</operation>
<value>Salesforce</value>
</criteriaItems>
</entryCriteria>
<finalApprovalActions>
<action>
<name>LeadEmailContacted</name>
<type>Alert</type>
</action>
</finalApprovalActions>
<finalApprovalRecordLock>true</finalApprovalRecordLock>
<finalRejectionActions>
<action>
<name>ProcessRejectedMessageAction</name>
<type>OutboundMessage</type>
</action>
</finalRejectionActions>
<finalRejectionRecordLock>false</finalRejectionRecordLock>
<initialSubmissionActions>
<action>
<name>LeadFieldUpdate</name>
<type>FieldUpdate</type>
</action>
<action>
<name>NewLeadEmail</name>
<type>Alert</type>
</action>
</initialSubmissionActions>
151
Metadata Types
AssignmentRules
<label>SampleProcess</label>
<nextAutomatedApprover>
<useApproverFieldOfRecordOwner>false</useApproverFieldOfRecordOwner>
<userHierarchyField>customlookupuserfield__c</userHierarchyField>
</nextAutomatedApprover>
<postTemplate>MyPostTemplate</postTemplate>
<recallActions>
<action>
<name>ProcessRecalledMessageAction</name>
<type>OutboundMessage</type>
</action>
</recallActions>
<recordEditability>AdminOnly</recordEditability>
<showApprovalHistory>false</showApprovalHistory>
</ApprovalProcess>
AssignmentRules
Represents assignment rules that allow you to automatically route cases to the appropriate users or queues. You can access rules metadata
for all applicable objects, for a specific object, or for a specific rule on a specific object. The package.xml syntax for accessing all
assignment rules for all objects is:
<types>
<members>*</members>
<name>AssignmentRules</name>
</types>
All rules for a specific object uses a similar syntax without the wildcard. For example, all assignment rules for the Case object would use
this syntax:
<types>
<members>Case</members>
<name>AssignmentRules</name>
</types>
You can also access specific assignment rules for an object. The following example only accesses the samplerule and newrule
assignment rules on the Case object. Notice that for this example the type name syntax is AssignmentRule and not
AssignmentRules.
<types>
<members>Case.samplerule</members>
<members>Case.newrule</members>
<name>AssignmentRule</name>
</types>
152
Metadata Types
AssignmentRules
Version
AssignmentRules components are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
assignmentRule
AssignmentRule[]
AssignmentRule
Specifies whether the rule is active or not and its definition. Rules are processed in the order they appear within the AssignmentRules
container.
Field Name
Field Type
Description
active
boolean
fullname
string
RuleEntry[]
Field Name
Field Type
Description
assignedTo
string
assignedToType
ruleEntry
RuleEntry
Represents the fields used by the rule.
User
Queue
booleanFilter
string
criteriaItems
FilterItem[]
formula
string
153
Metadata Types
AssignmentRules
Field Name
Field Type
Description
notifyCcRecipients
boolean
overrideExistingTeams
boolean
team
string[]
template
string
154
Metadata Types
AuraDefinitionBundle
AuraDefinitionBundle
Represents a Lightning definition bundle. A bundle contains a Lightning definition and all its related resources. The definition can be a
component, application, event, interface, or a tokens collection.
Lightning bundles must be under a top-level folder thats named aura. Each bundle must have its own subfolder under the aura
folder. The name of each definition file must start with the bundle name.
A bundle doesnt have a suffix. Definition files can have one of these suffixes:
Suffix
Component Type
.app
Application
.cmp
Component
.design
Design
.evt
Event
.intf
Interface
.js
.svg
SVG image
.css
Style
.auradoc
Documentation
.tokens
Tokens collection
Each bundle can have only one file each with a suffix of .app, .cmp, .design, .evt, .intf, or .tokens.
155
Metadata Types
AuraDefinitionBundle
Version
AuraDefinitionBundle components are available in API version 32.0 and later.
Design and SVG components are available in API version 33.0 and later.
Fields
Field Name
Field Type
Description
apiVersion
double
The API version for this definition bundle. When you create an Aura
bundle, you can specify the API version to save it with. Available in API
version 35.0 and later.
controllerContent
base64Binary
description
string
The specification of the Aura bundle. Available in API version 35.0 and
later.
designContent
base64Binary
documentationContent
base64Binary
helperContent
base64Binary
markup
base64Binary
modelContent
base64Binary
packageVersions
PackageVersion[]
The list of installed managed package versions that this Aura definition
bundle references. Available in API version 35.0 and later.
rendererContent
base64Binary
styleContent
base64Binary
SVGContent
base64Binary
testsuiteContent
base64Binary
type
AuraBundleType
(enumeration of
type string)
156
Metadata Types
AuthProvider
The following samples show the contents of the metadata definition files that correspond to the sample aura directory.
Content of sampleCmp.cmp:
<aura:component>
<aura:attribute name="val1" type="String" default="Value"/>
<aura:attribute name="val2" type="String" />
<aura:handler name="init" value="{!this}" action="{!c.myAction}"/>
<ui:outputText value='Hello world!'/>
<ui:outputText value='{!v.val1}'/>
<ui:outputText value='{!v.val2}'/>
</aura:component>
Content of sampleCmpController.js:
({
myAction : function(component) {
component.set('v.val1','Value1');
component.set('v.val2','Value2');
}
})
This package.xml references the definitions of all Lightning components that are present in the sampleCmp bundle.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>sampleCmp</members>
<name>AuraDefinitionBundle</name>
</types>
<version>36.0</version>
</Package>
AuthProvider
Represents an authentication provider (or auth provider) in your organization. An auth provider enables users to log in to your Salesforce
organization using their login credentials from an external service provider such as Facebook or Janrain. This type extends the Metadata
metadata type and inherits its fullName field.
157
Metadata Types
AuthProvider
Version
Authentication providers are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
authorizeUrl
string
consumerKey
string
Required. The apps key that is registered at the third-party single sign-on
provider.
In API version 33.0 and later, the behavior of this field changed to support
the Salesforce-managed auth provider configuration, which allows
Salesforce to manage the value for Facebook, Salesforce, LinkedIn, Twitter
or Google authentication. For more information, see the Usage section.
consumerSecret
string
158
Metadata Types
Field Name
AuthProvider
Field Type
customMetadataTypeRecord string
defaultScopes
string
Description
Required, but only with custom authentication provider plug-ins, when
ProviderType is Custom. The API name of the authentication
provider. Available in API version 36.0 and later.
Required, but only if providerType is OpenIdConnect The scopes
to be sent with the authorization request, if not specified when a flow is
started. Used only with OpenID Connect authentication providers. Available
in API version 29.0 and later.
In API version 33.0 and later, the behavior of this field changed to support
the Salesforce-managed auth provider configuration, which allows
Salesforce to manage the value for Facebook, Salesforce, LinkedIn, Twitter
or Google authentication. For more information, see the Usage section.
DeveloperName
string
errorUrl
string
A custom error URL for the provider to use to report any errors.
executionUserId
string
The user that runs the Apex handler class. The user must have the Manage
Users permission. A user is required if you specify a registration handler
class.
friendlyName
string
iconUrl
string
The path to an icon to use as a button on the login page for a community.
Users click the button to log in to a community with the associated
authentication provider, such as Twitter or LinkedIn. Available in API
version 32.0 and later.
idTokenIssuer
string
logoutUrl
string
Provides a specific destination for users after they log out if they
authenticated using the single sign-on flow. The URL must be fully qualified
with an http or https prefix, such as
https://acme.my.salesforce.com. Available in API version
33.0 and later.
plugin
string
providerType
AuthProviderType Required. The third-party single sign-on provider to use. Valid values are:
(enumeration of
type string)
Facebook
Google
Salesforce
Janrain
159
Metadata Types
Field Name
AuthProvider
Field Type
Description
LinkedIn (Available in API version 32.0 and later.)
Twitter (Available in API version 32.0 and later.)
OpenIdConnect (Available in API version 29.0 and later.)
Note: This type requires values for the following fields:
authorizeUrl
defaultScopes
tokenUrl
userInfoUrl
MicrosoftACS Microsoft Access Control Service typically provides
authentication for a Microsoft Office 365 service like SharePoint Online.
(Available in API version 31.0 and later.)
GitHubUse the GitHub provider to log in users of your Force.com
app to GitHub using OAuth. When logged in to GitHub, your app can
make calls to GitHub APIs. The GitHub provider isnt available as a
single sign-on provider, which means users cant log in to your
Salesforce organization using their GitHub login credentials. (Available
in API version 35.0 and later.)
CustomA provider configured with a custom authentication
provider plug-in. (Available in API version 36.0 and later.)
registrationHandler
string
sendAccessTokenInHeader boolean
sendClientCredentialsInHeader boolean
tokenUrl
string
160
Metadata Types
AuthProvider
Field Name
Field Type
Description
userInfoUrl
string
The following is an example package manifest that references the previous AuthProvider definition.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>AuthProvider</members>
<name>FacebookProvider</name>
</types>
<version>28.0</version>
</Package>
Usage
For API version 33.0 and later. when implementing the Salesforce-managed authentication provider configuration, you can have Salesforce
create and manage the following fields for you:
authorizeUrl
consumerKey
consumerSecret
defaultScopes
tokenURL
userInfoUrl
To configure a Salesforce-managed authentication provider, set up a Facebook, Salesforce, LinkedIn, Twitter or Google auth provider
and leave all of the listed fields blank. Salesforce automatically creates values for you. However, if you provide a value for any of these
fields, then consumerKey and consumerSecret must also be specified.
161
Metadata Types
AutoResponseRules
AutoResponseRules
Represents an auto-response rule that sets conditions for sending automatic email responses to lead or case submissions based on the
attributes of the submitted record. You can access rules metadata for all applicable objects, for a specific object, or for a specific rule on
a specific object. The package.xml syntax for accessing all auto-response rules for all objects is:
<types>
<members>*</members>
<name>AutoResponseRules</name>
</types>
All rules for a specific object uses a similar syntax without the wildcard. For example, all auto-response rules for the Case object would
use this syntax:
<types>
<members>Case</members>
<name>AutoResponseRules</name>
</types>
You can also access specific auto-response rules for an object. The following example only accesses the samplerule and newrule
auto-response rules on the Case object. Notice that for this example the type name syntax is AutoResponseRule and not
AutoResponseRules.
<types>
<members>Case.samplerule</members>
<members>Case.newrule</members>
<name>AutoResponseRule</name>
</types>
Version
AutoResponseRules components are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
autoresponseRule
AutoResponseRule
Represents whether a rule is active or not and the order in which the entry is processed in the rule.
162
Metadata Types
AutoResponseRules
Field Name
Field Type
Description
active
boolean
fullname
string
RuleEntry[]
Field Name
Field Type
Description
booleanFilter
string
criteriaItems
FilterItem[]
formula
string
ruleEntry
RuleEntry
Represents the fields used by the rule.
string
senderEmail
string
senderName
string
template
string
163
Metadata Types
CallCenter
<value>testing</value>
</criteriaItems>
<senderEmail>[email protected]</senderEmail>
<senderName>tester name j</senderName>
<replyToEmail>test@@test.org</replyToEmail>
<template>emailtemplate</template>
</ruleEntry>
</autoResponseRule>
</AutoResponseRules>
CallCenter
Represents the Call Center definition used to integrate Salesforce with a third-party computer-telephony integration (CTI) system.
Version
CallCenter components are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
adapterUrl
string
displayName
string
displayNameLabel
string
internalNameLabel
string
version
string
sections
CallCenterSection
Field Name
Field Type
Description
items
label
string
name
string
164
Metadata Types
CallCenter
CallCenterItem
Field Name
Field Type
Description
label
string
name
string
value
int or URL
165
Metadata Types
Certificate
<value>1</value>
</items>
<items>
<label>International Prefix</label>
<name>reqInternationalPrefix</name>
<value>01</value>
</items>
<label>Dialing Options</label>
<name>reqDialingOptions</name>
</sections>
<version>4</version>
</CallCenter>
Certificate
Represents a certificate used for digital signatures which verify that requests are coming from your org. Certificates are used for either
authenticated single sign-on with an external website, or when using your org as an identity provider. This metadata type extends the
MetadataWithContent component and shares its fields.
Version
Certificate components are available in API version 36.0 and later.
Fields
Field Name
Field Type
Description
caSigned
boolean
keySize
int
Required. Certificate keys can be either 2048 bits or 4096 bits. A certificate
with 4096-bit keys lasts two years, and a certificate with 2048-bit keys
lasts one year. Certificates with 2048-bit keys are faster than certificates
with 4096-bit keys.
masterLabel
string
166
Metadata Types
Community (Zone)
Community (Zone)
Note: Starting with the Summer 13 release, Chatter Answers and Ideas communities have been renamed to zones. In API
version 28, the API object label has changed to Zone, but the API type is still Community.
Represents a zone that contains Ideas or Chatter Answers objects. Zones are shared by the Ideas, Answers, and Chatter Answers features,
allowing you to view and create zones from those locations. This type extends the Metadata metadata type and inherits its fullName
field.
Note: When enableChatterAnswers is set to false, values specified for the following fields are ignored and not saved:
communityFeedPage, emailFooterDocument, emailHeaderDocument, enablePrivateQuestions,
emailNotificationUrl, and site.
Version
Community (Zone) components are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
active
boolean
communityFeedPage
string
The Visualforce page that hosts the zones feeds. This field is available
when Chatter Answers is enabled in the organization.
description
string
emailFooterDocument
string
The text or HTML file that incorporates your organizations branding into
the footer of email notifications. This field is available when Chatter
Answers is enabled in the organization.
emailHeaderDocument
string
The text or HTML file that incorporates your organizations branding into
the header of email notifications. This field is available when Chatter
Answers is enabled in the organization.
167
Metadata Types
Community (Zone)
Field Name
Field Type
Description
emailNotificationUrl
string
The URL thats included in email notifications. This field is available when
Chatter Answers is enabled in the organization. This field replaces
portalEmailNotificationUrl in API version 28.0 and later.
enableChatterAnswers
boolean
Indicates whether the zone has Chatter Answers enabled (true) or not
(false). This field is available when Chatter Answers is enabled in the
organization.
enablePrivateQuestions
boolean
expertsGroup
string
The name of the public group that act as experts in the zone. This field
is available when eitherIdeas or Answers are enabled in the organization.
portal
string
portalEmailNotificationUrl string
The portal URL thats included in email notifications. This field is available
when Chatter Answers is enabled in the organization. This field has been
replaced by emailNotificationUrl in API version 28.0 and later.
reputationLevels
ReputationLevels
The fields that define the points and name of each reputation level you
define. You can create up to 25 reputation levels per zone.
showInPortal
boolean
site
string
The name of the site for the zone. This field is available when Chatter
Answers is enabled in the organization.
ReputationLevels
Represents the points and reputation label that displays on hover over a users photo in the feed.
Field Name
Field Type
Description
chatterAnswersReputationLevels ChatterAnswersReputationLevel Contains the name and value pair that describes the
ideaReputationLevels
[]
IdeaReputationLevel
ChatterAnswersReputationLevel
Represents the reputation name and the number of points for that level for Chatter Answers.
Field Name
Field Type
Description
name
string
168
Metadata Types
Community (Zone)
Field Name
Field Type
Description
value
int
IdeaReputationLevel
Represents the reputation name and the number of points for that level for Ideas. Available in API version 28.0 and later.
Field Name
Field Type
Description
name
string
value
int
169
Metadata Types
ConnectedApp
<name>Contributor</name>
<value>100</value>
</ideaReputationLevels>
<ideaReputationLevels>
<name>Influencer</name>
<value>400</value>
</ideaReputationLevels>
<ideaReputationLevels>
<name>Thought Leader</name>
<value>1500</value>
</ideaReputationLevels>
</reputationLevels>
<showInPortal>true</showInPortal>
<site>ChatterAnswersSite</site>
</Community>
ConnectedApp
Represents a connected app configuration. A connected app integrates an application with Salesforce using APIs. Connected apps use
standard SAML and OAuth protocols to authenticate, provide Single Sign-On, and provide tokens for use with Salesforce APIs. In addition
to standard OAuth capabilities, connected apps allow administrators to set various security policies and have explicit control over who
may use the corresponding applications. This type extends the Metadata metadata type and inherits its fullName field.
Version
ConnectedApp components are available in API version 29.0 and later.
Fields
Field Name
Field Type
Description
attributes
ConnectedAppAttribute
canvasConfig
ConnectedAppCanvasConfig
contactEmail
string
The email address Salesforce should use for contacting you or your
support team.
contactPhone
string
description
string
iconUrl
string
170
Metadata Types
ConnectedApp
Field Name
Field Type
Description
infoUrl
string
An optional URL for a Web page with more information about your
application.
ipRanges
ConnectedAppIpRange
Specifies the ranges of IP addresses that can access the app without
requiring the user to authenticate with the connected app.
label
string
logoUrl
string
mobileStartUrl
string
Users are directed to this URL after theyve authenticated when the
app is accessed from a mobile device. If you dont give a URL, the user
is sent to the applications default start page after authentication
completes. If the connected app that youre creating is a canvas app,
then you dont need to enter a value for this field. The Canvas App
URL field contains the URL that gets called for the connected app.
oauthConfig
ConnectedAppOauthConfig
plugin
string
samlConfig
ConnectedAppSamlConfig
startUrl
string
If the app is not accessed from a mobile device, users are directed to
this URL after theyve authenticated. If you dont give a URL, the user
is sent to the applications default start page after authentication
completes. If the app is accessed from a mobile device, see
mobileStartUrl. If the connected app that youre creating is a
canvas app, then you dont need to enter a value for this field. The
Canvas App URL field contains the URL that gets called for the
connected app.
ConnectedAppAttribute
Represents the field names that make up a custom attribute when using SAML with a ConnectedApp. These values should be tailored
to a specific service provider.
Field Name
Field Type
Description
formula
string
key
string
171
Metadata Types
ConnectedApp
ConnectedAppCanvasConfig
The configuration options of the connected app if its exposed as a canvas app.
Field Name
Field Type
Description
accessMethod
AccessMethod (enumeration of
type string)
Indicates how the canvas app initiates the OAuth authentication flow.
The valid values are:
GetOAuth authentication is used, and the user is prompted to
allow the third-party application to access their information. When
you use this access method, the canvas app must initiate the OAuth
authentication flow.
PostOAuth authentication is used, but when the administrator
installs the canvas app, they implicitly allow access for users.
Therefore, the user wont be prompted to allow the third-party to
access their user information. When you use this access method,
the authentication is posted directly to the canvas app URL.
canvasUrl
string
lifecycleClass
string
locations
CanvasLocationOptions
(enumeration of type string)
Indicates where the canvas app can appear to the user. The valid values
are:
AuraReserved for future use.
AppLauncherReserved for future use.
ChatterThe canvas app can appear in the app navigation
list on the Chatter tab.
ChatterFeedThe canvas app can appear as a Chatter feed
item.
MobileNavThe canvas app can appear in a mobile card in
the Salesforce1 app. This value is available in API version 31.0 and
later.
NoneThe canvas app can appear only in the Canvas App
Previewer.
OpenCTIThe canvas app can appear in the call control tool.
PageLayoutThe canvas app can appear on a page layout.
When viewed in the Salesforce1 app, the canvas app appears in
the record detail page. This value is available in API version 31.0
and later.
PublisherThe canvas app can appear as a global action.
ServiceDeskThe canvas app can appear in the footer or
sidebars of a Salesforce console.
UserProfileReserved for future use.
172
Metadata Types
Field Name
ConnectedApp
Field Type
Description
VisualforceThe canvas app can appear on a Visualforce
page.
options
CanvasOptions (enumeration of
type string)
Indicates whether you want to hide the share button and header in
the publisher for your canvas app, and whether the app is a canvas
personal app. Valid values are:
HideShareThe Share button is hidden in the publisher for
the related canvas app.
Available in API version 30.0 and later.
HideHeaderThe header is hidden in the publisher for the
related canvas app.
Available in API version 30.0 and later.
PersonalEnabledThe app can be installed by end users
as a canvas personal app.
Available in API version 32.0 and later.
samlInitiationMethod SamlInitiationMethod
ConnectedAppIpRange
The list of IP addresses that can access the app without requiring the user to authenticate.
Field Name
Field Type
Description
description
string
Use this field to identify the purpose of the range, such as which part
of a network corresponds to this range. This field is available in API
version 31.0 and later.
startAddress
string
endAddress
string
ConnectedAppOauthConfig
Represents the field names that make up a custom attribute in a ConnectedApp.
173
Metadata Types
ConnectedApp
Field Name
Field Type
Description
callbackUrl
string
certificate
string
consumerKey
string
consumerSecret
string
scopes
ConnectedAppOauthAccessScope The scopes refer to permissions given by the user running the
(enumeration of type string)
connected app. When deploying metadata, valid values are:
AddressAllows access to the logged-in users street address
(the same behavior as deploying Basic).
ApiAllows access to the logged-in users account over the APIs.
BasicAllows access to your identity URL service (the same
behavior as deploying Address, Email, Phone, and
Profile).
ChatterAllows access to only the Chatter REST API resources.
CustomApplicationsProvides access to custom
applications, such as those using Visualforce.
CustomPermissionsAllows access to the custom
permissions in an organization associated with the connected app,
and shows whether the current user has each permission enabled.
EmailAllows access to the logged-in users email address (the
same behavior as deploying Basic).
FullAllows access to all data accessible by the logged-in user.
OfflineAccessAllows the app to interact with the users
data while the user is offline, and get a refresh token (the same
behavior as deploying RefreshToken).
174
Metadata Types
Field Name
ConnectedApp
Field Type
Description
OpenIDAllows access to the logged-in users unique identifier
for OpenID Connect apps.
PhoneAllows access to the logged-in users phone number
value (the same behavior as deploying Basic).
ProfileAllows access to the logged-in users profile (the
same behavior as deploying Basic).
RefreshTokenAllows a refresh token to be returned if youre
eligible to receive one (the same behavior as deploying
OfflineAccess).
WaveAllows access to the Wave REST API resources. Available
in API version 35.0 and later.
WebAllows the ability to use the access_token on the
Web. This also includes visualforce, allowing access to
Visualforce pages.
When retrieving metadata, valid values are:
ApiAllows access to the logged-in users account over the APIs.
BasicAllows access to the users identity URL service, and
includes Address, Email, Phone, and Profile.
ChatterAllows access to only the Chatter REST API resources.
CustomApplicationsAllows access to custom
applications, such as those using Visualforce.
FullAllows access to all data accessible by the logged-in user.
OpenIDAllows access to the logged in users unique identifier
for OpenID Connect apps.
RefreshTokenAllows a refresh token to be returned if you
are eligible to receive one, and is synonymous with allowing
OfflineAccess.
WaveAllows access to the Wave REST API resources. Available
in API version 35.0 and later.
WebAllows the ability to use the access_token on the
Web. This also includes visualforce, allowing access to
Visualforce pages.
ConnectedAppSamlConfig
Specifies how an app uses single sign-on.
Field Name
Field Type
Description
acsUrl
string
certificate
string
175
Metadata Types
ConnectedApp
Field Name
Field Type
Description
entityUrl
string
encryptionCertificate string
encryptionType
SamlEncryptionType
string
samlNameIdFormat SamlNameIdFormatType
A URI that sends the SAML response. It can be used by the service
provider to determine which identity provider sent the response.
Available in API version 29.0 and later.
Indicates the format the service provider (SP) requires for the users
single sign-on identifier. Available in API version 29.0 and later. Valid
values are:
UnspecifiedNo format given. This is the default.
EmailAddressUsed if the subject type is the users name
ora federation ID (an ID internal to the SP).
PersistentUsed with the user ID and persistent ID subject
types.
TransientUsed when the subject type is a custom attribute
and can change every time the user logs in.
samlSubjectCustomAttr string
samlSubjectType
SamlSubjectType (enumeration of The single sign-on identifier for the user. Valid values are:
type string)
UsernameThe users Salesforce name.
FederationIdThe users identifier at the service provider.
Get this value from the service provider.
UserIdThe users Salesforce identifier.
176
Metadata Types
Field Name
ConnectedApp
Field Type
Description
PersistentIDA persistent opaque identifier that is specific
to the identity provider and a service provider.
CustomAttrThe identifier is taken from a custom field value
in samlSubjectCustomAttr.
177
Metadata Types
CorsWhitelistOrigin
Usage
If you're constructing a SAML-enabled connected app using Metadata API, and need to set the IdP-Initiated Login URL for
your service provider, you have two options:
You can use the service provider app ID with the app parameter in the following format. This value is displayed in the Salesforce user
interface. From Setup, enter Connected Apps in the Quick Find box, then select Connected Apps, then click the name of the
connected app to see its detail page.
https://<Salesforce_base_URL>/idp/login?app=<app_id>
Or, if youre configuring the connected app using Metadata API only, you can use the apiName parameter of the service provider app
in the following format. The apiName parameter is the fullName inherited from the Metadata type.
https://<Salesforce_base_URL>/idp/login?apiName=<fullName>
CorsWhitelistOrigin
Represents an origin in the CORS whitelist.
Version
CorsWhitelistOrigin components are available in API version 32.0 and later.
Fields
Field Name
Field Type
Description
developerName
String
urlPattern
String
178
Metadata Types
CustomApplication
Usage
CORS (cross-origin resource sharing) is a W3C recommendation that enables Web browsers to request resources from origins other than
their own. For example, using CORS, a JavaScript script at https://www.example.com could request a resource from
https://www.salesforce.com.
If a browser that supports CORS makes a request to an origin in the Salesforce CORS whitelist, Salesforce returns the origin in the
Access-Control-Allow-Origin HTTP header, along with any additional CORS HTTP headers. If the origin is not whitelisted,
Salesforce returns HTTP status code 404.
CustomApplication
CustomApplication represents a custom or standard application. In API version 29.0 and earlier, CustomApplication represents only a
custom application. An application is a list of tab references, with a description and a logo. This type extends the Metadata metadata
type and inherits its fullName field.
Version
Custom applications are available in API version 10.0 and later. Standard applications are available in API version 30.0 and later.
179
Metadata Types
CustomApplication
Fields
Field Name
Field Type
Description
customApplicationComponents CustomApplicationComponents
defaultLandingTab
string
description
string
detailPageRefreshMethod string
domainWhitelist
DomainWhitelist
enableCustomizeMyTabs
boolean
enableKeyboardShortcuts boolean
enableMultiMonitorComponents boolean
180
Metadata Types
Field Name
CustomApplication
Field Type
Description
screens. This field is required if
isServiceCloudConsole is true.
boolean
enableTabHover
boolean
enableTabLimits
boolean
footerColor
string
headerColor
string
isServiceCloudConsole
boolean
keyboardShortcuts
KeyboardShortcuts
fullName
string
label
string
181
Metadata Types
CustomApplication
Field Name
Field Type
Description
listPlacement
ListPlacement
listRefreshMethod
string
liveAgentConfig
logo
string
primaryTabColor
string
pushNotifications
PushNotifications
saveUserSessions
boolean
tab
string
182
Metadata Types
CustomApplication
Field Name
Field Type
Description
tabLimitConfig
TabLimitConfig
workspaceMappings
WorkspaceMappings
CustomApplicationComponents
Represents custom console components (Visualforce pages) assigned to a Salesforce console app. Available in API version 25.0 and later.
Field Name
Field Type
Description
alignment
string
customApplicationComponent string
CustomShortcut
Represents custom keyboard shortcuts assigned to a Salesforce console app. Before you can create custom shortcuts, a developer must
define the shortcuts action with the addEventListener() method in the Salesforce Console Integration Toolkit. You cant create
keyboard shortcuts for actions performed outside of the console. Available in API version 28.0 and later.
Field Name
Field Type
Description
action
string
Required. The action performed in the console when a user presses the
keyboard shortcut.
active
boolean
keyCommand
string
183
Metadata Types
Field Name
CustomApplication
Field Type
Description
CTRL
ALT
META (represents the COMMAND key on Macs)
Valid non-modifier keys are letters A through Z and numbers 0 through
9. Other valid keys are:
TAB
ENTER
PAUSE/BREAK
CAPS LOCK
ESC
SPACE
PAGE UP
PAGE DOWN
END
HOME
LEFT ARROW
UP ARROW
RIGHT ARROW
DOWN ARROW
PRINT SCREEN
INSERT
DELETE
RIGHT WINDOW
NUMPAD 0
NUMPAD 1
NUMPAD 2
NUMPAD 3
NUMPAD 4
NUMPAD 5
NUMPAD 6
NUMPAD 7
NUMPAD 8
NUMPAD 9
MULTIPLY
ADD
SUBTRACT
DECIMAL POINT
DIVIDE
184
Metadata Types
Field Name
CustomApplication
Field Type
Description
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
NUM LOCK
SCROLL LOCK
;
=
,
.
/
[
]
\
'
description
string
eventName
string
DefaultShortcut
Represents default keyboard shortcuts assigned to a Salesforce console app. Once you enable keyboard shortcuts for a console, several
default shortcuts are available for customization, such as opening and closing tabs, moving between tabs, and saving records. Available
in API version 28.0 and later.
185
Metadata Types
CustomApplication
Field Name
Field Type
Description
action
string
Required. The action performed in the console when a user presses the
keyboard shortcut. Valid values are:
FOCUS_CONSOLE
FOCUS_NAVIGATOR_TAB
FOCUS_DETAIL_VIEW
FOCUS_PRIMARY_TAB_PANEL
FOCUS_SUBTAB_PANEL
FOCUS_LIST_VIEW
FOCUS_FIRST_LIST_VIEW
FOCUS_SEARCH_INPUT
MOVE_LEFT
MOVE_RIGHT
UP_ARROW
DOWN_ARROW
OPEN_TAB_SCROLLER_MENU
OPEN_TAB
CLOSE_TAB
ENTER
EDIT
SAVE
For a list and description of the default keyboard shortcuts, see Default
Keyboard Shortcuts for a Salesforce Console in the Salesforce online help.
active
boolean
keyCommand
string
186
Metadata Types
Field Name
CustomApplication
Field Type
Description
Valid non-modifier keys are letters A through Z and numbers 0 through
9. Other valid keys are:
TAB
ENTER
PAUSE/BREAK
CAPS LOCK
ESC
SPACE
PAGE UP
PAGE DOWN
END
HOME
LEFT ARROW
UP ARROW
RIGHT ARROW
DOWN ARROW
PRINT SCREEN
INSERT
DELETE
RIGHT WINDOW
NUMPAD 0
NUMPAD 1
NUMPAD 2
NUMPAD 3
NUMPAD 4
NUMPAD 5
NUMPAD 6
NUMPAD 7
NUMPAD 8
NUMPAD 9
MULTIPLY
ADD
SUBTRACT
DECIMAL POINT
DIVIDE
F1
F2
F3
187
Metadata Types
Field Name
CustomApplication
Field Type
Description
F4
F5
F6
F7
F8
F9
F10
F11
F12
NUM LOCK
SCROLL LOCK
;
=
,
.
/
[
]
\
'
DomainWhitelist
Represents any external domains that users can access from within a Salesforce console app. For example, www.yourdomain.com.
Available in API version 25.0 and later.
Field Name
Field Type
Description
domain
string
The external domains that users can access from within this Salesforce
console app.
KeyboardShortcuts
Represents keyboard shortcuts assigned to a Salesforce console app. Required if isServiceCloudConsole is true. Available
in API version 28.0 and later.
188
Metadata Types
CustomApplication
Field Name
Field Type
Description
customShortcut
KeyboardShortcuts[]
defaultShortcut
KeyboardShortcuts[]
ListPlacement
Represents how lists display in a Salesforce console app. Required if isServiceCloudConsole is true. Available in API version
25.0 and later.
Field Name
Field Type
Description
height
int
location
string
units
string
width
int
LiveAgentConfig
Represents your organizations settings for using Live Agent in the Salesforce Console.
Field Name
Field Type
Description
enableLiveChat
boolean
openNewAccountSubtab
boolean
openNewCaseSubtab
boolean
189
Metadata Types
CustomApplication
Field Name
Field Type
Description
openNewContactSubtab
boolean
openNewLeadSubtab
boolean
openNewVFPageSubtab
boolean
pagesToOpen
PagesToOpen on page Specifies the Visualforce pages to open in subtabs when an agent accepts
190
a chat in the Salesforce Console.
showKnowledgeArticles
boolean
PagesToOpen
Represents the Visualforce pages you want to open in subtabs when an agent accepts a chat request in the Salesforce Console. Available
in API version 28.0 and later.
Field Name
Field Type
Description
pagesToOpen
string
The name of the Visualforce pages you want to open in subtabs when
an agent accepts a chat in the Salesforce Console.
PushNotifications
Represents a set of push notifications, which are visual indicators on lists and detail pages that show when a record or field has changed
during a users session. Available for use if isServiceCloudConsole is true. Available in API version 28.0 and later.
Field Name
Field Type
Description
pushNotification
PushNotification[]
PushNotification
Represents if visual indicators on lists and detail pages display in a Salesforce console app when a record or field has changed during a
users session. Available for use if isServiceCloudConsole is true. Available in API version 28.0 and later.
Field Name
Field Type
Description
fieldNames
string
Required. The name of the field, or fields, that trigger push notifications
for the selected object.
objectName
string
190
Metadata Types
CustomApplication
TabLimitConfig
Represents the maximum number of primary tabs and subtabs allowed in one Salesforce console session. Required if
enableTabLimits is true. Available in API version 36.0 and later.
Field Name
Field Type
maxNumberOfPrimaryTabs string
Description
The maximum number of primary tabs allowed in one console session.
Valid values are:
5
10
20
30
maxNumberOfSubTabs
string
WorkspaceMappings
Represents how records open in a Salesforce console app. Required if isServiceCloudConsole is true. Available in API version
25.0 and later.
Field Name
Field Type
Description
mapping
WorkspaceMapping
WorkspaceMapping
Represents how records for a specific tab open in a Salesforce console app. Required for each tab specified in the CustomApplication.
Available in API version 25.0 and later.
Field Name
Field Type
Description
fieldName
string
The name of the field that specifies the primary tab in which to display
tab as a subtab. If not specified, tab opens as a primary tab.
tab
string
Retrieving Apps
To retrieve apps in your organization, use the CustomApplication type name in the package.xml manifest file. You can either retrieve
all apps or specify which apps to retrieve in the types section of package.xml.
191
Metadata Types
CustomApplication
To retrieve all apps in your organizationcustom and standard apps, specify the wildcard character (*), as follows.
<types>
<members>*</members>
<name>CustomApplication</name>
</types>
Note: In API version 29.0 and earlier, use of the wildcard returns only all custom applications but not standard applications.
To retrieve a custom app, specify the app name.
<types>
<members>MyCustomApp</members>
<name>CustomApplication</name>
</types>
To retrieve a standard app, add the standard__ prefix to the app name. For example, to retrieve the Chatter standard app, specify
standard__Chatter.
<types>
<members>standard__Chatter</members>
<name>CustomApplication</name>
</types>
To retrieve an app that is part of an installed package, add the package namespace prefix followed by two underscores and the app
name. For example, if the package namespace is myInstalledPackageNS and the app name is PackageApp, specify
myInstalledPackageNS__PackageApp, as follows.
<types>
<members>myInstalledPackageNS__PackageApp</members>
<name>CustomApplication</name>
</types>
192
Metadata Types
CustomApplication
<tab>standard-Chatter</tab>
<tab>standard-UserProfile</tab>
<tab>standard-OtherUserProfile</tab>
<tab>standard-CollaborationGroup</tab>
<tab>standard-File</tab>
</CustomApplication>
193
Metadata Types
CustomApplication
<action>FOCUS_LIST_VIEW</action>
<active>true</active>
<keyCommand>N</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>FOCUS_FIRST_LIST_VIEW</action>
<active>true</active>
<keyCommand>SHIFT+F</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>FOCUS_SEARCH_INPUT</action>
<active>true</active>
<keyCommand>R</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>MOVE_LEFT</action>
<active>true</active>
<keyCommand>LEFT ARROW</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>MOVE_RIGHT</action>
<active>true</active>
<keyCommand>RIGHT ARROW</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>UP_ARROW</action>
<active>true</active>
<keyCommand>UP ARROW</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>DOWN_ARROW</action>
<active>true</active>
<keyCommand>DOWN ARROW</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>OPEN_TAB_SCROLLER_MENU</action>
<active>true</active>
<keyCommand>D</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>OPEN_TAB</action>
<active>true</active>
<keyCommand>T</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>CLOSE_TAB</action>
<active>true</active>
<keyCommand>C</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>ENTER</action>
<active>true</active>
<keyCommand>ENTER</keyCommand>
</defaultShortcut>
194
Metadata Types
CustomApplication
<defaultShortcut>
<action>EDIT</action>
<active>true</active>
<keyCommand>E</keyCommand>
</defaultShortcut>
<defaultShortcut>
<action>SAVE</action>
<active>true</active>
<keyCommand>CTRL+S</keyCommand>
</defaultShortcut>
</keyboardShortcuts>
<label>MyConsole</label>
<listPlacement>
<location>left</location>
<units>percent</units>
<width>20</width>
</listPlacement>
<listRefreshMethod>refreshList</listRefreshMethod>
<pushNotifications>
<pushNotification>
<fieldNames>CreatedBy</fieldNames>
<objectName>Campaign</objectName>
</pushNotification>
<pushNotification>
<fieldNames>CustomField1__c</fieldNames>
<objectName>CustomObject1__c</objectName>
</pushNotification>
</pushNotifications>
<saveUserSessions>false</saveUserSessions>
<tab>standard-Case</tab>
<tab>standard-Account</tab>
<tab>standard-Contact</tab>
<tab>standard-Contract</tab>
<workspaceMappings>
<mapping>
<tab>standard-Case</tab>
</mapping>
<mapping>
<fieldName>AccountId</fieldName>
<tab>standard-Contract</tab>
</mapping>
<mapping>
<tab>standard-Contract</tab>
</mapping>
<mapping>
<fieldName>ParentId</fieldName>
<tab>standard-Account</tab>
</mapping>
</workspaceMappings>
</CustomApplication>
SEE ALSO:
CustomTab
195
Metadata Types
CustomApplicationComponent
CustomApplicationComponent
Represents a custom console component (Visualforce page) assigned to a CustomApplication that is marked as a Salesforce console.
Custom console components extend the capabilities of Salesforce console apps. See Console Components in the Salesforce online
help.
Version
Custom applications are available in API version 25.0 and later.
Fields
Field Name
Field Type
Description
buttonIconUrl
string
buttonStyle
string
buttonText
string
The label on the button used to launch the custom console component.
buttonWidth
int
height
int
The pixel height of the window used to display the custom console
component.
isHeightFixed
boolean
isHidden
boolean
isWidthFixed
boolean
visualforcePage
string
width
int
The pixel width of the window used to display the custom console
component.
196
Metadata Types
CustomFeedFilter
CustomFeedFilter
Represents a custom feed filter that limits the feed view to feeds from the Cases object. The custom feed filter shows only feed items
that satisfy the criteria specified in the CustomFeedFilter definition.This type extends the Metadata metadata type and inherits its
fullName field.
Version
CustomFeedFilter components are available in API version 35.0 and later.
Fields
Field Name
Field Type
Description
description
string
The description of the custom feed filter. For example, specify what feed
items that filter shows.
criteria
FeedFilterCriterion
[]
The criterion that defines which feed items are shown when the filter is
applied. The feed filter displays all feed items that satisfy the criteria.
label
string
FeedFilterCriterion
Represents the conditions that a feed item must satisfy to be displayed when a feed filter is applied.
197
Metadata Types
CustomFeedFilter
Field Name
Field Type
Description
feedItemType
FeedItemType (enumeration of type Required. The type of feed items that the filter shows.
string)
The feed item type can be one of the following values:
AttachArticleEvent
CallLogPost
CanvasPost
CaseCommentPost
ChangeStatusPost
ChatTranscriptPost
ContentPost
CreateRecordEvent
EmailMessageEvent
LinkPost
MilestoneEvent
QuestionPost
PollPost
ReplyPost
SocialPost
TextPost
feedItemVisibility
FeedItemVisibility (enumeration of
type string)
relatedSObjectType
string
The API name of the object that the feed item refers to.
This field is typically used with the CreateRecordEvent
feed item type.
For example, a feed filter can show CreateRecordEvent
feed items for the Cases object.
198
Metadata Types
CustomLabels
<relatedSObjectType>MyCO01__c</relatedSObjectType>
</criteria>
<criteria>
<feedItemType>CreateRecordEvent</feedItemType>
<relatedSObjectType>Case</relatedSObjectType>
</criteria>
<criteria>
<feedItemType>PollPost</feedItemType>
<feedItemVisibility>InternalUsers</feedItemVisibility>
</criteria>
<label>Sample Custom Feed Filter</label>
</CustomFeedFilter>
CustomLabels
This metadata type allows you to create custom labels that can be localized for use in different languages, countries, and currencies.
This type extends the Metadata metadata type and inherits its fullName field. Custom labels are custom text values, up to 1,000
characters in length, that can be accessed from Apex classes or Visualforce pages. For more information, see Custom Labels in the
Salesforce online help.
Version
CustomLabels components are available in API version 14.0 and later.
199
Metadata Types
CustomLabels
Fields
Field
Field Type
Description
fullName
string
labels
CustomLabel[]
CustomLabel
This metadata type represents a custom label. This type extends the Metadata metadata type and inherits its fullName field.
Field
Field Type
Description
categories
string
fullName
string
language
string
protected
boolean
shortDescription
string
value
string
Usage
Use CustomLabels with the wildcard character (*) for members in the package.xml manifest file to retrieve all custom labels that
are defined in your organization. CustomLabels doesnt support retrieving one or more custom labels by name. To retrieve specific labels
by name, use CustomLabel and specify the label names as members.
200
Metadata Types
This is a sample manifest file for retrieving all custom labels in the organization by using the CustomLabels type.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>MyPkg</fullName>
<types>
<members>*</members>
<name>CustomLabels</name>
</types>
<version>36.0</version>
</Package>
This is a sample manifest file for retrieving two custom labels by name. Notice it uses the CustomLabel singular type.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>MyPkg</fullName>
<types>
<members>quoteManual</members>
<members>quoteAuto</members>
<name>CustomLabel</name>
</types>
<version>36.0</version>
</Package>
SEE ALSO:
Translations
201
Metadata Types
For more information, see the Custom Metadata Types Implementation Guide.
Version
Custom metadata type components are available in API version 31.0 and later.
Fields
Custom metadata types can contain the following CustomObject fields.
To make the fields on your custom metadata types unique and indexable, mark your fields as Unique and ExternalId.
Field Name
Field Type
Description
description
string
fields
CustomField[]
gender
Gender
Protected
boolean
202
Metadata Types
Field Name
Field Type
Description
Code that the subscriber creates and code thats in an
unmanaged package cant read the protected records.
The developer can modify protected records only with
a package upgrade. The subscriber cant read or modify
protected records. The developer name of a protected
record cant be changed after release.
The subscriber cant create records of a protected type.
Records that are hidden by these access rules are also
unavailable to REST, SOAP, SOQL, and Setup.
label
string
pluralLabel
string
startsWith
visibility
SetupObjectVisibility (enumeration of type When this field is present, this component is not a custom
string)
object, but a custom setting or custom metadata type. This
field returns the visibility of the custom setting or custom
metadata type. The following values are valid.
PublicIf the custom setting or custom metadata
type is packaged, its accessible to all subscribing
organizations.
ProtectedIf the custom setting or custom
metadata type is in a managed package, its only
accessible to the developer organization; subscribing
organizations cant access it.
The default value is Public.
203
Metadata Types
CustomMetadata
<fields>
<fullName>AlphaSort__c</fullName>
<defaultValue>false</defaultValue>
<externalId>false</externalId>
<label>Sorted Alphabetically</label>
<type>Checkbox</type>
</fields>
<label>Reusable Picklist</label>
<pluralLabel>Reusable Picklist</pluralLabel>
<visibility>Public</visibility>
</CustomObject>
This excerpt from Picklists R Uss package.xml file shows the use of dot notation and the __mdt suffix. The CustomMetadata
and Picklists R Us namespaces arent shown here because these namespaces are common to all items in package.xml. If Picklists R
Us used the namespace picklist1234, the full name of ReusablePicklistOption__mdt would be picklist1234
__ReusablePicklistOption__mdt.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
...
<types>
<members>PicklistTest__c.PicklistTestField__c</members>
<members>ReusablePicklistOption__mdt.Picklist__c</members>
<members>ReusablePicklistOption__mdt.SortOrder__c</members>
<members>PicklistUsage__mdt.Field__c</members>
<members>PicklistUsage__mdt.Picklist__c</members>
<members>PicklistUsage__mdt.SObjectType__c</members>
<members>ReusablePicklist__mdt.AlphaSort__c</members>
<name>CustomField</name>
</types>
...
<types>
<members>PicklistTest__c</members>
<members>ReusablePicklistOption__mdt</members>
<members>PicklistUsage__mdt</members>
<members>ReusablePicklist__mdt</members>
<name>CustomObject</name>
</types>
...
<version>36.0</version>
</Package>
CustomMetadata
Represents a record of a custom metadata type.
This type extends the Metadata metadata type and inherits its fullName field.
204
Metadata Types
CustomMetadata
Version
CustomMetadata components are available in API version 31.0 and later.
Fields
Field Name
Field Type
Description
description
string
label
string
values
CustomMetadataValue[]
CustomMetadataValue
Represents a value for a custom field on the custom metadata record.
Field Name
Field Type
Description
field
string
value
Any type
205
Metadata Types
CustomMetadata
Assuming Picklists R Uss namespace is picklist1234, to define the Planets picklist, TravelApp deploys a file in the
customMetadata folder, named picklist1234__ReusablePicklist.Planets.md, with these contents. The
xsi:type attribute specifies the type for the value of the AlphaSort__c checkbox field.
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<description>All the planets in the solar system. Does not
include asteroids.</description>
<label>Planets</label>
<values>
<field>picklist1234__AlphaSort__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
</CustomMetadata>
Picklists R Us creates its Reusable Picklist Option custom metadata type by deploying a file in the objects folder, named
ReusablePicklist__mdt.object, with these contents.
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<fields>
<fullName>Picklist__c</fullName>
<externalId>false</externalId>
<label>Picklist</label>
<length>40</length>
<required>true</required>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>SortOrder__c</fullName>
<externalId>false</externalId>
<label>Non-Alphabetical Sort Order</label>
<precision>3</precision>
<scale>0</scale>
<required>false</required>
<type>Number</type>
<unique>false</unique>
</fields>
<label>Reusable Picklist Option</label>
<pluralLabel>Reusable Picklist Options</pluralLabel>
</CustomObject>
To define the Mars picklist item, TravelApp deploys a file, named picklist1234__ReusablePicklistOption.Mars.md,
with these contents. This component file specifies types that apply to the ReusablePicklistOption__mdt custom fields.
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<label>Mars</label>
<values>
<field>picklist1234__Picklist__c</field>
206
Metadata Types
CustomMetadata
<value xsi:type="xsd:string">Planets</value>
</values>
<values>
<field>picklist1234__SortOrder__c</field>
<value xsi:type="xsd:int">4</value>
</values>
</CustomMetadata>
Because the SortOrder__c field isnt required, this file doesnt require a value for SortOrder__c. Alternatively, the file could
have explicitly specified a value with xsi:nil to ensure that SortOrder__c was cleared of any previous value.
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<label>Motel 6</label>
<values>
<field>picklist1234__Picklist__c</field>
<value xsi:type="xsd:string">Hotels</value>
</values>
<values>
<field>picklist1234__SortOrder__c</field>
<value xsi:nil="true" />
</values>
</CustomMetadata>
This excerpt from a package.xml file illustrates the inclusion of custom metadata types and their namespaces in custom metadata
records names. Assume that Picklists R Uss namespace is picklist1234.
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>picklist1234__ReusablePicklist.Hotels</members>
<members>picklist1234__ReusablePicklist.Planets</members>
<members>picklist1234__ReusablePicklistOption.Bellagio</members>
<members>picklist1234__ReusablePicklistOption.Motel6</members>
<members>picklist1234__ReusablePicklistOption.Mercury</members>
<members>picklist1234__ReusablePicklistOption.Venus</members>
<members>picklist1234__ReusablePicklistOption.Earth</members>
<members>picklist1234__PicklistUsage.BookedHotel</members>
207
Metadata Types
CustomMetadata
<members>
picklist1234__PicklistUsage.DestinationPlanetPL
</members>
<members>picklist1234__PicklistUsage.PlanetVisitedPl</members>
<name>CustomMetadata</name>
</types>
</package>
TravelApp, Inc.s package.xml file uses a wildcard to install custom metadata, as is shown in this excerpt from their package.xml
file. Unless you want to deploy or retrieve specific records, using a wildcard is easier than listing all of your custom metadata records in
your package.xml file.
<types>
<members>*</members>
<name>CustomMetadata</name>
</types>
If the custom metadata is from a managed package, the name after the dot in the package.xml filebetween the two dots in the
file nameis qualified by the managed packages namespace. For example, assuming TravelApp uses the namespace travelApp1234,
the first member element in the TravelApp package.xml file appears to Galactic Tours as:
<members>picklist1234__ReusablePicklist.travelApp1234__Hotels</members>
Usage
When specifying the value field in the CustomMetadataValue subtype, specify an appropriately typed object thats based on your
field type definition. In declarative metadata definitions for CustomMetadataValue, use the xsi:type attribute of the value element.
For example, to specify a boolean value: <value xsi:type="xsd:boolean">true</value>. Valid xsi:type attributes
are:
Custom metadata value
xsi:type="xsd:boolean"
Checkbox
xsi:type="xsd:date"
Date
xsi:type="xsd:dateTime"
Date/Time
xsi:type="xsd:picklist"
Picklist
xsi:type="xsd:string"
Text
xsi:type="xsd:string"
Phone
xsi:type="xsd:string"
TextArea
xsi:type="xsd:string"
URL
xsi:type="xsd:string"
xsi:type="xsd:int"
xsi:type="xsd:double"
208
Metadata Types
CustomObject
You can also omit the xsi:type attribute. For example, <value>true</value>.
Although this attribute must be specified for any CustomMetadataValue, you can use an element with the xsi:nil attribute set to
true to explicitly set the fields value to null. For example, <value xsi:nil="true"/>.
Using null field values differs from leaving out the CustomMetadataValue for a particular field entirely. If you leave out the
CustomMetadataValue, the value of the field doesnt change. The fields value is null for newly deployed custom metadata records
and left at its previous value for updated custom metadata records.
When you retrieve CustomMetadataValue objects, the value field of the returned object holds a value of the correct type, specified
by xsi:type in the case of declarative metadata definitions.
CustomObject
Represents a custom object that stores data unique to your organization or an external object that maps to data stored outside Salesforce.
This type extends the Metadata metadata type and inherits its fullName field. You must specify all relevant fields when you create
or update a custom object. You cannot update a single field on the object. For more information about custom objects, see Custom
Object Record Overview in the Salesforce online help.
You can also use this metadata type to work with customizations of standard objects, such as accounts. For an example, see Standard
Objects on page 16.
All metadata components have a fullName field, which must be fully specified for any custom object.
For example, the following are fully specified names for a standard object and a custom object respectively:
Account
MyCustomObject__c
For sample Java code that creates a custom object, see Step 3: Walk Through the Java Sample Code on page 6.
Version
Custom objects are available in API version 10.0 and later. External objects are available in API version 32.0 and later.
Fields
Unless otherwise noted, all fields are createable, filterable, and nillable.
209
Metadata Types
CustomObject
Field Name
Field Type
Description
actionOverrides
ActionOverride[]
allowInChatterGroups
boolean
businessProcesses
BusinessProcess[]
compactLayoutAssignment
string
compactLayouts
CompactLayout[]
customHelp
string
The s-control that contains the help content if the object has
customized help content. This field is available in API version
14.0 and later.
customHelpPage
string
customSettingsType
CustomSettingsType
(enumeration of type string)
customSettingsVisibility
CustomSettingsVisibility
(enumeration of type string)
210
Metadata Types
Field Name
CustomObject
Field Type
Description
This field is available in API versions 17.0 through 33.0. In
versions 34.0 and later, use the visibility field instead
of this field.
deploymentStatus
DeploymentStatus
(enumeration of type string)
deprecated
boolean
description
string
enableActivities
boolean
enableBulkApi
boolean
enableDivisions
boolean
enableEnhancedLookup
boolean
enableFeeds
boolean
enableHistory
boolean
enableReports
boolean
enableSearch
boolean
211
Metadata Types
Field Name
CustomObject
Field Type
Description
This field is available in API version 35.0 and later.
enableSharing
boolean
enableStreamingApi
boolean
externalDataSource
string
externalName
string
externalRepository
string
externalSharingModel
SharingModel(enumeration
of type string)
212
Metadata Types
Field Name
CustomObject
Field Type
Description
Contacts
Opportunities
Custom Objects
Users
This field is available in API version 31.0 and later.
fields
CustomField[]
fieldSets
FieldSet
fullName
string
gender
Gender
household
boolean
historyRetentionPolicy
HistoryRetentionPolicy
label
string
listViews
ListView[]
namedFilter
NamedFilter[]
nameField
CustomField
213
Metadata Types
Field Name
CustomObject
Field Type
Description
key lists on tab home pages. By default, this field is added to
the custom object page layout as a required field.
pluralLabel
string
recordTypes
RecordType[]
recordTypeTrackFeedHistory boolean
recordTypeTrackHistory
boolean
searchLayouts
SearchLayouts
sharingModel
SharingModel(enumeration
of type string)
sharingReasons
SharingReason[]
sharingRecalculations
SharingRecalculation[]
startsWith
StartsWith (enumeration of
type string)
validationRules
ValidationRule[]
visibility
SetupObjectVisibility
(enumeration of type string)
214
Metadata Types
Field Name
CustomObject
Field Type
Description
PublicIf the custom setting or custom metadata
type is packaged, its accessible to all subscribing
organizations.
ProtectedIf the custom setting or custom metadata
type is in a managed package, its only accessible to the
developer organization; subscribing organizations cant
access it.
The default value is Public.
This field is available in API version 34.0 and later. For custom
settings, this field replaces the
customSettingsVisibility field.
webLinks
WebLink[]
215
Metadata Types
CustomObject
<label>Comments</label>
<length>32000</length>
<type>LongTextArea</type>
<visibleLines>30</visibleLines>
</fields>
<label>MyFirstObject</label>
<nameField>
<label>MyFirstObject Name</label>
<type>Text</type>
</nameField>
<pluralLabel>MyFirstObjects</pluralLabel>
<sharingModel>ReadWrite</sharingModel>
</CustomObject>
The following is the metadata definition of an external object for Lightning Connect.
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>CancelEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Delete</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Edit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Follow</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>List</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>New</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>SaveEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Tab</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<type>Default</type>
</actionOverrides>
216
Metadata Types
CustomObject
<deploymentStatus>InDevelopment</deploymentStatus>
<description>Products</description>
<enableFeeds>false</enableFeeds>
<externalDataSource>OData</externalDataSource>
<externalIndexAvailable>false</externalIndexAvailable>
<externalName>Products</externalName>
<fields>
<fullName>DiscontinuedDate__c</fullName>
<description>DiscontinuedDate</description>
<externalDeveloperName>DiscontinuedDate</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>DiscontinuedDate</label>
<required>false</required>
<type>DateTime</type>
</fields>
<fields>
<fullName>ID__c</fullName>
<description>ID</description>
<externalDeveloperName>ID</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>ID</label>
<precision>18</precision>
<required>false</required>
<scale>0</scale>
<type>Number</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Name__c</fullName>
<description>Name</description>
<externalDeveloperName>Name</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>Name</label>
<length>128</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Price__c</fullName>
<description>Price</description>
<externalDeveloperName>Price</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
217
Metadata Types
CustomObject
<isSortingDisabled>false</isSortingDisabled>
<label>Price</label>
<precision>16</precision>
<required>false</required>
<scale>2</scale>
<type>Number</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Products__c</fullName>
<externalDeveloperName>Products</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>Products</label>
<length>20</length>
<referenceTo>Products__x</referenceTo>
<relationshipLabel>Products</relationshipLabel>
<relationshipName>Products</relationshipName>
<type>ExternalLookup</type>
</fields>
<fields>
<fullName>Rating__c</fullName>
<description>Rating</description>
<externalDeveloperName>Rating</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>Rating</label>
<precision>18</precision>
<required>false</required>
<scale>0</scale>
<type>Number</type>
<unique>false</unique>
</fields>
<fields>
<fullName>ReleaseDate__c</fullName>
<description>ReleaseDate</description>
<externalDeveloperName>ReleaseDate</externalDeveloperName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>ReleaseDate</label>
<required>false</required>
<type>DateTime</type>
</fields>
<label>Products</label>
<pluralLabel>Products</pluralLabel>
<searchLayouts>
<customTabListAdditionalFields>ExternalId</customTabListAdditionalFields>
<lookupDialogsAdditionalFields>ExternalId</lookupDialogsAdditionalFields>
218
Metadata Types
ActionOverride
<lookupPhoneDialogsAdditionalFields>ExternalId</lookupPhoneDialogsAdditionalFields>
<searchResultsAdditionalFields>ExternalId</searchResultsAdditionalFields>
<searchResultsAdditionalFields>DisplayUrl</searchResultsAdditionalFields>
<searchResultsAdditionalFields>ID__c</searchResultsAdditionalFields>
</searchLayouts>
</CustomObject>
SEE ALSO:
CustomField
Metadata
Picklist (Including Dependent Picklist)
SearchLayouts
WebLink
CustomObjectTranslation
ListView
CompactLayout
ActionOverride
Represents an action override on a standard or custom object. Use it to create, update, edit, or delete action overrides. You can only
access ActionOverride by accessing its encompassing CustomObject.
Version
Action overrides are available in API version 18.0 and later. Beginning in Summer 13, action overrides can be applied to both standard
or custom objects. Previously, action overrides only applied to custom objects.
Fields
Unless otherwise noted, all fields are createable, filterable, and nillable.
Field Name
Field Type
Description
actionName
string
Required. The possible values are the same as the actions you can override:
accept
clone
delete
edit
list
new
219
Metadata Types
Field Name
ActionOverride
Field Type
Description
tab
view
comment
string
content
string
formFactor
FormFactor (enumeration of
type string)
skipRecordTypeSelect boolean
type
ActionOverrideType
(enumeration of type string)
Set this field to true if you prefer that any new records created by this
action override arent forwarded to the record type selection page. This
field is only valid if the actionName is a create type (like new), and
type is set to visualforce. This field is available in API version 21.0
and later.
Required. Represents the type of action override. Valid values are described
in ActionOverrideType.
ActionOverrideType
ActionOverrideType is an enumeration of type string that defines which kind of action override to use. The valid values are:
defaultThe override uses a custom override provided by an installed package. If there isnt one available, the standard Salesforce
behavior is used.
flexipageThe override uses behavior from a Lightning Page, and is only valid for use on the View standard button in Lightning
Experience.
scontrolThe override uses behavior from an s-control.
220
Metadata Types
BusinessProcess
If a subscriber installed a package with the previous metadata, you can override the behavior by editing the XML. For example, if you
want the regular Salesforce behavior, use:
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>edit</actionName>
<type>standard</type>
</actionOverrides>
</CustomObject>
To set a Lightning Page action override on the View standard button in Lightning Experience, use:
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>View</actionName>
<content>myLightningPage</content>
<formFactor>Large</formFactor>
<type>flexipage</type>
</actionOverrides>
</CustomObject>
SEE ALSO:
CustomObject
BusinessProcess
The BusinessProcess metadata type enables you to display different picklist values for users based on their profile. This type extends the
Metadata metadata type and inherits its fullName field.
221
Metadata Types
BusinessProcess
Multiple business processes allow you to track separate sales, support, and lead lifecycles. A sales, support, lead, or solution process is
assigned to a record type. The record type determines the user profiles that are associated with the business process. For more information,
see Managing Multiple Business Processes in the Salesforce online help.
Version
BusinessProcess components are available in API version 17.0 and later.
Fields
Field
Field Type
Description
description
string
fullName
string
isActive
boolean
namespacePrefix
string
values
PicklistValue[]
222
Metadata Types
CompactLayout
</values>
<values>
<fullName>CustomLeadStep2</fullName>
<default>false</default>
</values>
<values>
<fullName>Open - Not Contacted</fullName>
<default>false</default>
</values>
<values>
<fullName>Working - Contacted</fullName>
<default>true</default>
</values>
</businessProcesses>
....
</CustomObject>
SEE ALSO:
CustomObject
CompactLayout
Represents the metadata associated with a compact layout. This type extends the Metadata metadata type and inherits its fullName
field.
Compact layouts are used in Salesforce1 and Lightning Experience to display a records key fields at a glance.
Compact layouts support all field types except:
text area
long text area
rich text area
multi-select picklist
For more information on compact layouts, see Compact Layouts in the Salesforce Help.
Version
CompactLayout components are available in API version 29.0 and later.
Fields
Field Name
Field Type
Description
fields
string
The fields assigned to the compact layout. Their order represents the
prioritization given to them when defining the compact layout.
223
Metadata Types
CompactLayout
Field Name
Field Type
Description
label
string
Label that represents the object throughout the Salesforce user interface.
224
Metadata Types
CustomField
<fullName>textfield__c</fullName>
<externalId>false</externalId>
<label>textfield</label>
<length>255</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
</fields>
<label>customObj</label>
<nameField>
<label>customObj Name</label>
<type>Text</type>
</nameField>
<pluralLabel>customObjs</pluralLabel>
<recordTypes>
<fullName>RT1</fullName>
<active>true</active>
<label>RT1</label>
<compactLayoutAssignment>testCompactLayout</compactLayoutAssignment>
</recordTypes>
<recordTypes>
<fullName>RT2</fullName>
<active>true</active>
<label>RT2</label>
</recordTypes>
<searchLayouts/>
<sharingModel>ReadWrite</sharingModel>
</CustomObject>
CustomField
Represents the metadata associated with a field. Use this metadata type to create, update, or delete custom field definitions on standard,
custom, and external objects or standard field definitions on standard objects. This type extends the Metadata metadata type and inherits
its fullName field.
Only standard fields that you can customize are supported, that is, standard fields to which you can add help text or enable history
tracking or Chatter feed tracking. Other standard fields aren't supported, including system fields (such as CreatedById or
LastModifiedDate) and autonumber fields. All standard picklist fields are supported except for Lead.CampaignMemberStatus,
Opportunity.ForecastCategoryName, and Order.Status.
Specify the full name whenever you create or update a field. For example, a custom field on a custom object:
MyCustomObject__c.MyCustomField__c
225
Metadata Types
CustomField
Note: In the Metadata API, external objects are represented by the CustomObject metadata type.
The following custom field types arent available for external objects.
Auto-number
Currency
Formula
Geolocation
Master-detail relationship
Picklist
Picklist (multi-select)
Roll-up summary
Text (encrypted)
Text Area (rich)
Version
Custom and standard fields are available in API version 10.0 and later.
Fields
Unless otherwise noted, all fields are createable, filterable, and nillable.
226
Metadata Types
CustomField
Field Name
Field Type
Description
caseSensitive
boolean
string
defaultValue
string
deleteConstraint
DeleteConstraint (enumeration Provides deletion options for lookup relationships. Valid values are:
of type string)
SetNull
This is the default. If the lookup record is deleted, the lookup
field is cleared.
Restrict
boolean
description
string
displayFormat
string
displayLocationInDecimal boolean
encrypted
boolean
externalDeveloperName string
externalId
boolean
fieldManageability
string
227
Metadata Types
Field Name
CustomField
Field Type
Description
DeveloperControlledThe creator of the record can update
the field with a package upgrade.
SubscriberControlledAnyone with proper permissions can
update the field. The field cant be updated with a package
upgrade.
Available only for fields on custom metadata types.
formula
string
formulaTreatBlankAs
TreatBlanksAs (enumeration of
type string)
fullName
string
Inherited from Metadata, this field is not defined in the WSDL for
this metadata type. It must be specified when creating, updating,
or deleting. See create() to see an example of this field
specified for a call.
This value cannot be null.
indexed
boolean
inlineHelpText
string
isFilteringDisabled
boolean
isNameField
boolean
Available only for external object fields of type text. For each
external object, you can specify one field as the name field. If you
set this to true, make sure that the external table column
identified by the externalDeveloperName attribute
contains name values. This field is available in API version 32.0 and
later.
isSortingDisabled
boolean
reparentableMasterDetail boolean
label
string
Label for the field. You cannot update the label for standard picklist
fields, such as the Industry field for accounts.
length
int
228
Metadata Types
CustomField
Field Name
Field Type
Description
lookupFilter
LookupFilter
maskChar
EncryptedFieldMaskChar
(enumeration of type string)
maskType
EncryptedFieldMaskType
(enumeration of type string)
picklist
Picklist
populateExistingRows boolean
precision
int
referenceTargetField string
referenceTo
string
relationshipLabel
string
relationshipName
string
relationshipOrder
int
This field is valid for all master-detail relationships, but the value is
only non-zero for junction objects. A junction object has two
master-detail relationships, and is analogous to an association table
229
Metadata Types
Field Name
CustomField
Field Type
Description
in a many-to-many relationship. Junction objects must define one
parent object as primary (0), the other as secondary (1). The
definition of primary or secondary affects delete behavior and
inheritance of look and feel, and record ownership for junction
objects. For more information, see the Salesforce Help.
0 or 1 are the only valid values, and 0 is always the value for objects
that are not junction objects.
required
boolean
scale
int
The scale for the field. Scale is the number of digits to the right of
the decimal point in a number. For example, the number 256.99
has a scale of 2.
startingNumber
int
If specified, indicates the starting number for the field. When you
create records, Starting Numbers value increments to store
the number that will be assigned to the next auto-number field
created.
Note:
You cant retrieve the starting number of an
auto-number field through Metadata API. To specify a
Starting Number while deploying, add a
startingNumber tag for your field to your
package.xml file. For example:
<startingNumber>42</startingNumber>
boolean
summarizedField
string
summaryFilterItems
FilterItem[]
summaryForeignKey
string
summaryOperation
SummaryOperations
(enumeration of type string)
230
Metadata Types
CustomField
Field Name
Field Type
Description
trackFeedHistory
boolean
trackHistory
boolean
trackTrending
boolean
trueValueIndexed
boolean
This is only relevant for a checkbox field. If set, true values are built
into the index. This field has been deprecated as of API version 14.0
and is only provided for backward compatibility.
type
FieldType
Indicates the field type for the field. Valid values are enumerated
in FieldType.
For standard fields on standard objects, the type field is optional.
This field is included for some standard field types, such as Picklist
or Lookup, but not for others. The type field is included for
custom fields.
unique
boolean
visibleLines
int
writeRequiresMasterRead boolean
231
Metadata Types
Field Name
CustomField
Field Type
Description
falseAllows users with Read/Write access to the master
record permission to create, edit, or delete child records. This
setting is more restrictive than true, and is the default value.
For junction objects, the most restrictive access from the two
parents is enforced. For example, if you set to true on both
master-detail fields, but users have Read access to one master
record and Read/Write access to the other master record, users
won't be able to create, edit, or delete child records.
Fields use additional data types. For more information, see Metadata Field Types on page 261.
EncryptedFieldMaskChar
This field type is used in maskChar. It is a string with two valid values: asterisk or X. For more information on encrypted fields,
see Classic Encryption for Custom Fields in the Salesforce online help.
EncryptedFieldMaskType
This field type is used in maskType. Valid values are:
all
All characters in the field are hidden. This option is equivalent to the Mask All Characters option in Salesforce.
creditCard
The first 12 characters are hidden and the last four display. This option is equivalent to the Credit Card Number option in
Salesforce.
ssn
The first five characters are hidden and the last four display. This option is equivalent to the Social Security Number
option in Salesforce.
lastFour
All characters are hidden but the last four display. This option is equivalent to the Last Four Characters Clear option
in Salesforce.
sin
All characters are hidden but the last four display. This option is equivalent to the Social Insurance Number option in
Salesforce.
nino
All characters are hidden. Salesforce automatically inserts spaces after each pair of characters if the field contains nine characters.
This option is equivalent to the National Insurance Number option in Salesforce.
For more information on encrypted fields, see Classic Encryption for Custom Fields in the Salesforce online help.
LookupFilter
Represents the metadata associated with a lookup filter. Replaces the NamedFilter component, which was removed as of API version
30.0. LookupFilter is available in API version 30.0 and later.
232
Metadata Types
CustomField
Field
Field Type
Description
active
boolean
booleanFilter
string
description
string
errorMessage
string
filterItems
FilterItem[]
infoMessage
string
isOptional
boolean
Lookup filters use additional data types. For more information, see Metadata Field Types.
FilterItem
Represents one entry in a set of filter criteria.
Field
Field Type
Description
field
string
operation
FilterOperation
(enumeration of
type string)
Represents the filter operation for this filter item. Valid values are
enumerated in FilterOperation.
value
string
Represents the value of the filter item being operated upon, for
example, if the filter is my_number_field__c > 1, the value
of value is 1.
valueField
string
Specifies if the final column in the filter contains a field or a field value.
Approval processes don't support valueField entries in filter
criteria.
FilterOperation
This is an enumeration of type string that lists different filter operations. Valid values are:
equals
notEqual
lessThan
greaterThan
233
Metadata Types
CustomField
lessOrEqual
greaterOrEqual
contains
notContain
startsWith
includes
excludes
within (DISTANCE criteria only)
SummaryOperations
Represents the type of a summaryOperation. Valid values are:
Count
Min
Max
Sum
The following is the definition for two fields on the Account standard objecta custom field (MyCustomAccountField__c), and
a standard field (Phone) that has history tracking enabled.
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<fields>
<fullName>MyCustomAccountField__c</fullName>
<description>A custom field on the Account standard object.</description>
<externalId>false</externalId>
<inlineHelpText>Some help text.</inlineHelpText>
<label>MyCustomAccountField</label>
<length>100</length>
<required>false</required>
<trackFeedHistory>false</trackFeedHistory>
234
Metadata Types
FieldSet
<trackHistory>false</trackHistory>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Phone</fullName>
<trackFeedHistory>false</trackFeedHistory>
<trackHistory>true</trackHistory>
</fields>
</CustomObject>
SEE ALSO:
CustomObject
Picklist (Including Dependent Picklist)
Metadata
NamedFilter
FieldSet
Represents a field set. A field set is a grouping of fields. For example, you could have a field set that contains fields describing a user's
first name, middle name, last name, and business title. Field sets can be referenced on Visualforce pages dynamically. If the page is added
to a managed package, administrators can add, remove, or reorder fields in a field set to modify the fields presented on the Visualforce
page without modifying any code.
Version
FieldSet components are available in API version 21.0 and later.
Fields
Field
Field Type
Description
availableFields
FieldSetItem[]
description
string
displayedFields
FieldSetItem[]
label
string
FieldSetItem
FieldSetItem represents an individual field in a field set.
235
Metadata Types
HistoryRetentionPolicy
Field
Field Type
Description
field
string
isFieldManaged
boolean
Read-only. Denotes whether the field was added to the field set
via a managed or unmanaged package.
isRequired
boolean
HistoryRetentionPolicy
Represents the policy for retaining field history data. By setting a policy, you can specify the number of months you want to maintain
field history in Salesforce, and the number of years that you want to retain field history in the archive.
This component is only available to users with the RetainFieldHistory permission.
Version
Available in API version 31.0 and later.
236
Metadata Types
ListView
Fields
Field Name
Field Type
Description
archiveAfterMonths int
Required. The number of months that you want to keep field history data
in Salesforce before archiving. You can set a minimum of 1 month and a
maximum of 18 months. If you dont set a number, the default is 18
months. (That is, Salesforce maintains data for 18 months before
archiving.)
archiveRetentionYears int
Required. The number of years that you want to retain data in the archive.
You can set a minimum of zero years, and a maximum of 10 years. If no
number is set, the default is 10 years.
description
string
gracePeriodDays
int
ListView
ListView allows you to see a filtered list of records, such as contacts, accounts, or custom objects. This type extends the Metadata metadata
type and inherits its fullName field. See Create Custom List Views in Salesforce Classic in the Salesforce online help.
Note: List views with the Visible only to me Restrict Visibility option are not accessible in Metadata API. Each of
these list views is associated with a particular user.
237
Metadata Types
ListView
Version
ListView components for custom objects are available in API version 14.0 and later. ListView components for standard objects, such as
accounts, are available in API version 17.0 and later.
Fields
Field
Field Type
Description
booleanFilter
string
columns
string[]
The list of fields in the list view. The field name relative to the
object name, for example MyCustomField__c, is specified
for each custom field.
Note: Field names in the ListView columns dont always
match their API name counterparts. In particular, if person
accounts is enabled in your organization, standard fields
merged from a contact into an account start with the
PC_ prefix, while the corresponding API name starts
with the Person prefix. For example, the ListView
column name is PC_Email for a corresponding API
field name of PersonEmail.
division
string
filterScope
FilterScope (enumeration of
type string)
filters
ListViewFilter[]
fullName
string
238
Metadata Types
ListView
Field
Field Type
Description
label
string
language
Language
queue
string
sharedTo
SharedTo
ListViewFilter
ListViewFilter represents a filter line item.
Field
Field Type
Description
filter
string
operation
FilterOperation (enumeration of Required. The operation used by the filter, such as equals.
type string)
The valid values are listed in FilterOperation.
value
string
Represents the value of the filter item being operated upon, for
example, if the filter is my_number_field__c > 1, the
value of value is 1.
FilterScope
This is an enumeration of type string that represents the filtering criteria for the records. The valid values are listed in the table below:
Enumeration Value
Description
Everything
Mine
Records owned by the user running the list view, for example My Opportunities.
Queue
Delegated
Records delegated to another user for action: for example, a delegated task. This option is
available in API version 17.0 and later.
239
Metadata Types
ListView
Enumeration Value
Description
MyTerritory
Records in the territory of the user seeing the list view. This option is available if territory
management is enabled for your organization. This option is available in API version 17.0 and
later.
MyTeamTerritory
Records in the territory of the team of the user seeing the list view. This option is available if
territory management is enabled for your organization. This option is available in API version
17.0 and later.
Team
Records assigned to a team. This option is available in API version 17.0 and later.
SEE ALSO:
CustomObject
Sample package.xml Manifest Files
240
Metadata Types
NamedFilter
NamedFilter
Note: This component has been removed as of API version 30.0 and is only available in previous API versions. The metadata
associated with a lookup filter is now represented by the lookupFilter field in the CustomField component.
Represents the metadata associated with a lookup filter. Use this metadata type to create, update, or delete lookup filter definitions. This
type extends the Metadata metadata type and inherits its fullName field. You can also use this metadata type to work with
customizations of lookup filters on standard fields.
Note: The namedFilter appears as a child of the target object of the associated lookup field.
Version
Lookup filters are available in API version 17.0 and later.
Fields
Unless otherwise noted, all fields are createable, filterable, and nillable.
Field Name
Field Type
Description
active
boolean
booleanFilter
string
description
string
errorMessage
string
field
string
filterItems
FilterItems[]
infoMessage
string
fullName
string
241
Metadata Types
Field Name
NamedFilter
Field Type
Description
updating, or deleting. See create() to see an example of
this field specified for a call.
This value cannot be null.
isOptional
boolean
name
string
Required. The name of the lookup filter. If you create this field
in the user interface, a name is automatically assigned. If you
create this field through Metadata API, you must include the
name field.
sourceObject
string
The object that contains the lookup field that uses this lookup
filter. Set this field if the lookup filter references fields on the
source object.
Lookup filters use additional data types. For more information, see Metadata Field Types.
FilterItems
FilterItems contains the following properties:
Field
Field Type
Description
field
string
operation
FilterOperation
(enumeration of
type string)
Represents the filter operation for this filter item. Valid values are
enumerated in FilterOperation.
value
string
Represents the value of the filter item being operated upon, for
example, if the filter is my_number_field__c > 1, the value
of value is 1.
FilterOperation
This is an enumeration of type string that lists different filter operations. Valid values are:
equals
notEqual
lessThan
greaterThan
lessOrEqual
greaterOrEqual
contains
notContain
startsWith
242
Metadata Types
includes
excludes
SEE ALSO:
CustomObject
Picklist (Including Dependent Picklist)
Metadata
CustomField
Version
Picklists for custom fields in custom objects are available in API version 12.0 and later. Picklists for custom or standard fields in standard
objects, such as accounts, are available in API version 16.0 and later.
243
Metadata Types
Fields
Picklist contains the following fields:
Field Name
Field Type
Description
controllingField
string
picklistValues
PicklistValue[]
sorted
boolean
PicklistValue
This metadata type defines a value in the picklist and specifies whether this value is the default value. This type extends the Metadata
metadata type and inherits its fullName field. Note the following when working with picklist values:
When you retrieve a standard object, all picklist values are retrieved, not just the customized picklist values.
When you deploy changes to standard picklist fields, picklist values are added as needed.
You cant set a picklist value as inactive, but if the picklist value is missing and you invoke an update() call, the missing value
becomes inactive.
Starting with API version 27.0, if picklist values are missing from a component definition, they get deleted from Salesforce when
deployed. The deletion occurs for picklist values of standard and custom fields.
Field Name
Field Type
Description
allowEmail
boolean
Indicates whether this value lets users email a quote PDF (true), or not
(false). This field is only relevant for the Status field in quotes. This
field is available in API version 18.0 and later.
closed
boolean
color
string
Indicates the color assigned to the picklist value when used in charts on
reports and dashboards. The color is in hexadecimal format; for example
#FF6600. If a color is not specified, it will be assigned dynamically on
chart generation. This field is available in API version 17.0 and later.
controllingFieldValues
string[]
A list of values in the controlling field that are linked to this picklist value.
The controlling field can be a checkbox or a picklist. This field is available
in API version 14.0 and later. The values in the list depend on the field
type:
Checkbox: checked or unchecked.
Picklist: The fullName of the picklist value in the controlling
field.
244
Metadata Types
Field Name
Field Type
Description
converted
boolean
cssExposed
boolean
default
boolean
Required. Indicates whether this value is the default picklist value in the
specified picklist (true), or not (false).
description
string
Description of a custom picklist value. This field is only relevant for the
standard Stage field in opportunities. It is useful to include a
description for a customized picklist value so that the historical reason
for creating it can be tracked. This field is available in API version 16.0
and later.
forecastCategory
fullName
string
The name used as a unique identifier for API access. The fullName
can contain only underscores and alphanumeric characters. It must be
unique, begin with a letter, not include spaces, not end with an
underscore, and not contain two consecutive underscores. This field is
inherited from the Metadata component.
245
Metadata Types
Field Name
Field Type
Description
highPriority
boolean
probability
int
reverseRole
string
reviewed
boolean
won
boolean
Java Sample
The following sample uses a picklist. For a complete sample of using a picklist with record types and profiles, see Profile on page 446.
public void setPicklistValues() {
// Create a picklist
Picklist expenseStatus = new Picklist();
PicklistValue unsubmitted = new PicklistValue();
unsubmitted.setFullName("Unsubmitted");
PicklistValue submitted = new PicklistValue();
submitted.setFullName("Submitted");
PicklistValue approved = new PicklistValue();
approved.setFullName("Approved");
PicklistValue rejected = new PicklistValue();
rejected.setFullName("Rejected");
expenseStatus.setPicklistValues(new PicklistValue[]
{unsubmitted, submitted, approved, rejected});
CustomField expenseStatusField = new CustomField();
expenseStatusField.setFullName(
246
Metadata Types
"ExpenseReport__c.ExpenseStatus__c");
expenseStatusField.setLabel("Expense Report Status");
expenseStatusField.setType(FieldType.Picklist);
expenseStatusField.setPicklist(expenseStatus);
try {
AsyncResult[] ars =
metadataConnection.create(new Metadata[] {expenseStatusField});
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
247
Metadata Types
<sorted>false</sorted>
</picklist>
<type>Picklist</type>
</fields>
<fields>
<fullName>model__c</fullName>
<label>Model</label>
<picklist>
<controllingField>manufacturer__c</controllingField>
<picklistValues>
<fullName>Mustang</fullName>
<controllingFieldValues>Ford</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>Taurus</fullName>
<controllingFieldValues>Ford</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>PT Cruiser</fullName>
<controllingFieldValues>Chrysler</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>Pacifica</fullName>
<controllingFieldValues>Chrysler</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>Accord</fullName>
<controllingFieldValues>Honda</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>Civic</fullName>
<controllingFieldValues>Honda</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>Prius</fullName>
<controllingFieldValues>Toyota</controllingFieldValues>
<default>false</default>
</picklistValues>
<picklistValues>
<fullName>Camry</fullName>
<controllingFieldValues>Toyota</controllingFieldValues>
<default>false</default>
</picklistValues>
<sorted>false</sorted>
</picklist>
<type>Picklist</type>
</fields>
248
Metadata Types
RecordType
....
</CustomObject>
The following sample shows usage for the standard Stage field in opportunities.
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<fields>
<fullName>StageName</fullName>
<picklist>
<picklistValues>
<fullName>Prospecting</fullName>
<default>false</default>
<forecastCategory>Pipeline</forecastCategory>
<probability>10</probability>
</picklistValues>
<picklistValues>
<fullName>Qualification</fullName>
<default>false</default>
<forecastCategory>Pipeline</forecastCategory>
<probability>10</probability>
</picklistValues>
<picklistValues>
<fullName>Needs Analysis</fullName>
<default>false</default>
<forecastCategory>Pipeline</forecastCategory>
<probability>20</probability>
</picklistValues>
...
</picklist>
</fields>
<CustomObject>
RecordType
Represents the metadata associated with a record type. Record types let you offer different business processes, picklist values, and page
layouts to different users. For more information, see Record Types in the Salesforce online help. Use this metadata type to create,
update, or delete record type definitions for a custom object. This type extends the Metadata metadata type and inherits its fullName
field.
Note: Retrieving a component of this metadata type in a project makes the component appear in any Profile and PermissionSet
components that are retrieved in the same package.
Version
Record types are available in API version 12.0 and later.
Fields
Field
Field Type
Description
active
boolean
249
Metadata Types
RecordType
Field
Field Type
Description
businessProcess
string
compactLayoutAssignment string
description
string
fullName
string
label
string
picklistValues
RecordTypePicklistValue[]
RecordTypePicklistValue
RecordTypePicklistValue represents the combination of picklists and valid values that define a record type:
Field Name
Field Type
Description
picklist
string
values
PicklistValue
One or more of the picklist values in the picklist. Each value defined is
available in the record type that contains this component.
250
Metadata Types
RecordType
Java Sample
The following sample uses two record types. For the complete sample that includes profiles and picklists, see Profile on page 446.
public void recordTypeSample() {
try {
// Employees and managers have different access
// to the state of the expense sheet
RecordType edit = new RecordType();
edit.setFullName("ExpenseReport__c.Edit");
edit.setLabel("ExpenseReport__c.Label");
PicklistValue unsubmitted = new PicklistValue();
unsubmitted.setFullName("Unsubmitted");
PicklistValue submitted = new PicklistValue();
submitted.setFullName("Submitted");
RecordTypePicklistValue editStatuses =
new RecordTypePicklistValue();
editStatuses.setPicklist("ExpenseStatus__c");
editStatuses.setValues(
new PicklistValue[] {unsubmitted, submitted});
edit.setPicklistValues(
new RecordTypePicklistValue[] {editStatuses});
AsyncResult[] arsEdit =
metadataConnection.create(new Metadata[] {edit});
RecordType approve = new RecordType();
approve.setFullName("ExpenseReport__c.Approve");
PicklistValue approved = new PicklistValue();
approved.setFullName("Approved");
PicklistValue rejected = new PicklistValue();
rejected.setFullName("Rejected");
RecordTypePicklistValue approveStatuses =
new RecordTypePicklistValue();
approveStatuses.setPicklist("ExpenseStatus__c");
approveStatuses.setValues(
new PicklistValue[] {approved, rejected});
approve.setPicklistValues(
new RecordTypePicklistValue[] {approveStatuses});
AsyncResult[] arsApprove =
metadataConnection.create(new Metadata[] {approve});
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
251
Metadata Types
SearchLayouts
</recordTypes>
. . .
</CustomObject>
SearchLayouts
Represents the metadata associated with the Search Layouts for an object. You can customize which fields to display for users in search
results, search filter fields, lookup dialogs, and recent record lists on tab home pages. For more information, see Customize Search
Layouts and Customize Search Layouts for Custom Objects in the Salesforce online help.
Version
Search layouts for custom objects are available in API version 14.0 and later. The ability to modify search layouts for standard objects
(except events and tasks) is available in API version 27.0 and later.
Fields
Field
Field Type
Description
customTabListAdditionalFields
string[]
excludedStandardButtons
string[]
listViewButtons
string[]
lookupDialogsAdditionalFields
string[]
252
Metadata Types
Field
SearchLayouts
Field Type
Description
for the record associated with the one being edited. Lookup
filter fields allow you to filter your lookup search by a
customized list of fields in the object.
This field is equivalent to the Lookup Dialogs in the
Search Layouts related list on the object detail page in the
application user interface. For more information, see Lookup
Dialog Search in the Salesforce online help.
lookupFilterFields
string[]
lookupPhoneDialogsAdditionalFields string[]
searchFilterFields
string[]
The list of fields that can be used to filter a search for the
object. The field name relative to the object name, for
example MyCustomField__c, is specified for each
custom field.
This field is equivalent to the Search Filter Fields
in the Search Layouts related list on the object detail page
in the application user interface.
searchResultsAdditionalFields
string[]
253
Metadata Types
Field
SharingReason
Field Type
Description
This field is equivalent to the Search Results in the
Search Layouts related list on the object detail page in the
application user interface.
searchResultsCustomButtons
string[]
SEE ALSO:
CustomObject
SharingReason
Represents an Apex sharing reason, which is used to indicate why sharing was implemented for a custom object. Apex managed sharing
allows developers to use Apex to programmatically share custom objects. When you use Apex managed sharing to share a custom
object, only users with the Modify All Data permission can add or change the sharing on the custom object's record, and the sharing
access is maintained across record owner changes. For more information, see Sharing Settings in the Salesforce online help.
Use SharingReason to create, update, or delete sharing reason definitions for a custom object. This type extends the Metadata metadata
type and inherits its fullName field.
Version
Sharing reasons are available in API version 14.0 and later.
254
Metadata Types
SharingRecalculation
Fields
Field
Field Type
Description
fullName
string
label
string
SharingRecalculation
Represents Apex classes that recalculate the Apex managed sharing for a specific custom object. For more information, see Recalculate
Apex Managed Sharing in the Salesforce online help.
Version
Sharing recalculations are available in API version 14.0 and later.
Fields
Field
Field Type
Description
className
string
Required. The Apex class that recalculates the Apex sharing for a custom
object. This class must implement the Database.Batchable
interface.
255
Metadata Types
ValidationRule
ValidationRule
Represents a validation rule, which is used to verify that the data a user enters in a record is valid and can be saved. A validation rule
contains a formula or expression that evaluates the data in one or more fields and returns a value of true or false. Validation rules
also include an error message that your client application can display to the user when the rule returns a value of true due to invalid
data. This type extends the Metadata metadata type and inherits its fullName field.
As of API version 20.0, validation rules can't have compound fields. Examples of compound fields include addresses, first and last names,
dependent picklists, and dependent lookups.
Version
Validation rules are available in API version 12.0 and later.
Fields
Field Name
Field Type
Description
active
boolean
description
string
errorConditionFormula
string
Required. The formula defined in the validation rule. If the formula returns
a value of true, an error message is displayed.
See Define Validation Rules in the Salesforce online help.
errorDisplayField
string
errorMessage
string
Required. The message that appears if the validation rule fails. The
message must be 255 characters or less.
fullName
string
The internal name of the object. White spaces and special characters are
escaped for validity. The name must:
Contain characters, letters, or the underscore (_) character
256
Metadata Types
Field Name
WebLink
Field Type
Description
Must start with a letter
Cant end with an underscore
Can't contain two consecutive underscore characters.
Inherited from the Metadata component, this field is not defined in the
WSDL for this component. It must be specified when creating, updating,
or deleting. See create() to see an example of this field specified for
a call.
WebLink
Represents a WebLink defined in a custom object. This type extends the Metadata metadata type and inherits its fullName field.
Version
WebLinks are available in API version 12.0 and later.
257
Metadata Types
WebLink
Fields
The WebLink definition contains the following fields.
Field Name
Field Type
Description
availability
WebLinkAvailability
(enumeration of type string)
description
string
displayType
WebLinkDisplayType
(enumeration of type string)
encodingKey
fullName
string
The name of the WebLink with white spaces and special characters
escaped for validity. The name can only contain characters, letters, and
the underscore (_) character, must start with a letter, and cannot end
with an underscore or contain two consecutive underscore characters.
Inherited from the Metadata component, this field is not defined in the
WSDL for this component. It must be specified when creating, updating,
or deleting. See create() to see an example of this field specified
for a call.
hasMenubar
boolean
258
Metadata Types
WebLink
Field Name
Field Type
Description
hasScrollbars
boolean
hasToolbar
boolean
height
int
isResizable
boolean
linkType
WebLinkType (enumeration of
type string)
masterLabel
string
Master label for this object. This display value is the internal label that is
not translated.
openType
WebLinkWindowType
(enumeration of type string)
Required. When this button is clicked, specifies the window style that
will be used to display the content. Valid values:
newWindow
sidebar
noSidebar
replace
onClickJavaScript
page
string
position
WebLinkPosition (enumeration
of type string)
protected
boolean
259
Metadata Types
Field Name
WebLink
Field Type
Description
referenced by components or sub-components created in the installing
organization.
requireRowSelection boolean
scontrol
string
showsLocation
boolean
showsStatus
boolean
url
string
If the value of linkType is url, this is the URL value. If the value of
linkType is javascript, this is the JavaScript content. If the value
neither of these, the this field should not be specified.
Content must be escaped in a manner consistent with XML parsing
rules.
width
int
Java Sample
The following Java sample shows sample values for WebLink fields:
public void WebLinkSample(String name) throws Exception {
WebLink WebLink = new WebLink();
// name variable represents the full name of the object
// on which to create the WebLink, for example, customObject__c
WebLink.setFullName(name + ".googleButton");
WebLink.setUrl("http://www.google.com");
WebLink.setAvailability(WebLinkAvailability.online);
WebLink.setLinkType(WebLinkType.url);
WebLink.setEncodingKey(Encoding.fromString("UTF-8"));
WebLink.setOpenType(WebLinkWindowType.newWindow);
WebLink.setHeight(600);
WebLink.setWidth(600);
WebLink.setShowsLocation(false);
WebLink.setHasScrollbars(true);
WebLink.setHasToolbar(false);
WebLink.setHasMenubar(false);
WebLink.setShowsStatus(false);
WebLink.setIsResizable(true);
260
Metadata Types
WebLink.setPosition(WebLinkPosition.none);
WebLink.setMasterLabel("google");
WebLink.setDisplayType(WebLinkDisplayType.link);
AsyncResult[] asyncResults = metadataConnection.create(new WebLink[]{WebLink});
// After the create() call completes, we must poll the results of checkStatus()
//
}
SEE ALSO:
HomePageComponent
HomePageLayout
CustomPageWebLink
261
Metadata Types
Field Type
Objects
CustomField
Custom object
Custom field
DeleteConstraint
Custom field
A string that represents deletion options for lookup relationships. Valid values are:
SetNull
Restrict
Cascade
A string which represents the deployment status of a custom object or field. Valid values are:
InDevelopment
Deployed
FieldType
Custom field
Percent
Phone
Picklist
MultiselectPicklist
Summary
Text
TextArea
LongTextArea
Summary
Url
Hierarchy
File
262
Metadata Types
Field Type
Objects
A Number custom field is internally represented as a field of type double. Setting the scale
of the Number field to 0 gives you a double that behaves like an int.
Gender
Custom object
Indicates the gender of the noun that represents the object. This is used for languages where
words need different treatment depending on their gender. Valid values are:
Masculine
Feminine
Neuter
AnimateMasculine (Slavic languagescurrently Czech, Polish, Russian, Slovak,
Slovenian, and Ukrainian)
Note: The following genders are displayed on the Rename Tabs and Labels page in
Setup but are stored internally as Feminine. When setting them through the Metadata
API, use Feminine.
Euter (Swedish)
Common (Dutch)
Represents a picklist, a set of labels and values that can be selected from a picklist.
SharingModel
Represents the sharing model for the custom object. Depending on the object, valid values
are:
Custom object
Private
Read
ReadWrite
ReadWriteTransfer
FullAccess
ControlledByParent
For example, the User object supports Private and Read values. Accounts, opportunities,
and custom objects support Private, Read and ReadWrite values.
StartsWith
Custom object
Custom field
Indicates whether the noun starts with a vowel, consonant, or is a special character. This is
used for languages where words need different treatment depending on the first character.
Valid values are:
Consonant
Vowel
Special (for nouns starting with z, or s plus consonants)
263
Metadata Types
CustomObjectTranslation
Field Type
Objects
TreatBlanksAs
Custom field
CustomObjectTranslation
This metadata type allows you to translate custom objects for a variety of languages. This type extends the Metadata metadata type and
inherits its fullName field. The ability to translate component labels is part of the Translation Workbench. For more information, see
Enable and Disable the Translation Workbench in the Salesforce online help.
Version
CustomObjectTranslation components are available in API version 14.0 and later.
Fields
Field
Field Type
Description
caseValues
ObjectNameCaseValue[]
fields
CustomFieldTranslation[]
fullName
string
gender
Gender
Indicates the gender of the noun that represents the object. This
is used for languages where words need different treatment
depending on their gender.
264
Metadata Types
CustomObjectTranslation
Field
Field Type
Description
layouts
LayoutTranslation[]
nameFieldLabel
string
namedFilters
NamedFilterTranslation[]
quickActions
QuickActionTranslation[]
recordTypes
RecordTypeTranslation[]
sharingReasons
SharingReasonTranslation[]
startsWith
StartsWith (enumeration of type Indicates whether the noun starts with a vowel, consonant, or
string)
is a special character. This is used for languages where words
need different treatment depending on the first character.
validationRules
ValidationRuleTranslation[]
webLinks
WebLinkTranslation[]
workflowTasks
WorkflowTaskTranslation[]
CustomFieldTranslation
CustomFieldTranslation contains details for a custom field translation. For more details, see CustomField.
Note: Not every language supports all the possible values for the fields in CustomFieldTranslation. For language-specific supported
values, see the fully supported languages and end-user languages appendices.
Field
Field Type
Description
caseValues
ObjectNameCaseValue[]
description
string
gender
Gender
Indicates the gender of the noun that represents the object. This
is used for languages where words need different treatment
depending on their gender. Available in API version 29.0 and
later.
help
string
Translation for the text that displays in the field-level help hover
text for this field.
label
string
265
Metadata Types
CustomObjectTranslation
Field
Field Type
Description
lookupFilter
LookupFilterTranslation
name
string
picklistValues
PicklistValueTranslation[]
relationshipLabel
string
startsWith
StartsWith (enumeration of type Indicates whether the noun starts with a vowel, consonant, or
string)
is a special character. This is used for languages where words
need different treatment depending on the first character.
Available in API version 29.0 and later.
LayoutTranslation
LayoutTranslation contains details for a page layout translation. For more details, see Fields.
Field
Field Type
Description
layout
string
layoutType
string
sections
LayoutSectionTranslation[]
LayoutSectionTranslation
LayoutSectionTranslation contains details for a page layout section translation. For more details, see LayoutSection.
Field
Field Type
Description
label
string
section
string
LookupFilterTranslation
LookupFilterTranslation shows a translation for a lookup filter error message associated with the custom object. Replaces
NamedFilterTranslation.
266
Metadata Types
CustomObjectTranslation
Field Type
Description
errorMessage
string
informationalMessage
string
NamedFilterTranslation
NamedFilterTranslation has been removed as of API version 30.0 and is only available in previous API versions.
NamedFilterTranslation shows a list of translations for lookup filter error messages associated with the custom object. See NamedFilter
for more information.
Field
Field Type
Description
errorMessage
string
informationalMessage
string
name
string
Required. The name of the lookup filter. If you create this field
in the user interface, a name is automatically assigned. If you
create this field through Metadata API, you must include the
name field.
ObjectNameCaseValue
ObjectNameCaseValue supports multiple cases and definitions of the custom object name to allow usage in various grammatical contexts.
Note: Not every language supports all the possible values for the fields in ObjectNameCaseValue. For language-specific supported
values, see the fully supported languages and end-user languages appendices.
Field
Field Type
Description
article
caseType
CaseType (enumeration of type The case of the custom object name. The valid values are:
string)
Ablative
267
Metadata Types
Field
CustomObjectTranslation
Field Type
Description
Accusative
Adessive
Allative
Causalfinal
Dative
Delative
Distributive
Elative
Essive
Essiveformal
Genitive
Illative
Inessive
Instrumental
Lative
Locative
Nominative
Objective
Partitive
Prepositional
Subjective
Sublative
Superessive
Termanative
Translative
Vocative
plural
boolean
possessive
Possessive (enumeration of type The possessive case of a language is a grammatical case used
string)
to indicate a relationship of possession.The valid values are:
First
None
Second
value
string
268
Metadata Types
CustomObjectTranslation
PicklistValueTranslation
PicklistValueTranslation contains details for a picklist value translation. For more details, see Picklist (Including Dependent Picklist).
Field
Field Type
Description
masterLabel
string
translation
string
QuickActionTranslation
QuickActionTranslation contains details for an action label in the user interface. For more information, see QuickAction.
Field
Field Type
Description
label
string
name
string
RecordTypeTranslation
RecordTypeTranslation contains details for a record type name translation. For more details, see RecordType.
Field
Field Type
Description
label
string
name
string
SharingReasonTranslation
SharingReasonTranslation contains details for a sharing reason translation. For more details, see SharingReason.
Field
Field Type
Description
label
string
name
string
ValidationRuleTranslation
ValidationRuleTranslation contains details for a validation rule translation. For more details, see ValidationRule.
269
Metadata Types
CustomObjectTranslation
Field
Field Type
Description
errorMessage
string
name
string
WebLinkTranslation
WebLinkTranslation contains details for a web link translation. For more details, see WebLink.
Field
Field Type
Description
label
string
name
string
WorkflowTaskTranslation
WorkflowTaskTranslation contains details for a workflow task translation. For more details, see Workflow.
Field
Field Type
Description
description
string
name
string
subject
string
270
Metadata Types
CustomObjectTranslation
<value>Beschreibung</value>
</caseValues>
<caseValues>
<caseType>Accusative</caseType>
<plural>true</plural>
<value>Beschreibungen</value>
</caseValues>
<caseValues>
<caseType>Genitive</caseType>
<plural>false</plural>
<value>Beschreibung</value>
</caseValues>
<caseValues>
<caseType>Genitive</caseType>
<plural>true</plural>
<value>Beschreibungen</value>
</caseValues>
<caseValues>
<caseType>Dative</caseType>
<plural>false</plural>
<value>Beschreibung</value>
</caseValues>
<caseValues>
<caseType>Dative</caseType>
<plural>true</plural>
<value>Beschreibungen</value>
</caseValues>
<fields>
<label>Zusammenfassung</label>
<name>Summary__c</name>
</fields>
<gender>Feminine</gender>
<nameFieldLabel>Beschreibungen</nameFieldLabel>
</CustomObjectTranslation>
This is a sample XML definition of a CustomObjectTranslation for the Account object, renaming Account to Client (Kunde) in German.
The Account object has one standard field, account_number, and one custom field, Account_Code__c. The name and location of the
file containing this definition would be objectTranslations/Account-de.objectTranslation.
<?xml version="1.0" encoding="UTF-8"?>
<CustomObjectTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<caseValues>
<caseType>Nominative</caseType>
<plural>false</plural>
<value>Kunde</value>
</caseValues>
<caseValues>
<caseType>Nominative</caseType>
<plural>true</plural>
<value>Kunden</value>
</caseValues>
<caseValues>
<caseType>Accusative</caseType>
<plural>false</plural>
<value>Kunden</value>
271
Metadata Types
CustomObjectTranslation
</caseValues>
<caseValues>
<caseType>Accusative</caseType>
<plural>true</plural>
<value>Kunden</value>
</caseValues>
<caseValues>
<caseType>Genitive</caseType>
<plural>false</plural>
<value>Kunden</value>
</caseValues>
<caseValues>
<caseType>Genitive</caseType>
<plural>true</plural>
<value>Kunden</value>
</caseValues>
<caseValues>
<caseType>Dative</caseType>
<plural>false</plural>
<value>Kunden</value>
</caseValues>
<caseValues>
<caseType>Dative</caseType>
<plural>true</plural>
<value>Kunden</value>
</caseValues>
<fields>
<caseValues>
<caseType>Nominative</caseType>
<plural>false</plural>
<value>Kundennummer</value>
</caseValues>
<caseValues>
<caseType>Nominative</caseType>
<plural>true</plural>
<value>Kundennummern</value>
</caseValues>
<gender>Feminine</gender>
<name>account_number</name>
</fields>
<fields>
<label>Kunden-Code</label>
<name>Account_Code__c</name>
</fields>
<gender>Masculine</gender>
</CustomObjectTranslation>
SEE ALSO:
CustomObject
Translations
272
Metadata Types
CustomPageWebLink
CustomPageWebLink
Represents a web link defined in a home page component. This type extends the Metadata metadata type and inherits its fullName
field. All other web links are stored as a WebLink in a CustomObject.
Version
CustomPageWebLinks are available in API version 13.0 and later.
Fields
The CustomPageWebLink definition has the following fields:
Field Name
Field Type
Description
availability
WebLinkAvailability
(enumeration of type string)
description
string
displayType
WebLinkDisplayType
(enumeration of type string)
encodingKey
Encoding (enumeration of type Required. The default encoding setting is Unicode: UTF-8. Change it if
string)
your template requires data in a different format. This is available if your
Content Source is URL.Valid values include:
UTF-8Unicode (UTF-8)
ISO-8859-1General US & Western Europe (ISO-88591,
ISO-LATIN-1)
Shift_JISJapanese (Shift-JIS)
ISO-2022-JPJapanese (JIS)
EUC-JPJapanese (EUC-JP)
x-SJIS_0213Japanese (Shift-JIS_2004)
ks_c_5601-1987Korean (ks_c_5601-1987)
Big5Traditional Chinese (Big5)
GB2312Simplified Chinese (GB2312)
Big5-HKSCSTraditional Chinese Hong Kong (Big5HKSCS)
273
Metadata Types
CustomPageWebLink
Field Name
Field Type
Description
fullName
string
The name used as a unique identifier for API access. The fullName
can contain only underscores and alphanumeric characters. It must be
unique, begin with a letter, not include spaces, not end with an
underscore, and not contain two consecutive underscores.
hasMenubar
boolean
hasScrollbars
boolean
hasToolbar
boolean
height
int
isResizable
boolean
linkType
WebLinkType (enumeration of
type string)
masterLabel
string
openType
WebLinkWindowType
(enumeration of type string)
Required. When this button is clicked, specifies the window style that will
be used to display the content.
Valid values:
newWindow
sidebar
noSidebar
replace
onClickJavaScript
page
string
274
Metadata Types
CustomPageWebLink
Field Name
Field Type
Description
position
WebLinkPosition (enumeration If the openType is newWindow, how the new window should be
of type string)
displayed. Otherwise this field should not be specified.
Valid values:
fullScreen
none
topLeft
boolean
requireRowSelection boolean
protected
scontrol
string
showsLocation
boolean
showsStatus
boolean
url
string
If the value of linkType is url, this is the URL value. If the value of
linkType is javascript, this is the JavaScript content. If the value
neither of these, the this field should not be specified.
Content must be escaped in a manner consistent with XML parsing rules.
width
int
275
Metadata Types
CustomPermission
<linkType>url</linkType>
<masterLabel>detailPageButon</masterLabel>
<openType>newWindow</openType>
<position>none</position>
<protected>false</protected>
<showsLocation>false</showsLocation>
<showsStatus>false</showsStatus>
<url>http://google.com</url>
</CustomPageWebLink>
SEE ALSO:
HomePageComponent
HomePageLayout
WebLink
CustomPermission
Represents a permission that grants access to a custom feature. This type extends the Metadata metadata type and inherits its fullName
field.
Version
CustomPermission components are available in API version 31.0 and later.
Fields
Field Name
Field Type
Description
connectedApp
string
description
string
label
string
requiredPermission
276
Metadata Types
CustomPermission
CustomPermissionDependencyRequired
CustomPermissionDependencyRequired determines whether a custom permission is required by the parent custom permission. A
required custom permission must be enabled when its parent is enabled.
Field Name
Field Type
Description
customPermission
string
dependency
boolean
The following is an example package.xml that references the previous definition, as well as other custom permissions that are
associated with a connected app.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Acme</members>
<name>ConnectedApp</name>
</types>
<types>
<members>Acme_Account_Email_Read</members>
<members>Acme_Account_Phone_Edit</members>
<members>Acme_Account_Full_Access</members>
<members>Acme_Account_Read</members>
<name>CustomPermission</name>
</types>
<types>
<members>Acme_Account_Email_Read</members>
<members>Acme_Account_Phone_Edit</members>
<members>Acme_Account_Full_Access</members>
<members>Acme_Account_Read</members>
<name>PermissionSet</name>
</types>
<version>36.0</version>
</Package>
277
Metadata Types
CustomSite
CustomSite
Represents a Force.com site. Force.com Sites enables you to create public websites and applications that are directly integrated with
your Salesforce organizationwithout requiring users to log in with a username and password. For more information, see Force.com
Sites Overview in the Salesforce online help.
Note: CustomSite does not support syndication feeds at this time.
This type extends the Metadata metadata type and inherits its fullName field.
Version
Force.com CustomSite components are available in API version 14.0 and later.
Fields
Field
Field Type
Description
active
boolean
allowHomePage
boolean
allowStandardAnswersPages
boolean
allowStandardIdeasPages
boolean
allowStandardLookups
boolean
allowStandardSearch
boolean
analyticsTrackingCode
string
278
Metadata Types
CustomSite
Field
Field Type
Description
authorizationRequiredPage
string
bandwidthExceededPage
string
changePasswordPage
string
chatterAnswersForgotPasswordConfirmPage string
chatterAnswersForgotPasswordPage string
chatterAnswersHelpPage
string
chatterAnswersLoginPage
string
chatterAnswersRegistrationPage
string
clickjackProtectionLevel
279
Metadata Types
CustomSite
Field
Field Type
Description
customWebAddresses
SiteWebAddress[]
description
string
favoriteIcon
string
fileNotFoundPage
string
forgotPasswordPage
string
genericErrorPage
string
guestProfile
string
inMaintenancePage
string
inactiveIndexPage
string
indexPage
string
masterLabel
string
portal
string
requireHttps
boolean
requireInsecurePortalAccess
boolean
280
Metadata Types
CustomSite
Field
Field Type
Description
robotsTxtPage
string
serverIsDown
string
siteRedirectMappings
SiteRedirectMapping[]
An array of all URL redirect rules set for your site. This
field is available in API version 20.0 and later.
siteAdmin
string
siteTemplate
string
siteType
siteType
subdomain
string
urlPathPrefix
string
SiteRedirectMapping
SiteRedirectMapping represents a URL redirect rule on your Force.com site. For more information, see Force.com Sites URL Redirects
in the Salesforce online help.
Field
Field Type
Description
action
281
Metadata Types
Field
CustomSite
Field Type
Description
Temporary
isActive
boolean
source
string
target
string
SiteWebAddress
Represents the web address of a Force.com site.
Field
Field Type
Description
certificate
string
domainName
string
primary
boolean
<chatterAnswersForgotPasswordPage>ChatterAnswersForgotPassword</chatterAnswersForgotPasswordPage>
<chatterAnswersHelpPage>ChatterAnswersHelp</chatterAnswersHelpPage>
282
Metadata Types
CustomTab
<chatterAnswersLoginPage>ChatterAnswersLogin</chatterAnswersLoginPage>
<chatterAnswersRegistrationPage>ChatterAnswersRegistration</chatterAnswersRegistrationPage>
<clickjackProtectionLevel>SameOriginOnly</clickjackProtectionLevel>
<customWebAddresses>
<domainName>www.testing123.com</domainName>
<primary>true</primary>
</customWebAddress>
<favoriteIcon>myFavIcon</favoriteIcon>
<fileNotFoundPage>FileNotFound</fileNotFoundPage>
<genericErrorPage>Exception</genericErrorPage>
<inMaintenancePage>InMaintenance</inMaintenancePage>
<serverIsDown>MyServerDownResource</serverIsDown>
<indexPage>UnderConstruction</indexPage>
<masterLabel>customSite</masterLabel>
<portal>Customer Portal</portal>
<requireInsecurePortalAccess>false</requireInsecurePortalAccess>
<siteAdmin>[email protected]</siteAdmin>
<siteTemplate>SiteTemplate</siteTemplate>
<subdomain>myco</subdomain>
</CustomSite>
SEE ALSO:
Portal
CustomTab
Represents a custom tab. Display custom object data or other Web content using custom tabs in Salesforce. When a tab displays a
custom object, the tab name is the same as the custom object name; for page, s-control, or URL tabs, the name is arbitrary. For more
information, see Understanding Custom Tabs in the Salesforce online help. This type extends the Metadata metadata type and inherits
its fullName field.
Version
Tabs are available in API version 10.0 and later.
Fields
This metadata type contains the following fields:
283
Metadata Types
CustomTab
Field Name
Field Type
Description
auraComponent
string
customObject
boolean
Indicates whether this tab is for a custom object (true) or not (false).
If set to true, the name of the tab matches the name of the custom
object.
Only one of these fields should have a value set:
auraComponent
customObject
flexiPage
page
scontrol
url
description
string
flexiPage
string
frameHeight
int
The height, in pixels of the tab frame. Required for s-control and page
tabs.
fullName
string
The name of the tab. The value of this field depends on the type of tab,
and the API version.
For custom object tabs, the fullName is the developer-assigned
name of the custom object (MyCustomObject__c, for example). For
284
Metadata Types
Field Name
CustomTab
Field Type
Description
custom object tabs, this name must be the same as the custom
object name, and customObject should be set to true.
For Web tabs, the fullName is the developer-assigned name of
the tab (MyWebTab, for example).
The fullName can contain only underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces,
not end with an underscore, and not contain two consecutive
underscores. This field is inherited from the Metadata component.
hasSidebar
boolean
icon
string
The optional reference to the image document for the tab if the tab is
not using one of the standard tab styles. This is a new field in API version
14.0.
label
string
mobileReady
boolean
motif
string
Required. The tab style for the color scheme and icon for the custom
tab. For example, 'Custom70: Handsaw, is the handsaw icon.
page
string
scontrol
string
splashPageLink
string
The custom link used as the introductory splash page when users click
the tab. References a HomePageComponent.
285
Metadata Types
Dashboard
Field Name
Field Type
Description
url
string
urlEncodingKey
Encoding
(enumeration of
type string)
SEE ALSO:
CustomApplication
Dashboard
Represents a dashboard. Dashboards are visual representations of data that allow you to see key metrics and performance at a glance.
This type extends the Metadata metadata type and inherits its fullName field. For more information, see Edit Dashboards in
Accessibility Mode in the Salesforce online help.
286
Metadata Types
Dashboard
Retrieving Dashboards
You cant use the wildcard (*) symbol with dashboards in package.xml. To retrieve the list of dashboards for populating
package.xml with explicit names, call listMetadata() and pass in DashboardFolder as the type. Note that
DashboardFolder is not returned as a type in describeMetadata(). Dashboard is returned from describeMetadata()
with an associated attribute of inFolder set to true. If that attribute is set to true, you can construct the type by using the component
name with the word Folder, such as DashboardFolder.
The following example shows folders in package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MyDBFolder/MyDBName</members>
<name>Dashboard</name>
</types>
<types>
<members>MyDocumentFolder/MyDocumentName</members>
<name>Document</name>
</types>
<types>
<members>unfiled$public/MarketingProductInquiryResponse</members>
<members>unfiled$public/SalesNewCustomerEmail</members>
<name>EmailTemplate</name>
</types>
<types>
<members>MyReportFolder/MyReportName</members>
<name>Report</name>
</types>
<version>36.0</version>
</Package>
Version
Dashboard components are available in API version 14.0 and later.
Fields
Field
Field Type
Description
backgroundEndColor
string
287
Metadata Types
Field
Dashboard
Field Type
Description
backgroundFadeDirection ChartBackgroundDirection
backgroundStartColor
string
dashboardFilters
DashboardFilters[]
dashboardGridLayout
DashboardGridLayout
dashboardType
DashboardType (enumeration
of type string)
description
string
folderName
string
fullName
string
288
Metadata Types
Dashboard
Field
Field Type
Description
isGridLayout
boolean
leftSection
middleSection
rightSection
runningUser
string
The username of the user whose role and sharing settings are
used to determine the data shown in the dashboard.
When you deploy a dashboard and the value in this field is not
defined or does not correspond to a valid user, the field is
populated with the username of the user performing the
deployment.
Regardless of their security settings, all users viewing a
dashboard see exactly the same data, because dashboards are
always run using the security settings of a particular user.
Tip: To avoid inappropriate exposure of sensitive data,
save the dashboard to a folder that is visible only to
appropriate users.
textColor
string
title
string
titleColor
string
titleSize
int
DashboardComponentSection
DashboardComponentSection represents one of the sections or columns in a dashboard.
Field
Field Type
Description
columnSize
DashboardComponentSize
(enumeration of type string)
components
DashboardComponent[]
289
Metadata Types
Dashboard
DashboardComponentSize
DashboardComponentSize is an enumeration of type string that lists different size categories. The valid values are listed in the table
below:
Enumeration Value
Description
medium
narrow
wide
DashboardComponent
A dashboard consists of a group of different components or elements that display data. Each component can use a custom report or a
custom s-control as their data source to display corporate metrics or key performance indicators. You can create several dashboard
components and display them all in one dashboard aligned in up to three columns.
Field
Field Type
Description
chartAxisRange
ChartRangeType (enumeration of type A manual or automatic axis range for bar or line charts.
string)
The valid values are:
auto
manual
chartAxisRangeMax
double
chartAxisRangeMin
double
chartSummary
ChartSummary
componentType
DashboardComponentType
(enumeration of type string)
290
Metadata Types
Field
Dashboard
Field Type
Description
ColumnLineStacked
ColumnLineStacked100
ColumnStacked
ColumnStacked100
Donut
Funnel
Gauge
Line
lineCumulative
LineGrouped
lineGroupedCumulative
Metric
Pie
Scatter
ScatterGrouped
Scontrol
Table
dashboardFilterColumns DashboardFilterColumns[]
dashboardTableColumn
DashboardTableColumn[]
displayUnits
drillDownUrl
string
291
Metadata Types
Dashboard
Field
Field Type
Description
drillEnabled
boolean
drillToDetailEnabled
boolean
enableHover
boolean
expandOthers
boolean
footer
string
gaugeMax
double
gaugeMin
double
groupingColumn
string
header
string
indicatorBreakpoint1
double
292
Metadata Types
Dashboard
Field
Field Type
Description
indicatorBreakpoint2
double
indicatorHighColor
string
indicatorLowColor
string
indicatorMiddleColor
string
legendPosition
ChartLegendPosition (enumeration of The location of the legend with respect to the chart. The
type string)
valid values are:
Bottom
OnChart
Right
maxValuesDisplayed
int
metricLabel
string
page
string
pageHeightInPixels
int
report
string
scontrol
string
scontrolHeightInPixels int
showPercentage
boolean
showPicturesOnCharts
boolean
293
Metadata Types
Field
Dashboard
Field Type
Description
photos. Set the Drill Down to option to Record
Detail Page to take users directly to user profile or
group pages when they click photos. Chatter must be
enabled for photos to be displayed. Depending on your
organization's setup, you may not see photos on tables
and charts.
showPicturesOnTables
boolean
showTotal
boolean
showValues
boolean
sortBy
DashboardComponentFilter
(enumeration of type string)
title
string
useReportChart
boolean
DashboardFilters
DashboardFilters represents a filter in a dashboard.
Field
Field Type
Description
dashboardFilterOptions DashboardFilterOptions[]
name
string
294
Metadata Types
Dashboard
DashboardFilterColumns
DashboardFilterColumns represents a filter column in a dashboard.
Field
Field Type
Description
column
string
DashboardFilterOptions
DashboardFilterOptions represents a filter option in a dashboard.
Field
Field Type
Description
operator
DashboardFilterOperation
Required. Represents the filter operation for this filter item. Valid
values are enumerated in DashboardFilterOperation. This field
is available in API version 24.0 and later.
string
values
string[]
DashboardFilterOperation
This is an enumeration of type string that lists dashboard filter operations. Valid values are:
equals
notEqual
lessThan
greaterThan
lessOrEqual
greaterOrEqual
contains
notContain
startsWith
includes
excludes
between
Note: The between operator takes two operands (for example, between MinimumValue, MaximumValue). Note also that
the minimum value is inclusive, while the maximum value is exclusive. All other dashboard filter operations take a single
operand only.
295
Metadata Types
Dashboard
DashboardTableColumn
DashboardTableColumn represents a column in a customized table component in a dashboard.
Field
Field Type
Description
aggregateType
ReportSummaryType[]
(enumeration of type string)
column
string
showTotal
boolean
sortBy
DashboardComponentFilter
(enumeration of type string)
The sort option for the dashboard table component. Sort on just
one column per table.
DashboardComponentFilter
DashboardComponentFilter is an enumeration of type string that lists the sort values for dashboard components. The valid values are:
Enumeration Value
Description
RowLabelAscending
RowLabelDescending
RowValueAscending
RowValueDescending
DashboardGridComponent
Lightning Experience features dashboards with more than three columns and components that span multiple columns and multiple
rows in size. DashboardGridComponent specifies location and size of a given dashboard component.
Field
Field Type
Description
colSpan
int
columnIndex
int
dashboardComponent
DashboardComponent
rowIndex
int
296
Metadata Types
Dashboard
Field
Field Type
Description
rowSpan
int
DashboardGridLayout
Lightning Experience features dashboards with more than three columns and components that span multiple columns and multiple
rows in size. DashboardGridLayout lists the included dashboard components, specifies the number of dashboard columns, and sets each
dashboard rows height in pixels.
Field
Field Type
Description
dashboardGridComponents DashboardGridComponent[]
numberOfColumns
int
rowHeight
int
297
Metadata Types
Dashboard
</dashboardFilterOptions>
<name>Account Type</name>
</dashboardFilters>
<dashboardType>SpecifiedUser</dashboardType>
<leftSection>
<columnSize>Medium</columnSize>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Bar</componentType>
<dashboardFilterColumns>
<column>INDUSTRY</column>
</dashboardFilterColumns>
<dashboardFilterColumns>
<column>TYPE</column>
</dashboardFilterColumns>
<displayUnits>Auto</displayUnits>
<drillEnabled>false</drillEnabled>
<drillToDetailEnabled>false</drillToDetailEnabled>
<enableHover>false</enableHover>
<expandOthers>false</expandOthers>
<legendPosition>Bottom</legendPosition>
<report>unfiled$public/SampleReportofAccounts</report>
<showPercentage>false</showPercentage>
<showPicturesOnCharts>false</showPicturesOnCharts>
<showValues>false</showValues>
<sortBy>RowLabelAscending</sortBy>
<useReportChart>false</useReportChart>
</components>
</leftSection>
<middleSection>
<columnSize>Medium</columnSize>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Funnel</componentType>
<dashboardFilterColumns>
<column>ACCOUNT_INDUSTRY</column>
</dashboardFilterColumns>
<dashboardFilterColumns>
<column>ACCOUNT.TYPE</column>
</dashboardFilterColumns>
<displayUnits>Auto</displayUnits>
<drillEnabled>false</drillEnabled>
<drillToDetailEnabled>false</drillToDetailEnabled>
<enableHover>false</enableHover>
<expandOthers>false</expandOthers>
<legendPosition>Bottom</legendPosition>
<report>unfiled$public/SampleReportofCases</report>
<showPercentage>false</showPercentage>
<showValues>true</showValues>
<sortBy>RowLabelAscending</sortBy>
<useReportChart>false</useReportChart>
</components>
</middleSection>
<rightSection>
298
Metadata Types
Dashboard
<columnSize>Medium</columnSize>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Column</componentType>
<dashboardFilterColumns>
<column>INDUSTRY</column>
</dashboardFilterColumns>
<dashboardFilterColumns>
<column>ACCOUNT_TYPE</column>
</dashboardFilterColumns>
<displayUnits>Auto</displayUnits>
<drillEnabled>false</drillEnabled>
<drillToDetailEnabled>false</drillToDetailEnabled>
<enableHover>false</enableHover>
<expandOthers>false</expandOthers>
<legendPosition>Bottom</legendPosition>
<report>unfiled$public/SampleReportofOpportunities</report>
<showPercentage>false</showPercentage>
<showValues>false</showValues>
<sortBy>RowLabelAscending</sortBy>
<useReportChart>false</useReportChart>
</components>
</rightSection>
<runningUser>admin@TESTORGNUM</runningUser>
<textColor>#000000</textColor>
<title>My Dashboard</title>
<titleColor>#000000</titleColor>
<titleSize>12</titleSize>
</Dashboard>
299
Metadata Types
Dashboard
<column>CLOSE_DATE</column>
<sortBy>RowLabelAscending</sortBy>
</dashboardTableColumn>
<dashboardTableColumn>
<aggregateType>Sum</aggregateType>
<column>AMOUNT</column>
<showTotal>true</showTotal>
</dashboardTableColumn>
<dashboardTableColumn>
<column>STAGE_NAME</column>
</dashboardTableColumn>
<dashboardTableColumn>
<column>PROBABILITY</column>
<aggregateType>Maximum</aggregateType>
</dashboardTableColumn>
<displayUnits>Integer</displayUnits>
<header>Opportunities Table</header>
<indicatorHighColor>#54C254</indicatorHighColor>
<indicatorLowColor>#C25454</indicatorLowColor>
<indicatorMiddleColor>#C2C254</indicatorMiddleColor>
<maxValuesDisplayed>10</maxValuesDisplayed>
<report>testFolder/sourceRep</report>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Bar</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Column</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<legendPosition>Bottom</legendPosition>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
<useReportChart>true</useReportChart>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Funnel</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<expandOthers>true</expandOthers>
<legendPosition>Bottom</legendPosition>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
</leftSection>
300
Metadata Types
Dashboard
<middleSection>
<columnSize>Medium</columnSize>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>ColumnStacked100</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>ColumnStacked</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>ColumnStacked</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>ColumnGrouped</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Column</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
</middleSection>
<rightSection>
<columnSize>Medium</columnSize>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Bar</componentType>
<displayUnits>Auto</displayUnits>
301
Metadata Types
Dashboard
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Pie</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<expandOthers>true</expandOthers>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>LineGroupedCumulative</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>LineGrouped</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>LineCumulative</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
<components>
<chartAxisRange>Auto</chartAxisRange>
<componentType>Donut</componentType>
<displayUnits>Auto</displayUnits>
<drillEnabled>true</drillEnabled>
<enableHover>true</enableHover>
<expandOthers>true</expandOthers>
<report>testFolder/sourceRep</report>
<sortBy>RowLabelAscending</sortBy>
</components>
</rightSection>
<runningUser>admin@TESTORGNUM</runningUser>
302
Metadata Types
Dashboard
<textColor>#000000</textColor>
<title>Db Title</title>
<titleColor>#000000</titleColor>
<titleSize>12</titleSize>
</Dashboard>
303
Metadata Types
Dashboard
<axisBinding>y</axisBinding>
<column>RowCount</column>
</chartSummary>
<componentType>Pie</componentType>
<drillEnabled>false</drillEnabled>
<drillToDetailEnabled>false</drillToDetailEnabled>
<enableHover>false</enableHover>
<expandOthers>false</expandOthers>
<groupingColumn>TITLE</groupingColumn>
<legendPosition>Bottom</legendPosition>
<report>unfiled$public/lead_rpt</report>
<showPercentage>false</showPercentage>
<showValues>true</showValues>
<sortBy>RowLabelAscending</sortBy>
<useReportChart>false</useReportChart>
</dashboardComponent>
<rowIndex>3</rowIndex>
<rowSpan>3</rowSpan>
</dashboardGridComponents>
<dashboardGridComponents>
<colSpan>3</colSpan>
<columnIndex>0</columnIndex>
<dashboardComponent>
<autoselectColumnsFromReport>false</autoselectColumnsFromReport>
<chartAxisRange>Auto</chartAxisRange>
<chartSummary>
<axisBinding>y</axisBinding>
<column>RowCount</column>
</chartSummary>
<componentType>Column</componentType>
<drillEnabled>false</drillEnabled>
<drillToDetailEnabled>false</drillToDetailEnabled>
<enableHover>false</enableHover>
<expandOthers>false</expandOthers>
<groupingColumn>TITLE</groupingColumn>
<legendPosition>Bottom</legendPosition>
<report>unfiled$public/lead_rpt</report>
<showPercentage>false</showPercentage>
<showValues>false</showValues>
<sortBy>RowLabelAscending</sortBy>
<useReportChart>false</useReportChart>
</dashboardComponent>
<rowIndex>9</rowIndex>
<rowSpan>3</rowSpan>
</dashboardGridComponents>
<numberOfColumns>9</numberOfColumns>
<rowHeight>90</rowHeight>
</gridLayout>
<isGridLayout>true</isGridLayout>
<runningUser>[email protected]</runningUser>
<textColor>#000000</textColor>
<title>sfx</title>
<titleColor>#000000</titleColor>
304
Metadata Types
DataCategoryGroup
<titleSize>12</titleSize>
</Dashboard>
SEE ALSO:
Folder
Report
DataCategoryGroup
Represents a data category group. This type extends the Metadata metadata type and inherits its fullName field.
Warning: Using Metadata API to deploy category changes from one organization to another permanently removes categories
and record categorizations that are not specified in your XML file. Salesforce recommends that you manually create data categories
and record associations in an organization from Setup by entering Data Categories in the Quick Find box, then
selecting Data Categories rather than deploying changes from a sandbox to a production organization. For more information,
see Usage.
Data category groups are provided to:
Classify and filter data.
Share data among users.
Every data category group contains items or data categories that can be organized hierarchically.
The example below shows the Geography data category group and its data categories.
Geography
Worldwide
North America
United States of America
Canada
Mexico
Europe
Asia
Note: See "What Are Data Categories?" in the Salesforce online help for more information on data category groups, data categories,
parent and sub categories.
Version
Data category groups are available in API version 18.0 and later.
Fields
This metadata type contains the following fields:
305
Metadata Types
DataCategoryGroup
Field Name
Field Type
Description
active
boolean
dataCategory
DataCategory
description
string
fullName
string
Required. The unique name of the data category group. When creating
a data category group, the fullName field and the file name (without
its suffix) must match.The fullName can contain only underscores
and alphanumeric characters. It must be unique, begin with a letter, not
include spaces, not end with an underscore, and not contain two
consecutive underscores. This field is inherited from the Metadata
component.
label
string
objectUsage
ObjectUsage
The objects that are associated with the data category group.
DataCategory
Represents an item (or data category) in the data category group. A data category can recursively contain a list of other data categories.
Field Name
Field Type
Description
dataCategory
DataCategory[]
label
string
Required. Label for the data category throughout the Salesforce user
interface.
name
string
306
Metadata Types
DataCategoryGroup
ObjectUsage
Represents the objects that can be associated with the data category group. This association allows the object to be classified and filtered
using the data categories.
Field Name
Field Type
Description
object
string[]
A list of the object names that can be associated with the data category
group. Valid values are:
KnowledgeArticleVersionto associate articles. See
"Modifying Category Group Assignments in Salesforce Knowledge"
in the Salesforce online help for more information on data category
groups association to articles.
Questionto associate questions. You can associate the
Question object with at most one category group. See "Assigning
Data Categories to Answers" in the Salesforce online help for more
information on data category groups association to questions.
Warning: If you deploy a category group that already exists in
an organization, any object association that is not defined in the
XML file is permanently removed from your organization. Ensure
that your XML file specifies all the records associated with your
category group in the organization. For more information see
Usage.
307
Metadata Types
DataCategoryGroup
<dataCategory>
<name>FR</name>
<label>France</label>
</dataCategory>
<dataCategory>
<name>SP</name>
<label>Spain</label>
</dataCategory>
<dataCategory>
<name>UK</name>
<label>United-Kingdom</label>
</dataCategory>
</dataCategory>
<dataCategory>
<name>APAC</name>
<label>Asia</label>
</dataCategory>
</dataCategory>
<objectUsage>
<object>KnowledgeArticleVersion </object>
<objectUsage>
</DataCategoryGroup>
Usage
When you deploy a category group XML file, Metadata API checks whether the category group exists in the target organization. If the
category group does not exist, it is created. If the category group already exists, then Metadata API:
Adds any new category or object defined in the XML file.
Deletes any category that is not defined in the XML file. Records associated with the deleted categories are re-associated with the
parent category.
Deletes any object association that is not defined in the XML file.
Moves any category if its hierarchical position differs from the position specified in the XML file.
Note: When a category moves to a new parent category, users that have no visibility on the new parent category lose their
visibility to the repositioned category.
Note: For more information about category deletion, category repositioning and its impact on record categorization and visibility
see "Deleting Data Categories" and "Modifying and Positioning Data Categories" in the Salesforce online help.
Using Metadata API to deploy category changes from one organization to another permanently removes categories and record
categorizations that are not specified in your XML file. Salesforce recommends that you manually create data categories and record
associations in an organization from Setup by entering Data Categories in the Quick Find box, then selecting Data
Categories rather than deploying changes from a sandbox to a production organization.
The following example illustrates what happens if you deploy an XML representation of a Geography data category group hierarchy
to an organization that already has this data category group defined. Note that the organization contains a US category, while the XML
file includes a USA category in the same hierarchical position. The Metadata API deployment process deletes the US category from
the organization and moves associations for any records from US to the parent AMER category. It also adds the USA category under
AMER. Note that all records that were previously categorized with US are now associated with the AMER category.
308
Metadata Types
DataCategoryGroup
The next example illustrates what can happen when you delete or move a category in a data category group and deploy its XML
representation from a sandbox to a production organization that already has this data category group defined. Hierarchy 1 shows the
initial data category group in the sandbox organization. In hierarchy 2, we add an EU category under EMEA and move FR, SP and
UK below EU. In hierarchy 3, we delete FR and associate its records with its new parent, EU. Finally, we deploy the changes from the
sandbox to the production organization.
309
Metadata Types
DelegateGroup
Metadata API has no concept of the order of the changes made to the sandbox organization. It just deploys the changes from one
organization to another. During the deployment, it first notices the deletion of the FR category and removes it from the production
organization. Consequently, it moves associations for any records from FR to its parent on the production organization, EMEA. Metadata
API then adds the EU category and moves SP and UK below it. Although the category group hierarchy looks the same in both
organizations, record categorization in production is different from the sandbox organization. The records that were originally associated
with FR in hierarchy 1 are associated with EU in the sandbox organization, but are associated with EMEA in the production organization.
DelegateGroup
Represents a group of users who have the same administrative privileges. These groups are different from public groups used for sharing.
This type extends the Metadata metadata type and inherits its fullName field.
Version
DelegateGroup components are available in API version 36.0 and later.
310
Metadata Types
DelegateGroup
Fields
Field Name
Field Type
Description
customObjects
string[]
groups
string[]
label
string
loginAccess
boolean
Required. Allows users in this group to log in as users in the role hierarchy
that they administer (true) or not (false). Depending on your
organization settings, individual users must grant login access to allow
their administrators to log in as them.
permissionSets
string[]
profiles
string[]
roles
string[]
311
Metadata Types
Document
Document
Represents a Document. All documents must be in a document folder, for example sampleFolder/TestDocument. This metadata
type extends the MetadataWithContent component and shares its fields.
Currently, users are not able to export document metadata to a local file system using the Force.com IDE.
Retrieving Documents
You cant use the wildcard (*) symbol with documents in package.xml. To retrieve the list of documents for populating
package.xml with explicit names, call listMetadata() and pass in DocumentFolder as the type. Note that DocumentFolder
is not returned as a type in describeMetadata(). Document is returned from describeMetadata() with an associated
attribute of inFolder set to true. If that attribute is set to true, you can construct the type by using the component name with the
word Folder, such as DocumentFolder.
The following example shows folders in package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MyDBFolder/MyDBName</members>
<name>Dashboard</name>
</types>
<types>
<members>MyDocumentFolder/MyDocumentName</members>
<name>Document</name>
</types>
<types>
<members>unfiled$public/MarketingProductInquiryResponse</members>
<members>unfiled$public/SalesNewCustomerEmail</members>
<name>EmailTemplate</name>
</types>
<types>
<members>MyReportFolder/MyReportName</members>
<name>Report</name>
</types>
<version>36.0</version>
</Package>
For each document an accompanying metadata file named DocumentFilename-meta.xml is created in the document folder.
For example, for a document TestDocument.png in the sampleFolder folder, theres a TestDocument.png-meta.xml in
the documents/sampleFolder of the package.
Version
Documents are available in API version 10.0 and later.
In API version 17.0 and later, you can delete a folder containing documents moved to the Recycle Bin. When you delete the folder, any
related documents in the Recycle Bin are permanently deleted.
In API version 18.0 and later, documents do not need an extension.
312
Metadata Types
Document
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
content
base64
description
string
fullName
string
The name of the document, including the folder name. In version 17.0
and earlier, the fullName included the document extension. In version
18.0 and later, the fullName does not include the file extension. The
fullName can contain only underscores and alphanumeric characters.
It must be unique, begin with a letter, not include spaces, not end with
an underscore, and not contain two consecutive underscores. If this field
contained characters before version 14.0 that are no longer allowed, the
characters were stripped out of this field, and the previous value of the
field was saved in the name field. This field is inherited from the Metadata
component.
internalUseOnly
boolean
keywords
string
Contains one or more words that describe the document. A check for
matches to words in this field is performed when doing a search.
name
string
The list of characters allowed in the fullName field has been reduced
for versions 14.0 and later. This field contains the value contained in the
fullName field before version 14.0. This field is only populated if the
value of the fullName field contained characters that are no longer
accepted in that field.
public
boolean
313
Metadata Types
EmailTemplate
SEE ALSO:
Folder
EmailTemplate
Represents an email template. This metadata type extends the MetadataWithContent component and shares its fields.
314
Metadata Types
EmailTemplate
<name>Report</name>
</types>
<version>36.0</version>
</Package>
Version
Email templates are available in API version 12.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
apiVersion
double
The API version if this is a Visualforce email template. Every Visualforce email
template has an API version specified at creation. This field is available in API
version 16.0 and later.
attachedDocuments string[]
attachments
Attachment[]
available
boolean
content
base64Binary
Content of the email template. Base 64-encoded binary data. Prior to making
an API call, client applications must encode the binary attachment data as base64.
Upon receiving a response, client applications must decode the base64 data to
binary. This conversion is usually handled for you by a SOAP client. This field
contains:
Binary content of the email body if type is set to text
HTML email content if type is set to html
HTML body if type is set to custom
Visualforce body if type is set to visualforce
This field is inherited from the MetadataWithContent component.
description
string
The email template description. This can be useful to describe the reason for
creating the template.
encodingKey
Encoding (enumeration
of type string)
315
Metadata Types
Field Name
EmailTemplate
Field Type
Description
ISO-2022-JPJapanese (JIS)
EUC-JPJapanese (EUC-JP)
x-SJIS_0213Japanese (Shift-JIS_2004)
ks_c_5601-1987Korean (ks_c_5601-1987)
Big5Traditional Chinese (Big5)
GB2312Simplified Chinese (GB2312)
Big5-HKSCSTraditional Chinese Hong Kong (Big5HKSCS)
fullName
string
The email template developer name used as a unique identifier for API access.
The fullName can contain only underscores and alphanumeric characters.
It must be unique, begin with a letter, not include spaces, not end with an
underscore, and not contain two consecutive underscores. If this field contained
characters before version 14.0 that are no longer allowed, the characters were
stripped out of this field, and the previous value of the field was saved in the
name field. This field is inherited from the Metadata component.
letterhead
string
The letterhead name associated with this email template. Only available when
type is set to html.
name
string
Required. Email template name. The list of characters allowed in the fullName
field has been reduced for versions 14.0 and later. This field contains the value
contained in the fullName field before version 14.0.
packageVersions
PackageVersion[]
The list of package versions for any managed packages containing components
that are referenced by this email template. This field is only relevant for Visualforce
email templates.
For more information about managed packages, see the Force.com Quick
Reference for Developing Packages. For more information about package
versions, see About Package Versions in the Salesforce online help. This field
is available in API version 16.0 and later.
style
EmailTemplateStyle
(enumeration of type
string)
Required. The style of the template. This field is only available when type is set
to html.
Valid style values include:
none
freeForm
formalLetter
promotionRight
promotionLeft
newsletter
products
subject
string
textOnly
string
316
Metadata Types
EmailTemplate
Field Name
Field Type
Description
type
EmailTemplateType
(enumeration of type
string)
Attachment
Attachment represents an email attachment.
Field
Field Type
Description
content
base64Binary
name
string
SEE ALSO:
Letterhead
317
Metadata Types
EntitlementProcess
EntitlementProcess
Represents the settings for an entitlement process. This type extends the Metadata metadata type and inherits its fullName field.
Version
Entitlement processes are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
active
boolean
businessHours
string
description
string
entryStartDateField
string
exitCriteriaBooleanFilter string
exitCriteriaFilterItems FilterItem[]
318
Metadata Types
EntitlementProcess
Field Name
Field Type
Description
exitCriteriaFormula
string
isVersionDefault
boolean
milestones
EntitlementProcessMilestoneItem[]
name
string
versionMaster
string
versionNotes
string
versionNumber
int
EntitlementProcessMilestoneItem
Represents a milestone item on an entitlement process.
Fields
Field Name
Field Type
Description
businessHours
string
criteriaBooleanFilter
string
milestoneCriteriaFilterItems FilterItem[]
milestoneCriteriaFormula string
milestoneName
string
319
Metadata Types
EntitlementProcess
Field Name
Field Type
Description
minutesCustomClass
string
minutesToComplete
int
successActions
WorkflowActionReference[]
timeTriggers
useCriteriaStartTime
boolean
EntitlementProcessMilestoneTimeTrigger
Represents the time trigger on an entitlement process milestone.
Fields
Field Name
Field Type
actions
WorkflowActionReference[] The actions to take when the time trigger is reached, if, at that time,
the milestone is not completed.
timeLength
int
workflowTimeTriggerUnit MilestoneTimeUnits
(enumeration of type
string)
Description
The length of time between the time trigger activation and the
milestone target completion date. This may be a negative or positive
value. Negative values indicate that the target completion date has
not yet arrived and correspond to warning time triggers. Positive
values indicate that the target completion date has passed and
correspond to violation time triggers.
Specifies the type of unit used to determine when a workflow should
be triggered. Valid values are:
Minutes
Hours
Days
320
Metadata Types
EntitlementProcess
<entryStartDateField>SlaStartDate</entryStartDateField>
<exitCriteriaBooleanFilter>1 OR 2</exitCriteriaBooleanFilter>
<exitCriteriaFilterItems>
<field>Case.IsClosed</field>
<operation>equals</operation>
<value>true</value>
</exitCriteriaFilterItems>
<exitCriteriaFilterItems>
<field>Case.Description</field>
<operation>startsWith</operation>
<value>foo</value>
</exitCriteriaFilterItems>
<milestones>
<milestoneName>m1</milestoneName>
<minutesToComplete>1</minutesToComplete>
<successActions>
<name>emailBob</name>
<type>Alert</type>
</successActions>
<timeTriggers>
<actions>
<name>emailAlice</name>
<type>Alert</type>
</actions>
<actions>
<name>setEscalateToTrue</name>
<type>FieldUpdate</type>
</actions>
<timeLength>1</timeLength>
<workflowTimeTriggerUnit>Minutes</workflowTimeTriggerUnit>
</timeTriggers>
<timeTriggers>
<actions>
<name>setStopToTrue</name>
<type>FieldUpdate</type>
</actions>
<timeLength>2</timeLength>
<workflowTimeTriggerUnit>Minutes</workflowTimeTriggerUnit>
</timeTriggers>
<useCriteriaStartTime>false</useCriteriaStartTime>
</milestones>
<milestones>
<milestoneCriteriaFilterItems>
<field>Case.Priority</field>
<operation>equals</operation>
<value>High</value>
</milestoneCriteriaFilterItems>
<milestoneName>m2</milestoneName>
<minutesToComplete>120</minutesToComplete>
<useCriteriaStartTime>true</useCriteriaStartTime>
<successActions>
<name>emailBob</name>
<type>Alert</type>
</successActions>
321
Metadata Types
EntitlementTemplate
</milestones>
</EntitlementProcess>
EntitlementTemplate
Represents an entitlement template. Entitlement templates are predefined terms of customer support that you can quickly add to
products. For example, you can create entitlement templates for Web or phone support so that users can easily add entitlements to
products offered to customers. EntitlementTemplate extends the Metadata metadata type and inherits its fullName field.
Version
Force.com EntitlementTemplate components are available in API version 18.0 and higher.
Fields
Field
Field Type
Description
businessHours
string
casesPerEntitlement
int
entitlementProcess
string
isPerIncident
boolean
term
int
type
string
322
Metadata Types
EscalationRules
EscalationRules
Represents case escalation rules to escalate cases automatically if they are not resolved within a certain period of time. You can access
rules metadata for all applicable objects, for a specific object, or for a specific rule on a specific object. The package.xml syntax for
accessing all escalation rules for all objects is:
<types>
<members>*</members>
<name>EscalationRules</name>
</types>
All rules for a specific object uses a similar syntax without the wildcard. For example, all escalation rules for the Case object would use
this syntax:
<types>
<members>Case</members>
<name>EscalationRules</name>
</types>
You can also access specific escalation rules for an object. The following example only accesses the samplerule and newrule escalation
rules on the Case object. Notice that for this example the type name syntax is EscalationRule and not EscalationRules.
<types>
<members>Case.samplerule</members>
<members>Case.newrule</members>
<name>EscalationRule</name>
</types>
Version
EscalationRules components are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
escalationRule
EscalationRule[]
323
Metadata Types
EscalationRules
EscalationRule
Field Name
Field Type
Description
active
boolean
fullname
string
RuleEntry[]
Field Name
Field Type
Description
booleanFilter
string
businessHours
string
businessHoursSource
ruleEntry
RuleEntry
Represents the fields used by the rule.
None
Case
Static
criteriaItems
FilterItem
disableEscalationWhenModified boolean
escalationAction
EscalationAction[] on The actions to perform when the escalation criteria are met.
page 325
escalationStartTime
EscalationStartTimeType Indicates the start time for the escalation. Valid values are:
CaseCreation
CaseLastModified
formula
string
324
Metadata Types
EscalationRules
EscalationAction
Describes the action to take for an escalation rule.
Field Name
Field Type
Description
assignedTo
string
assignedToTemplate
string
assignedToType
User
Queue
minutesToEscalation
int
notifyCaseOwner
boolean
notifyEmail
string
notifyTo
string
notifyToTemplate
string
325
Metadata Types
ExternalDataSource
</escalationRule>
</EscalationRules>
ExternalDataSource
Represents the metadata associated with an external data source. Create external data sources to manage connection details for
integration with data and content that are stored outside your Salesforce org.
This type extends the Metadata metadata type and inherits its fullName field.
Version
ExternalDataSource components are available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
authProvider
string
certificate
string
customConfiguration
string
endpoint
string
isWritable
boolean
Allows users to create, update, or delete external object records for this
data source from within Salesforce. By default, external objects are
326
Metadata Types
Field Name
ExternalDataSource
Field Type
Description
read-only. Corresponds to Allow Create, Edit, and
Delete in the user interface.
Writable external objects arent supported with the Salesforce adapter
for Lightning Connect.
label
string
A user-friendly name for the external data source. The label is displayed
in the Salesforce user interface, such as in list views.
Examples include Acme Team Marketing Site, or Acme SharePoint.
oauthRefreshToken
string
The OAuth refresh token. Used to obtain a new access token for an end
user when a token expires.
oauthScope
string
oauthToken
string
password
string
principalType
External
Determines whether you're using one set or multiple sets of credentials
PrincipalType to access the external system. Corresponds to Identity Type in
(enumeration of
type string)
protocol
Authentication The authentication protocol thats required to access the external system.
The valid values are:
Protocol
(enumeration of
type string)
NoAuthentication
Oauth
Password
For cloud-based Files Connect external systems, select Oauth 2.0. For
on-premises systems, select Password Authentication.
For Simple URL data sources, select No Authentication.
repository
string
type
ExternalData For Lightning Connect, specifies the adapter that connects to the external
system. The valid values are:
SourceType
(enumeration of
type string)
Used for SharePoint Online. If metadata is not accessible, use this field
to create tables and default table fields.
327
Metadata Types
Field Name
ExternalDataSource
Field Type
Description
ApexClassIdDataSource.Provider class that defines
the custom adapter created via the Apex Connector Framework
For Files Connect, specifies the data source type. The valid values are:
ContentHubSharepointSharePoint 2010 or 2013
ContentHubSharepointOffice365SharePoint Online
ContentHubSharepointOneDriveOneDrive for Business
ContentHubGDriveGoogle Drive
If Chatter is enabled, you can also specify SimpleURL to access data
hosted on a web server that doesnt require authentication.
The Identity and Wrapper types are reserved for future use.
username
string
version
string
customConfiguration
The following sample JSON-encoded configuration string defines parameters that apply when the external data sources type is set
to SfdcOrg.
{"apiVersion":"32.0","environment":"CUSTOM",
"searchEnabled":"true","timeout":"120"}
customConfiguration
The following JSON-encoded configuration string defines parameters that apply when the external data sources type is set to OData
or OData4.
{"inlineCountEnabled":"true","csrfTokenName":"X-CSRF-Token",
"requestCompression":"false","pagination":"CLIENT",
"noIdMapping":"false","format":"ATOM",
"searchFunc":"","compatibility":"DEFAULT",
"csrfTokenEnabled":"true","timeout":"120",
"searchEnabled":"true"}
328
Metadata Types
FlexiPage
compatibilitySpecial Compatibility
csrfTokenEnabledCSRF Protection
csrfTokenNameAnti-CSRF Token Name
formatFormat
inlineCountEnabledRequest Row Counts
noIdMappingHigh Data Volume
paginationServer Driven Pagination
requestCompressionCompress Requests
searchEnabledInclude in Salesforce Searches
searchFuncCustom Query Option for Salesforce Search
timeoutConnection Timeout
customConfiguration
The following sample JSON-encoded configuration string defines the parameter that applies when the external data sources type is
set to the ID of a DataSource.Provider class.
{"noIdMapping":"false"}
The noIdMapping parameter corresponds to the High Data Volume field in the user interface.
FlexiPage
Represents the metadata associated with a Lightning Page. A Lightning Page is the home page for an app that appears as a menu item
in the Salesforce1 navigation menu. This type extends the Metadata metadata type and inherits its fullName field.
Note: These app pages are known as FlexiPages in the API, but are referred to as Lightning Pages in the rest of the Salesforce
documentation and UI.
For more information on Lightning Pages, see the Salesforce Help.
329
Metadata Types
FlexiPage
Note: The FlexiPage component is supported only in Salesforce1. For more information about Salesforce1, see the Salesforce
Help.
Version
FlexiPage components are available in API version 29.0 and later.
Fields
Field Name
Field Type
Description
description
string
flexiPageRegions
FlexiPageRegion[]
masterLabel
string
pageTemplate
string
parentFlexiPage
string
platformActionList
PlatformActionList
quickActionList
QuickActionList
sobjectType
string
type
FlexiPageType (enumeration Required. The type of a page. In API version 32.0, this field can
of type string)
only have a value of AppPage.
Valid values are:
AppPageA Lightning Page used as the home page
for a custom app.
This field is available in API version 32.0 and later.
330
Metadata Types
FlexiPage
FlexiPageRegion
FlexiPage Region represents the properties of a region of a page. A region can contain a record list component or a recent items
component that can be scoped to a set of entities.
Field Name
Field Type
Description
appendable
RegionFlagStatus
(enumeration of type string)
componentInstances
ComponentInstance[]
mode
FlexiPageRegionMode
(enumeration of type string)
name
string
prependable
RegionFlagStatus
(enumeration of type string)
replaceable
RegionFlagStatus
(enumeration of type string)
type
FlexiPageRegionType
(enumeration of type string)
331
Metadata Types
FlexiPage
ComponentInstance
Instance of a component in a page, such as a filter list.
Field Name
Field Type
Description
componentInstanceProperties ComponentInstanceProperty[]
componentName
string
ComponentInstanceProperty
Value of a single property in a component instance.
Field Name
Field Type
Description
name
string
value
string
When you give a standard label to a tab in a Tabs componentsuch as Activity, Collaborate, or Detailsand when the name field is
set to title, the value field uses a system-defined value instead of the label.
Standard.Tab.activity
Standard.Tab.collaborate
Standard.Tab.detail
Standard.Tab.feed
Standard.Tab.preview
Standard.Tab.relatedLists
For example, lets say you have a Lightning Page that contains a tab with the standard label Activity. If you query the definition that
page, you see the system-defined name of the tab, not the label, in value.
<componentInstances>
<componentInstanceProperties>
<name>title</name>
<value>Standard.Tab.activity</value>
</componentInstanceProperties>
<componentName>flexipage:tab</componentName>
</componentInstances>
PlatformActionList
PlatformActionList represents the list of actions, and their order, that display in the Salesforce1 action bar for the layout. Available in API
version 34.0 and later.
332
Metadata Types
FlexiPage
Field Name
Field Type
Description
actionListContext
PlatformActionListContext Required. The context of the action list. Valid values are:
(enumeration of
BannerPhoto
type string)
Chatter
Dockable
FeedElement
FlexiPage
Global
ListView
ListViewDefinition
ListViewRecord
Lookup
MruList
MruRow
ObjectHomeChart
Photo
Record
RecordEdit
RelatedList
RelatedListRecord
platformActionListItems
relatedSourceEntity
string
PlatformActionListItem
PlatformActionListItem represents an action in the PlatformActionList. Available in API version 34.0 and later.
Field Name
Field Type
Description
actionName
string
actionType
333
Metadata Types
Field Name
FlexiPage
Field Type
Description
ProductivityActionProductivity actions are predefined by
Salesforce and are attached to a limited set of objects. You cant edit or
delete productivity actions.
QuickActionA global or object-specific action.
StandardButtonA predefined Salesforce button such as New, Edit,
and Delete.
sortOrder
int
subtype
string
334
Metadata Types
Flow
</componentInstanceProperties>
<componentName>flexipage:recentItems</componentName>
</componentInstances>
<name>main</name>
</flexiPageRegions>
<masterLabel>My Travel, Inc.</masterLabel>
<quickActionList>
<quickActionListItems>
<quickActionName>customAction1</quickActionName>
</quickActionListItems>
<quickActionListItems>
<quickActionName>customAction2</quickActionName>
</quickActionListItems>
</quickActionList>
</FlexiPage>
And, heres the sample package.xml file that references the FlexiPage component definition:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Travel, Inc.</fullName>
<types>
<members>TravelIncFlexiPage</members>
<name>CustomTab</name>
</types>
<types>
<members>TravelIncFlexiPage</members>
<name>FlexiPage</name>
</types>
<types>
<members>TravelIncQuickActions</members>
<name>QuickAction</name>
</types>
<version>29.0</version>
</Package>
Flow
Represents the metadata associated with a flow. With Flow, you can create an application that navigates users through a series of screens
to query and update records in the database. You can also execute logic and provide branching capability based on user input to build
dynamic applications. For information about the corresponding UI-based flow building tool, see Cloud Flow Designer in the Salesforce
Help.
When using the file-based Metadata API to work with flows, consider that:
You cant use Metadata API to access a flow installed from a managed package.
Flow filenames shouldnt contain spaces, which can cause errors at deployment. Heading and trailing spaces are allowed, but are
trimmed during deployment.
You cant overwrite an active flow or one that was once active when deploying a flow using Metadata API.
You can create a new version of a flow by giving the file a new version number and deploying it.
335
Metadata Types
Flow
Version
The flow Metadata API is available in API version 24.0 and later.
Flow
This metadata type represents a valid definition of a flow. This type extends the Metadata metadata type and inherits its fullName
field.
Field Name
Field Type
Description
actionCalls
FlowActionCall[]
apexPluginCalls
FlowApexPluginCall[]
assignments
FlowAssignment[]
choices
FlowChoice[]
constants
FlowConstant[]
An array of constants.
decisions
FlowDecision[]
description
string
dynamicChoiceSets
FlowDynamicChoiceSet[]
formulas
FlowFormula[]
An array of formulas.
fullName
string
336
Metadata Types
Flow
Field Name
Field Type
Description
interviewLabel
string
Label for the interview. This label helps users and administrators
differentiate interviews from the same flow.
In the user interface, this label appears in the Paused Flow
Interviews component on the users Home tab and in the Paused
and Waiting Interviews list on the flow management page.
label
string
loops
FlowLoop[]
processMetadataValues
FlowMetadataValue[]
processType
FlowProcessType (enumeration The type of the flow, as determined by the active version (or
of type string)
latest version, if theres no active version). Valid values are:
AutoLaunchedFlowA flow that doesnt require user
interaction
FlowA flow that requires user interaction because it
contains one or more screens, choices, or dynamic choices
These values are reserved for future use.
ActionPlan
JourneyBuilderIntegration
LoginFlow
Workflow
UserProvisioningFlow
Across versions, you can change the type from Flow to
AutoLaunchedFlow or vice versa.
This field is available in API version 31.0 and later.
recordCreates
FlowRecordCreate[]
recordDeletes
FlowRecordDelete[]
recordLookups
FlowRecordLookup[]
recordUpdates
FlowRecordUpdate[]
screens
FlowScreen[]
startElementReference
string
steps
FlowStep[]
subflows
FlowSubflow[]
textTemplates
FlowTextTemplate[]
337
Metadata Types
Flow
Field Name
Field Type
Description
variables
FlowVariable[]
waits
FlowWait[]
FlowActionCall
Defines a call to an action from the flow. It extends FlowNode.
Available in API version 31.0 and later.
Field Name
Field Type
Description
actionName
string
actionType
InvocableActionType (enumeration of type Required. The action type. Valid values are:
string)
apexinvokes an Apex method that has the
@invocableMethod annotation
chatterPostposts to Chatter
contentWorkspaceEnableFoldersenables
folders in a library
emailAlertsends an email by referencing a
workflow email alert
emailSimplesends an email by using flow
resources
quickActioninvokes a QuickAction
submitsubmits a record for approval
These values are reserved for future use.
flow
thanks
metricRefresh
connector
FlowConnector
faultConnector
FlowConnector
inputParameters
FlowActionCallInputParameter[]
outputParameters
FlowActionCallOutputParameter[]
FlowActionCallInputParameter
Defines an input parameter from the flow to the action. It extends FlowBaseElement and inherits all of its fields. Available in API version
31.0 and later.
338
Metadata Types
Flow
Field Name
Field Type
Description
name
string
value
FlowElementReferenceOrValue
FlowActionCallOutputParameter
Defines an output parameter from the action to the flow. It extends FlowBaseElement and inherits all of its fields. Available in API version
31.0 and later.
Field Name
Field Type
Description
assignToReference
string
name
string
FlowApexPluginCall
Defines a call to an Apex plug-in from the flow. It extends FlowNode and inherits all of its fields.
Field Name
Field Type
Description
apexClass
string
connector
FlowConnector
faultConnector
FlowConnector
inputParameters
FlowApexPluginCallInputParameter[]
outputParameters
FlowApexPluginCallOutputParameter[]
FlowApexPluginCallInputParameter
Defines an input parameter from the flow to the Apex plug-in. It extends FlowBaseElement and inherits all of its fields.
Field Name
Field Type
Description
name
string
value
FlowElementReferenceOrValue
FlowApexPluginCallOutputParameter
Defines an output parameter from the Apex plug-in to the flow. It extends FlowBaseElement and inherits all of its fields.
339
Metadata Types
Flow
Field Name
Field Type
Description
assignToReference
string
name
string
FlowAssignment
Defines an assignment node that can dynamically change the value of a variable in the flow. It extends FlowNode and inherits all of its
fields.
Field Name
Field Type
Description
assignmentItems
FlowAssignmentItem[]
connector
FlowConnector
FlowAssignmentItem
Defines an operation to apply to a variable. It extends FlowBaseElement and inherits all of its fields.
Field Name
Field Type
Description
assignToReference
string
operator
FlowAssignmentOperator
(enumeration of type string)
value
FlowElementReferenceOrValue
340
Metadata Types
Flow
FlowChoice
A choice resource is a standalone choice option that you can reference or reuse throughout the flow. It extends FlowElement and inherits
all of its fields.
Field Name
Field Type
Description
choiceText
string
dataType
userInput
FlowChoiceUserInput
value
FlowElementReferenceOrValue
FlowChoiceUserInput
Allows the choice to include a user input field that appears when the choice is selected by the user. User input isnt supported for choices
in multi-select fields. It extends FlowBaseElement and inherits all of its fields.
Field Name
Field Type
Description
isRequired
boolean
promptText
string
validationRule
FlowInputValidationRule
FlowCondition
Defines a condition for a rule. It extends FlowBaseElement and inherits all of its fields.
Field Name
Field Type
Description
leftValueReference
string
operator
FlowComparisonOperator
(enumeration of type string)
341
Metadata Types
Flow
Field Name
Field Type
Description
NotEqualTo
GreaterThan
LessThan
GreaterThanOrEqualTo
LessThanOrEqualTo
StartsWith
EndsWith
Contains
IsNull
WasSetThis value is available in API version 30.0 and
later.
WasSelectedRequires a choice on the left side.
WasVisitedRequires a node on the left side.
FlowElementReferenceOrValue
rightValue
FlowConnector
Connectors determine the order in which the nodes of the flow are executed. A connector defines and links to the subsequent node. It
extends FlowBaseElement and inherits all of its fields.
Field Name
Field Type
Description
targetReference
string
FlowConstant
A constant resource defines a fixed value that can be used throughout your flow. It extends FlowElement and inherits all of its fields.
Field Name
Field Type
Description
dataType
342
Metadata Types
Flow
Field Name
Field Type
Description
value
FlowElementReferenceOrValue
Default value of the constant. This field can't have merge fields, nor
can it reference another resource besides
$GlobalConstant.EmptyString.
FlowDecision
Decision node that evaluates a set of rules and routes the flow execution based on the first rule that evaluates to true. It extends FlowNode
and inherits all of its fields.
Field Name
Field Type
Description
defaultConnector
FlowConnector
defaultConnectorLabel
string
rules
FlowRule[]
An array of rules for the decision. The rules are evaluated in the
order they're listed, and the connector of the first true rule is used.
If no rules are true, then the default connector is used. In the Cloud
Flow Designer, rules are referred to as outcomes.
FlowDynamicChoiceSet
Looks up data or metadata from an sObject and dynamically generates a set of choices at run time. It extends FlowElement and inherits
all of its fields. Depending on the fields that are set, this element represents either a record choice or a picklist choice.
A record choice dynamically generates choices based on records that meet specified filter criteria. If a dynamic choice doesnt have
the picklistField and picklistObject parameters set, it is a record choice and cant have a data type of Picklist
or Multipicklist.
A picklist choice dynamically generates choices based on the available values for a picklist or multi-select picklist field. If a dynamic
choice has the picklistField and picklistObject parameters set, it is a picklist choice and must have a data type of
Picklist or Multipicklist.
Note: You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant
be used in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
dataType
343
Metadata Types
Field Name
Flow
Field Type
Description
Picklist and Multipicklist are available in API
string
filters
FlowRecordFilter[]
limit
int
object
string
outputAssignments
FlowOutputFieldAssignment[]
picklistField
string
344
Metadata Types
Field Name
Flow
Field Type
Description
This field is available in API version 35.0 and later.
picklistObject
string
sortField
string
Field that is used for sorting the records that meet the filter
criteria. If this field isnt specified then the returned records
are not sorted.
You can only sort records by fields that have the Sort API
field property, as specified in SOAP API.
Not supported for picklist choices.
This field is available in API version 25.0 and later.
sortOrder
SortOrder (enumeration of type string) Order in which to sort the records. If this field isnt specified,
then the results are not sorted.
Valid values are:
AscAscending
DescDescending
Not supported for picklist choices.
This field is available in API version 25.0 and later.
valueField
string
Stored value for the choice, which may differ from what is
displayed to the user as the choice options
(displayField). For example, the displayField
may be the account Name while the valueField is the
account Id.
Not supported for picklist choices. Picklist choices always
store the API value for the retrieved picklist values.
FlowElement
Base class for all flow elements. This is an abstract class. It extends FlowBaseElement and inherits all of its fields.
Field Name
Field Type
Description
description
string
name
string
345
Metadata Types
Flow
FlowBaseElement
Base class for all flow elements that require contextual information in metadata values. This is an abstract class. FlowBaseElement is
available in API version 32.0 and later.
Field Name
Field Type
Description
processMetadataValues
FlowMetadataValue[]
FlowMetadataValue
Defines contextual information that can be passed between elements in a flow. Flow metadata values can be used in an application
that produces or consumes flows. FlowMetadataValue is available in API version 32.0 and later.
Field Name
Field Type
Description
name
string
Required. Name for the metadata value. This name doesnt need
to be unique across all elements.
value
FlowElementReferenceOrValue
Defines a reference to an existing element or a particular value that you specify. Make sure that you specify only one of the fields.
Field Name
Field Type
Description
booleanValue
boolean
Use this field to specify a boolean value. Do not use this field if you want to
specify a different data type or an element reference.
dateTimeValue
dateTime
Use this field to specify a dateTime value. Do not use this field if you want to
specify a different data type or an element reference. This field is available in API
version 30.0 and later.
dateValue
date
Use this field to specify a date value. Do not use this field if you want to specify
a different data type or an element reference.
elementReference
string
Use this field to specify the name of an existing element. Do not use this field if
you want to specify a value instead of an element reference.
numberValue
double
Use this field to specify a double value. Do not use this field if you want to specify
a different data type or an element reference.
stringValue
string
Use this field to specify a string value. Do not use this field if you want to specify
a different data type or an element reference.
FlowFormula
Calculates a value using functions and elements in the flow. It extends FlowElement and inherits all of its fields.
346
Metadata Types
Flow
Field Name
Field Type
Description
dataType
FlowDataType (enumeration The data type for the formula. Valid values are:
of type string)
Boolean
Currency
Date
DateTime
Number
String
dataType defaults to Number if it isnt defined in a formula.
expression
int
scale
FlowInputFieldAssignment
Assigns the value for a record field based on a resource or static value. It extends FlowBaseElement and inherits all of its fields.
Note: You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant
be used in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
field
string
value
FlowElementReferenceOrValue
FlowInputValidationRule
Validation rules verify that the data entered by the user meets the specified requirements. If the validation rule evaluates to false, then
the specified error message is displayed.
Field Name
Field Type
Description
errorMessage
string
formulaExpression
string
347
Metadata Types
Flow
FlowLoop
A construct for iterating through a collection. It extends FlowNode and inherits all of its fields. FlowLoop is available in API version 30.0
and later.
Field Name
Field Type
Description
nextValueConnector
FlowConnector
Points to the element that the flow navigates to for each of the entries in the
collection. This is where the flow goes for the next value in the collection.
noMoreValuesConnector FlowConnector
Points to the element to navigate to when all entries in the collection have been
looped through.
collectionReference string
assignNextValueToReference string
Required. The variable to which the current value in the collection is assigned
before navigating to the target of nextValueConnector.
iterationOrder
iterationOrder
(enumeration of
type string)
FlowNode
A node is a type of element that is visible in the flow diagram. It extends FlowElement and inherits all of its fields.
Field Name
Field Type
Description
label
string
Required. Name of the node. This non-unique label is different from the unique
name of the node, which is inherited from FlowElement.
locationX
int
locationY
int
FlowOutputFieldAssignment
Assigns an record fields value from a record to a variable that can be used elsewhere in the flow. The record may be selected by a record
lookup or via a user selection for a choice. It extends FlowBaseElement and inherits all of its fields.
Note: You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant
be used in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
assignToReference
string
348
Metadata Types
Flow
Field Name
Field Type
Description
field
string
FlowRecordCreate
Create a new record in the database using values from the flow. It extends FlowNode and inherits all of its properties.
Note: The flow record create, lookup, update, and delete operations are different from the CRUD-based metadata calls create(),
retrieve(), update(), and delete(). The flow record methods apply to record operations from within a flow, which
arent the same as doing any metadata calls to CRUD setup entities.
You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant be used
in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
assignRecordIdToReference string
connector
FlowConnector
faultConnector
FlowConnector
inputAssignments
FlowInputFieldAssignment[]
object
string
inputReference
string
FlowRecordDelete
Deletes one or more records in the database. It extends FlowNode and inherits all of its fields.
Note: The flow record create, lookup, update, and delete operations are different from the CRUD-based metadata calls create(),
retrieve(), update(), and delete(). The flow record methods apply to record operations from within a flow, which
arent the same as doing any metadata calls to CRUD setup entities.
You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant be used
in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
connector
FlowConnector
faultConnector
FlowConnector
349
Metadata Types
Flow
Field Name
Field Type
Description
filters
FlowRecordFilter[]
An array that specifies the criteria used to select which records to delete
from the database. For example, you may want to delete accounts whose
last activity was older than a specified date.
object
string
inputReference
string
FlowRecordFilter
Sets the criteria for searching records in the database. It extends FlowBaseElement and inherits all of its fields.
Note: You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant
be used in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
field
string
operator
value
FlowElementReferenceOrValue
Reference or value used with the field and operator to filter records.
FlowRecordLookup
Finds a record in the database and uses or stores the values from its fields in the flow. It extends FlowNode and inherits all of its fields.
Note: The flow record create, lookup, update, and delete operations are different from the CRUD-based metadata calls create(),
retrieve(), update(), and delete(). The flow record methods apply to record operations from within a flow, which
arent the same as doing any metadata calls to CRUD setup entities.
You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant be used
in record filters, in input or output field assignments, or as display, value, or sort fields.
350
Metadata Types
Field Name
Flow
Field Type
Description
assignNullValuesIfNoRecordFound boolean
Specifies that all values are set to null if the record is not
found. This field is available in API version 30.0 and later.
connector
FlowConnector
faultConnector
FlowConnector
filters
FlowRecordFilter[]
limit
int
object
string
outputAssignments
FlowOutputFieldAssignment[]
outputReference
string
queriedFields
string[]
sortField
string
Field that is used for sorting the records that meet the filter
criteria. If this field isnt specified then the returned records
are not sorted.
You can only sort records by fields that have the Sort API
field property, as specified in SOAP API.
This field is available in API version 25.0 and later.
sortOrder
351
Metadata Types
Flow
FlowRecordUpdate
Finds records in the database and updates them with values from the flow. It extends FlowNode and inherits all of its fields.
Note: The flow record create, lookup, update, and delete operations are different from the CRUD-based metadata calls create(),
retrieve(), update(), and delete(). The flow record methods apply to record operations from within a flow, which
arent the same as doing any metadata calls to CRUD setup entities.
You cant reference sObject custom fields of type Geolocation anywhere in a flow. For example, Geolocation fields cant be used
in record filters, in input or output field assignments, or as display, value, or sort fields.
Field Name
Field Type
Description
connector
FlowConnector
faultConnector
FlowConnector
filters
FlowRecordFilter[]
inputAssignments
FlowInputFieldAssignment[]
object
string
inputReference
string
FlowRule
Defines the conditions and logic that would enable a rule to evaluate to true. It extends FlowElement and inherits all of its fields.
Field Name
Field Type
Description
conditionLogic
string
conditions
FlowCondition[]
connector
FlowConnector
Specifies which node to execute if this is the first rule that evaluates
to true in a decision.
352
Metadata Types
Flow
Field Name
Field Type
Description
label
string
FlowScreen
Screens provide the ability to capture information from users and display information to users. It extends FlowNode and inherits all of
its fields.
Field Name
Field Type
Description
allowBack
boolean
allowFinish
boolean
allowPause
boolean
353
Metadata Types
Flow
Field Name
Field Type
Description
connector
FlowConnector
fields
FlowScreenField[]
helpText
string
Text that appears if the end user clicks the Help for this form link.
Supports merge fields in API version 26.0 and later.
pausedText
string
FlowScreenField
Configurable field on a screen. It extends FlowElement and inherits all of its fields.
Field Name
Field Type
Description
choiceReferences
string[]
dataType
FlowDataType (enumeration of type Required. Data type of this screen field. Only
string)
supported for the InputField, RadioButtons, and
DropdownBox screen field types. Valid types
are:
Currency
Date
Number
String
Boolean
A boolean InputField appears as a checkbox
field at runtime. Checkbox input fields are
available in API version 26.0 and later.
354
Metadata Types
Field Name
Flow
Field Type
Description
Only the string data type is supported for
multi-select checkboxes and multi-select
picklist fields. Multi-select fields are available
in API version 26.0 and later.
defaultSelectedChoiceReference string
defaultValue
FlowElementReferenceOrValue
fieldText
string
fieldType
355
Metadata Types
Flow
Field Name
Field Type
Description
Multi-select checkboxes and multi-select
picklist fields are available in API version 26.0
and later.
string
helpText
isRequired
boolean
scale
int
validationRule
FlowInputValidationRule
FlowStep
Steps function as placeholders when you're building a flow. It extends FlowNode and inherits all of its fields.
Field Name
Field Type
Description
connectors
FlowConnector[]
FlowSubflow
A subflow element references another flow, which it calls at run time. The flow that contains the subflow element is referred to as the
master flow. FlowSubflow extends FlowNode and inherits all of its fields. It is available in API version 25.0 and later.
Field Name
Field Type
Description
connector
FlowConnector
flowName
string
inputAssignments
FlowSubflowInputAssignment[]
outputAssignments
FlowSubflowOutputAssignment[]
356
Metadata Types
Flow
FlowSubflowInputAssignment
Assigns an element or value from the master flow to a variable in the referenced flow. Input assignments occur when the subflow calls
the referenced flow. It extends FlowBaseElement and inherits all of its fields. It is available in API version 25.0 and later.
Field Name
Field Type
Description
name
string
value
FlowElementReferenceOrValue
FlowSubflowOutputAssignment
Assigns the value of a variable from the referenced flow to a variable in the master flow. Output assignments occur when the referenced
flow is finished running. It extends FlowBaseElement and inherits all of its fields. It is available in API version 25.0 and later.
Field Name
Field Type
Description
assignToReference
string
name
string
FlowTextTemplate
Defines a text template that can be used throughout the flow. It extends FlowElement and inherits all of its fields.
Field Name
Field Type
Description
text
string
FlowVariable
Variables allow you to create updatable values to use in the flow. FlowVariable extends FlowElement and inherits all of its fields.
Field Name
Field Type
Description
dataType
357
Metadata Types
Field Name
Flow
Field Type
Description
PicklistThis value is available in
API version 34.0 and later.
String
sObject
isCollection
boolean
isInput
boolean
isOutput
boolean
358
Metadata Types
Field Name
Flow
Field Type
Description
Warning: Disabling input or output
access for an existing variable can
break the functionality of
applications and pages that call the
flow and access the variable. For
example, you can access variables
from URL parameters, Visualforce
controllers, subflows, and processes.
objectType
string
scale
int
value
FlowElementReferenceOrValue
FlowWait
Waits for one or more defined events to occur. FlowWait extends FlowNode and inherits all of its fields. FlowWait is available in API
version 32.0 and later.
Field Name
Field Type
Description
defaultConnector
FlowConnector
defaultConnectorLabel
string
faultConnector
FlowConnector
waitEvents
FlowWaitEvent[]
359
Metadata Types
Flow
FlowWaitEvent
An event that a FlowWait element is waiting for. FlowWaitEvent extends FlowElement and inherits all of its fields. FlowWaitEvent is
available in API version 32.0 and later.
Field Name
Field Type
Description
conditionLogic
string
conditions
FlowCondition
connector
FlowConnector
eventType
string
inputParameters
FlowWaitEventInputParameter[]
label
string
outputParameters
FlowWaitEventOutputParameter[]
360
Metadata Types
Flow
FlowWaitEventInputParameter
An input parameter for FlowWaitEvent. The parameters value is set by using values from the flow. It extends FlowBaseElement and
inherits all of its fields. FlowWaitEventInputParameter is available in API version 32.0 and later.
Field Name
Field Type
Description
name
string
value
FlowElementReferenceOrValue
FlowWaitEventOutputParameter
An output parameter for FlowWaitEvent. The parameters value is assigned to a variable in the flow so that it can be referenced in another
part of the flow. It extends FlowBaseElement and inherits all of its fields. FlowWaitEventOutputParameter is available in API version 32.0
and later.
Field Name
Field Type
Description
assignToReference
string
name
string
361
Metadata Types
Flow
<choiceText>Fair</choiceText>
<dataType>Number</dataType>
<value>
<numberValue>10.0</numberValue>
</value>
</choices>
<choices>
<name>Good</name>
<choiceText>Good</choiceText>
<dataType>Number</dataType>
<value>
<numberValue>15.0</numberValue>
</value>
</choices>
<description>Simple Flow app to calculate a Tip according to corporate
policies</description>
<formulas>
<name>fTipAmount</name>
<dataType>Number</dataType>
<expression>{!Bill_Amount} * {!Service_Quality} / 100</expression>
<scale>0</scale>
</formulas>
<formulas>
<name>fTotalAmount</name>
<dataType>Number</dataType>
<expression>{!fTipAmount} + {!Bill_Amount}</expression>
<scale>0</scale>
</formulas>
<label>Tip Calculator App</label>
<screens>
<name>Simple_Tip_Calculator</name>
<label>Simple Tip Calculator</label>
<locationX>513</locationX>
<locationY>112</locationY>
<connector>
<targetReference>TipAmount</targetReference>
</connector>
<fields>
<name>Bill_Amount</name>
<dataType>Currency</dataType>
<fieldText>Bill Amount</fieldText>
<fieldType>InputField</fieldType>
<isRequired>false</isRequired>
<scale>2</scale>
</fields>
<fields>
<name>Service_Quality</name>
<choiceReferences>Excellent</choiceReferences>
<choiceReferences>Good</choiceReferences>
<choiceReferences>Fair</choiceReferences>
<choiceReferences>Bad</choiceReferences>
<dataType>Number</dataType>
<fieldText>Service Quality</fieldText>
<fieldType>RadioButtons</fieldType>
362
Metadata Types
FlowDefinition
<isRequired>false</isRequired>
<scale>2</scale>
</fields>
</screens>
<screens>
<name>TipAmount</name>
<label>Tip Amount</label>
<locationX>518</locationX>
<locationY>266</locationY>
<fields>
<name>TipSUmmary</name>
<fieldText><TEXTFORMAT
LEADING="2"><P
ALIGN="LEFT"><FONT
FACE="Arial"
STYLE="font-size:12px"
COLOR="#000000"
LETTERSPACING="0"
KERNING="0">If you think the quality of
service is <FONT
KERNING="1">{!Service_Quality},
</FONT>for a meal of {!Bill_Amount} you should tip
{!fTipAmount}, so the total recommended amount should be
{!fTotalAmount}</FONT></P></TEXTFORMAT></fieldText>
<fieldType>DisplayText</fieldType>
</fields>
</screens>
<startElementReference>Simple_Tip_Calculator</startElementReference>
</Flow>
FlowDefinition
Represents the flow definitions description and active flow version number.
To activate a flow, modify the metadata object and set the activeVersionNumber to the version number to activate. To deactivate
an active flow version, set the activeVersionNumber to 0 (zero) or omit the value.
Version
FlowDefinition is available in API version 34.0 and later.
Field Name
Field Type
Description
activeVersionNumber
int
description
string
363
Metadata Types
Folder
Field Name
Field Type
Description
masterLabel
string
Folder
Represents a folder. This type extends the Metadata metadata type and inherits its fullName field. Four folder types currently exist
in Salesforce:
Document folder
Email folder
Report folder
Dashboard folder
Folder type names end with the Folder suffix. For example, the type name of an email folder is EmailFolder.
Version
Folders are available in API version 11.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
accessType
FolderAccessTypes Required. The type of access for this folder. Valid values are:
(enumeration of
Shared. This folder is accessible only by the specified set of users.
type string)
Public. This folder is accessible by all users, including portal users.
PublicInternal. This folder is accessible by all users, excluding
portal users. This setting is available for report and dashboard folders
in organizations with a partner portal or Customer Portal enabled.
Hidden. This folder is hidden from all users.
fullName
string
The name used as a unique identifier for API access. The fullName
can contain only underscores and alphanumeric characters. It must be
unique, begin with a letter, not include spaces, not end with an
364
Metadata Types
Field Name
Folder
Field Type
Description
underscore, and not contain two consecutive underscores. This field is
inherited from the Metadata component.
name
string
publicFolderAccess
PublicFolderAccess If Public is the value for accessType, this field indicates the type
(enumeration of
of access all users will have to the contents of the folder. Valid values
type string)
include:
ReadOnly. All users can read the contents of the folder, but no
user can change the contents.
ReadWrite. All users can read or change the contents of the
folder.
sharedTo
SharedTo
The following is an example of the sampleFolder-meta.xml metadata file for the sampleFolder document folder:
<?xml version="1.0" encoding="UTF-8"?>
<DocumentFolder xmlns="http://soap.sforce.com/2006/04/metadata">
<accessType>Public</accessType>
<name>sampleFolder</name>
<publicFolderAccess>ReadWrite</publicFolderAccess>
</DocumentFolder>
SEE ALSO:
Dashboard
Document
EmailTemplate
Report
365
Metadata Types
FolderShare
FolderShare
Represents the settings for enhanced analytics folder sharing. Users can control access to reports or dashboards by giving others Viewer,
Editor or Manager access to the folder that contains the report or dashboard.
Version
FolderShare components are available in API version 28 and later.
Fields
Field Name
Field Type
Description
accessLevel
FolderShareAccessLevel
(enumeration of type string)
sharedTo
string
Required. Specifies the user, group, or role that has the specified access
level to the folder.
sharedToType
FolderSharedToType(enumeration Required. Specifies the type of entity that the folder is shared with.
of type string)
Valid values are:
Group. Users in a specified public group have the specified access
level to the folder.
Manager. Available in API version 29.0 and later.
ManagerAndSubordinatesInternal. Available in API
version 29.0 and later.
Role. Users with a specified role have the specified access level
to the folder.
RoleAndSubordinates. Users with a specified role, and users
with a role subordinate to that role, have the specified access level
to the folder.
366
Metadata Types
Field Name
FolderShare
Field Type
Description
RoleAndSubordinatesInternal. Users with a specified
role and users with a role subordinate to that role, except public
portal users, have the specified access level to the folder.
Organization. All internal users have the specified access level
to the folder.
Territory. Users in a specified territory have the specified
access level to the folder.
TerritoryAndSubordinates. Users in a specified territory,
and users in territories subordinate to that, have the specified access
level to the folder.
AllPrmUsers. All PRM Portal users have the specified level of
access to the folder.
User. The specified individual user has the specified level of access
to the folder.
PartnerUser. The specified individual user of a partner portal
has the specified level of access to the folder.
AllCspUsers. All Customer Success Portal users have the
specified level of access to the folder.
CustomerPortalUser. The specified individual user of a
customer portal has the specified level of access to the folder.
PortalRole. Users with a specified role in a portal have the
specified access level to the folder.
PortalRoleAndSubordinates. Portal users with a specified
role, and portal users with a role subordinate to that role, have the
specified access level to the folder.
367
Metadata Types
Group
<sharedToType>Role</sharedToType>
</folderShares>
</ReportFolder>
Group
Represents a set of public groups, which can have users, roles, and other groups.
Version
Group components are available in API version 24.0 and later.
Fields
This metadata type represents the valid values that define a group:
Field Name
Field Type
Description
doesIncludeBosses
boolean
fullName
string
The unique identifier for API access. The fullName can contain only
underscores and alphanumeric characters. It must be unique, begin with
a letter, not include spaces, not end with an underscore, and not contain
two consecutive underscores. This field is inherited from the Metadata
component. Corresponds to Group Name in the user interface.
name
string
368
Metadata Types
HomePageComponent
HomePageComponent
Represents the metadata associated with a home page component. You can customize the Home tab to include components such as
sidebar links, a company logo, a dashboard snapshot, or custom components that you create. For more information, see Customizing
Home Tab Page Layouts in the Salesforce online help. This type extends the Metadata metadata type and inherits its fullName field.
Use to create, update, or delete home page component definitions.
Version
Home page components are available in API version 12.0 and later.
HomePageComponent
This metadata type represents the valid values that define a home page component:
Field Name
Field Type
Description
body
string
fullName
string
The name can only contain characters, letters, and the underscore (_)
character, must start with a letter, and cannot end with an underscore
or contain two consecutive underscore characters.
Inherited from the Metadata component, this field is not defined in the
WSDL for this component. It must be specified when creating, updating,
or deleting. See create() to see an example of this field specified for
a call.
height
int
Required for Visualforce Area components. Indicates the height (in pixels)
of the component.
This field is available in API version 31.0 and later.
links
string[]
page
string
This field is only available for Visualforce Area components and indicates
the API name of the Visualforce page that is associated with the
component.
This field is available in API version 31.0 and later.
369
Metadata Types
HomePageLayout
Field Name
Field Type
Description
pageComponentType
showLabel
boolean
This field is only available for Visualforce Area components and specifies
whether the component displays with a label (true) or not (false).
This field is available in API version 31.0 and later.
showScrollbars
boolean
This field is only available for Visualforce Area components and specifies
whether the component displays with scrollbars (true) or not (false).
This field is available in API version 31.0 and later.
width
PageComponentWidth This field is only available for HTML and Visualforce Area components,
(enumeration of type and indicates whether this is a narrow or wide home page component.
string)
Valid values are:
narrowComponents
wideComponents
SEE ALSO:
HomePageLayout
WebLink
HomePageLayout
Represents the metadata associated with a home page layout. You can customize home page layouts and assign the layouts to users
based on their user profile. For more information, see Customizing Home Tab Page Layouts in the Salesforce online help.
370
Metadata Types
InstalledPackage
Version
Home page components are available in API version 12.0 and later. This type extends the Metadata metadata type and inherits its
fullName field.
Fields
This metadata type represents the valid values that define a home page layout:
Field Name
Field Type
Description
fullName
string
The name can only contain characters, letters, and the underscore (_)
character, must start with a letter, and cannot end with an underscore
or contain two consecutive underscore characters.
Inherited from the Metadata component, this field is not defined in the
WSDL for this component. It must be specified when creating, updating,
or deleting. See create() to see an example of this field specified for
a call.
narrowComponents
string[]
The list of elements in the narrow column on the left side of the home
page.
wideComponents
string[]
The list of elements in the wide column on the right side of the home
page.
SEE ALSO:
HomePageComponent
WebLink
InstalledPackage
Represents a package to be installed or uninstalled. Deploying a newer version of a currently installed package upgrades the package.
371
Metadata Types
KeywordList
Note: You cant deploy a package along with other metadata types. Hence, InstalledPackage must be the only metadata
type specified in the manifest file.
Version
InstalledPackage is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
versionNumber
string
2.1.3).
password
string
KeywordList
Represents a list of keywords used in community moderation. This keyword list is a type of moderation criteria that defines offensive
language or inappropriate content that you dont want in your community. This type extends the Metadata metadata type and inherits
its fullName field.
Keep the following things in mind when creating keyword list criteria:
Your organization can have up to 30 keyword list criteria. This limit is per organization, not per community.
A keyword list can have up to 2,000 keywords.
Capitalization and trailing punctuation are ignored when matching your keywords to user-generated content. For example, if your
criteria includes BadWord, its matched when a user types BADWORD or badword.
372
Metadata Types
KeywordList
Version
KeywordList components are available in API version 36.0 and later.
Fields
Field Name
Field Type
Description
Description
string
keywords
Keyword[]
masterLabel
string
Keyword
Keywords in the keyword list.
Field Name
Field Type
Description
keyword
string
373
Metadata Types
Layout
<keywords>
<keyword>b@dword</keyword>
</keywords>
</KeywordList>
Layout
Represents the metadata associated with a page layout. For more information, see Page Layouts in the Salesforce online help. This
type extends the Metadata metadata type and inherits its fullName field.
Note: To edit the Ideas layout, specify it by name in the package.xml file. In package.xml, use the following code to
retrieve the Ideas layout:
<types>
<members>Idea-Idea Layout</members>
<name>Layout</name>
</types>
Version
Layouts are available in API version 13.0 and later.
Fields
This metadata type represents the valid values that define a page layout.
Field Name
Field Type
Description
customButtons
string[]
374
Metadata Types
Layout
Field Name
Field Type
Description
customConsoleComponents
emailDefault
boolean
excludeButtons
string[]
FeedLayout
headers
LayoutHeader[]
Layout headers are currently only used for tagging, and
(enumeration of type string) only appear in the UI if tagging is enabled. For more
information, see Tags on Records in the Salesforce online
help. Valid string values are:
PersonalTaggingtag is private to user.
PublicTaggingtag is viewable any other user
who can access the record.
layoutSections
LayoutSection[]
miniLayout
MiniLayout
multilineLayoutFields
string[]
platformActionList
PlatformActionList
quickActionList
QuickActionList
relatedContent
RelatedContent
relatedLists
RelatedListItem[]
The related lists for the layout, listed in the order they
appear in the user interface.
375
Metadata Types
Layout
Field Name
Field Type
Description
relatedObjects
string[]
runAssignmentRulesDefault
boolean
Only relevant if
showRunAssignmentRulesCheckbox is set;
boolean
showHighlightsPanel
boolean
showInteractionLogPanel
boolean
showKnowledgeComponent
boolean
showRunAssignmentRulesCheckbox boolean
showSolutionSection
boolean
showSubmitAndAttachButton
boolean
CustomConsoleComponents
Represents custom console components (Visualforce pages, lookup fields, or related lists; Force.com Canvas apps not available) on a
page layout. Custom console components only display in the Salesforce console. Available in API version 25.0 and later.
Field Name
Field Type
Description
primaryTabComponents
subtabComponents
SubtabComponents
PrimaryTabComponents
Represents custom console components on primary tabs in the Salesforce console. Available in API version 25.0 and later.
376
Metadata Types
Layout
Field Name
Field Type
Description
component
containers
Container[]
Represents a location and style in which to display more than one custom
console component on the sidebars of the Salesforce console. You can
specify up to five components for each of the four locations (left, right,
top, and bottom). This field is available in API version 30.0 and later.
ConsoleComponent
Represents a custom console component (Visualforce page, lookup field, or related lists; Force.com Canvas apps not available) on a
section of a page layout. Custom console components only display in the Salesforce console. Available in API version 25.0 and later.
Field Name
Field Type
Description
height
int
location
string
visualforcePage
string
width
int
Required for components with a location of left or right. The width of the
custom console component. The value must be specified in pixels and
be greater than 0 but less than 999.
Container
Represents a location and style in which to display more than one custom console component in the sidebars of the Salesforce console.
For example, you can display multiple components in the right sidebar of the console with a style of either stack, tabs, or accordion.
Available in API version 30.0 and later.
Field Name
Field Type
Description
height
int
isContainerAutoSizeEnabled boolean
377
Metadata Types
Layout
Field Name
Field Type
Description
region
string
sidebarComponents
SidebarComponent[]
style
string
unit
string
width
int
Required for components with a location of right or left. The width of the
components container. The unit field determines the unit of
measurement, in pixels or percent.
SidebarComponent
Represents a specific custom console component to display in a container that hosts multiple components in one of the sidebars of the
Salesforce console. You can specify up to five components for each of the four container locations (left, right, top, and bottom). Available
in API version 30.0 and later.
Field Name
Field Type
Description
componentType
string
height
int
378
Metadata Types
Layout
Field Name
Field Type
Description
label
string
lookup
string
page
string
relatedlists
RelatedList[]
If the component is a related list, the name of the list. This field is available
in API version 31.0 and later.
unit
string
width
int
Required for components with a location of right or left. The width of the
component in the container. The unit field determines the unit of
measurement, in pixels or percent.
RelatedList
Represents related list custom components on the sidebars of the Salesforce console. Available in API version 31.0 and later.
Field Name
Field Type
Description
hideOnDetail
boolean
If set to true, the related list is hidden from detail pages where it
appears as a component to prevent duplicate information from showing.
name
string
SubtabComponents
Represents custom console components on subtabs in the Salesforce console. Available in API version 25.0 and later.
Field Name
Field Type
Description
component
containers
Container[]
Represents a location and style in which to display more than one custom
console component on the sidebars of the Salesforce console. You can
specify up to five components for each of the four locations (left, right,
top, and bottom). This field is available in API version 30.0 and later.
379
Metadata Types
Layout
FeedLayout
Represents the values that define the feed view of a feed-based page layout. Feed-based layouts are available on Account, Case, Contact,
Lead, Opportunity, and custom objects. They include a feed view and a detail view. Available in API version 30.0 and later.
Field Name
Field Type
Description
autocollapsePublisher
boolean
compactFeed
boolean
feedFilterPosition
FeedLayoutFilterPosition Where the feed filters list is included in the layout. Valid values are:
(enumeration of type centerDropDownas a drop-down list in the center column.
string)
leftFixedas a fixed list in the left column.
leftFloatas a floating list in the left column.
feedFilters
FeedLayoutFilter[]
fullWidthFeed
boolean
hideSidebar
boolean
leftComponents
FeedLayoutComponent[] The individual components displayed in the left column of the feed view.
rightComponents
FeedLayoutComponent[] The individual components displayed in the right column of the feed
view.
FeedLayoutComponent
Represents a component in the feed view of a feed-based page layout. Available in API version 30.0 and later.
Field Name
Field Type
Description
componentType
380
Metadata Types
Field Name
Layout
Field Type
Description
Topicsa list of topics related to the record.
Visualforcea custom Visualforce component.
height
int
page
string
FeedLayoutFilter
Represents a feed filter option in the feed view of a feed-based page layout. A filter must have only standardFilter or
feedItemType set. Available in API version 30.0 and later.
Field Name
Field Type
Description
feedFilterName
string
feedFilterType
FeedLayoutFilterType
(enumeration of type
string)
FeedItemType
(enumeration of type
string)
feedItemType
381
Metadata Types
Field Name
Layout
Field Type
Description
ChangeStatusPostfeed items for activity from the Change
Status action. Available only on Case layouts.
ChatTranscriptPostfeed items for activity related to
attaching Live Agent chat transcripts to cases. Available only on Case
layouts.
CollaborationGroupCreatedfeed items related to
creating a public group.
CollaborationGroupUnarchivedNot used.
ContentPostfeed items related to attaching a file to a post.
CreatedRecordEventfeed items related to creating a record
from the publisher.
DashboardComponentSnapshotfeed items related to
posting a dashboard snapshot on a feed.
EmailMessageEventfeed items for activity from the Email
action. Available only on Case layouts.
FacebookPostNot used.
LinkPostfeed items related to attaching a URL to a post.
MilestoneEventfeed items for changes to the milestone
status on a case. Available only on Case layouts.
PollPostfeed items related to posting a poll on a feed.
ProfileSkillPostfeed items related to skills added to a
users Chatter profile. This value is available in API version 31.0 and
later.
QuestionPostfeed items related to posting a question on a
feed. This value is available in API version 31.0 and later.
ReplyPostfeed items for activity from the Portal action.
Available only on Case layouts.
RypplePostfeed items related to creating a Thanks badge in
Work.com.
SocialPostfeed items for activity on Twitter from the Social
Post action.
TextPostfeed items for creating a text post from the publisher.
TrackedChangefeed items related to a change or group of
changes to a tracked field.
UserStatusNot used.
MiniLayout
Represents a mini view of a record in the Console tab, hover details, and event overlays.
382
Metadata Types
Layout
Field Name
Field Type
Description
fields
string[]
The fields for the mini-layout, listed in the order they appear in the UI.
Fields that appear here must appear in the main layout.
relatedLists
RelatedListItem[]
The mini related list, listed in the order they appear in the UI. You cannot
set sorting on mini related lists. Fields that appear here must appear in
the main layout.
LayoutSection
LayoutSection represents a section of a page layout, such as the Custom Links section.
Field Name
Field Type
Description
customLabel
boolean
detailHeading
boolean
Controls if this section appears in the detail page. In the UI, this setting
corresponds to the checkbox in the section details dialog.
editHeading
boolean
label
string
layoutColumns
LayoutColumn[]
style
LayoutSectionStyle
(enumeration of type
string)
summaryLayout
SummaryLayout
LayoutColumn
LayoutColumn represents the items in a column within a layout section.
Field Name
Field Type
Description
layoutItems
LayoutItem[]
383
Metadata Types
Layout
Field Name
Field Type
Description
reserved
string
This field is reserved for Salesforce. The field resolves an issue with some
SOAP libraries. Any value entered in the field is ignored.
LayoutItem
LayoutItem represents the valid values that define a layout item. An item must have only one of the following values set: component,
customLink, field, scontrol, page, analyticsCloudComponent, or reportChartComponent.
Field Name
Field Type
Description
behavior
UiBehavior (enumeration of type string) Determines the field behavior. Valid string values:
EditThe layout field can be edited but is not
required
RequiredThe layout field can be edited and is
required
ReadonlyThe layout field is read-only
canvas
string
component
string
customLink
string
emptySpace
boolean
field
string
height
int
page
string
analyticsCloudComponent AnalyticsCloudComponentLayoutItem Refers to a Wave Analytics dashboard that you can add
ReportChartComponentLayoutItem
scontrol
string
Reference to an s-control.
384
Metadata Types
Layout
Field Name
Field Type
Description
showLabel
boolean
showScrollbars
boolean
width
string
AnalyticsCloudComponentLayoutItem
Represents the settings for a Wave Analytics dashboard on a standard or custom page. Available in API version 34.0 and later.
Field Name
Field Type
Description
assetType
string
Required. Specifies the type of Wave Analytics asset to add. The available
asset type is dashboard.
devName
string
error
string
filter
string
height
int
hideOnError
boolean
Controls whether users see a dashboard that has an error. When this
attribute is set to true, if the dashboard has an error, the dashboard
doesnt appear on the page. When set to false, the dashboard appears
but doesnt show any data except the error. An error can happen when
a user doesnt have access to Wave Analytics or to the dashboard. The
default is true.
showTitle
boolean
width
string
ReportChartComponentLayoutItem
Represents the settings for a report chart on a standard or custom page.
385
Metadata Types
Layout
Field Name
Field Type
Description
cacheData
boolean
Indicates whether to use cached data when displaying the chart. When
the attribute is set to true, data is cached for 24 hours. If the attribute
is set to false, the report is run every time the page is refreshed.
This field is available in API version 29.0 and later.
contextFilterableField string
string
error
boolean
Controls whether users see a chart that has an error. When theres an
error and this attribute is not set, the chart doesnt show any data except
the error. An error can happen for many reasons, such as when a user
doesnt have access to fields used by the chart or a chart has been
removed from the report. Set the attribute to true to hide the chart
from a page on error.
This field is available in API version 29.0 and later.
includeContext
boolean
If true, filters the report chart to return data thats relevant to the page.
reportName
string
showTitle
boolean
size
ReportChartComponentSize The chart size is medium when no value is specified. Valid values:
(enumeration of type SMALL
string)
MEDIUM
LARGE
PlatformActionList
PlatformActionList represents the list of actions, and their order, that display in the Salesforce1 action bar for the layout. Available in API
version 34.0 and later.
Field Name
Field Type
Description
actionListContext
PlatformActionListContext Required. The context of the action list. Valid values are:
(enumeration of
BannerPhoto
type string)
Chatter
Dockable
FeedElement
386
Metadata Types
Layout
Field Name
Field Type
Description
FlexiPage
Global
ListView
ListViewDefinition
ListViewRecord
Lookup
MruList
MruRow
ObjectHomeChart
Photo
Record
RecordEdit
RelatedList
RelatedListRecord
platformActionListItems
relatedSourceEntity
string
PlatformActionListItem
PlatformActionListItem represents an action in the PlatformActionList. Available in API version 34.0 and later.
Field Name
Field Type
Description
actionName
string
actionType
387
Metadata Types
Layout
Field Name
Field Type
Description
sortOrder
int
subtype
string
QuickActionList
QuickActionList represents the list of actions associated with the page layout. Available in API version 28.0 and later.
Field Name
Field Type
Description
quickActionListItems
QuickActionListItem
QuickActionListItem represents an action in the QuickActionList. Available in API version 28.0 and later.
Field Name
Field Type
Description
quickActionName
string
RelatedContent
RelatedContent represents the Mobile Cards section of the page layout. Available in API version 29.0 and later.
Field Name
Field Type
Description
relatedContentItems
RelatedContentItem[] A list of layout items in the Mobile Cards section of the page layout.
RelatedContentItem
RelatedContentItem represents an individual item in the RelatedContentItem list. Available in API version 29.0 and later.
Field Name
Field Type
Description
layoutItem
LayoutItem
RelatedListItem
RelatedListItem represents a related list in a page layout.
388
Metadata Types
Layout
Field Name
Field Type
Description
customButtons
string[]
A list of custom buttons used in the related list. For more information,
see Define Custom Buttons and Links in the Salesforce online help.
excludeButtons
string[]
fields
string[]
relatedList
string
sortField
string
sortOrder
SortOrder
(enumeration of type
string)
SummaryLayout
Controls the appearance of the highlights panel, which summarizes key fields in a grid at the top of a page layout, when Case Feed is
enabled. Available in API version 25.0 and later.
Field Name
Field Type
Description
masterLabel
string
sizeX
int
sizeY
int
sizeZ
int
Reserved for future use. If provided, the setting is not visible to users.
summaryLayoutItems
SummaryLayoutItem[] Controls the appearance of an individual field and its column and row
position within the highlights panel grid, when Case Feed is enabled. At
least one is required.
summaryLayoutStyle
SummaryLayoutStyle
(enumeration of type
string)
389
Metadata Types
Layout
SummaryLayoutItem
Controls the appearance of an individual field and its column and row position within the highlights panel grid, when Case Feed is
enabled. You can have two fields per each grid in a highlights panel. Available in API version 25.0 and later.
Field Name
Field Type
Description
customLink
string
field
string
The field name reference, relative to the page layout. Must be a standard
or custom field that also exists on the detail page.
posX
int
Required. The item's column position in the highlights panel grid. Must
be within the range of sizeX.
posY
int
Required. The item's row position in the highlights panel grid. Must be
within the range of sizeY.
posZ
int
Reserved for future use. If provided, the setting is not visible to users.
390
Metadata Types
Layout
<layoutSections>
<editHeading>true</editHeading>
<label>Information</label>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
<field>Name</field>
</layoutItems>
<layoutItems>
<height>180</height>
<scontrol>LayoutSControl</scontrol>
<showLabel>true</showLabel>
<showScrollbars>true</showScrollbars>
<width>50%</width>
</layoutItems>
<layoutItems>
<reportChartComponent>
<contextFilterableField>CUST_ID</contextFilterableField>
<includeContext>true</includeContext>
<reportName>Open_Accounts_by_Cases</reportName>
<showTitle>false</showTitle>
<size>LARGE</size>
<reportChartComponent>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Edit</behavior>
<field>OwnerId</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>CurrencyIsoCode</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<editHeading>true</editHeading>
<label>System Information</label>
<layoutColumns>
<layoutItems>
<behavior>Readonly</behavior>
<field>CreatedById</field>
</layoutItems>
<layoutItems>
<behavior>Readonly</behavior>
<field>Alpha1__c</field>
</layoutItems>
<layoutItems>
<height>200</height>
<page>mcanvasPage</page>
<showLabel>true</showLabel>
<showScrollbars>false</showScrollbars>
391
Metadata Types
Layout
<width>100%</width>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Readonly</behavior>
<field>LastModifiedById</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>TextArea__c</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<customLabel>true</customLabel>
<detailHeading>true</detailHeading>
<label>Custom Links</label>
<layoutColumns>
<layoutItems>
<customLink>CustomWebLink</customLink>
</layoutItems>
</layoutColumns>
<style>CustomLinks</style>
</layoutSections>
<quickActionList>
<quickActionListItems>
<quickActionName>FeedItem.TextPost</quickActionName>
</quickActionListItems>
<quickActionListItems>
<quickActionName>FeedItem.ContentPost</quickActionName>
</quickActionListItems>
<quickActionListItems>
<quickActionName>FeedItem.LinkPost</quickActionName>
</quickActionListItems>
<quickActionListItems>
<quickActionName>FeedItem.PollPost</quickActionName>
</quickActionListItems>
</quickActionList>
<relatedContent>
<relatedContentItems>
<layoutItem>
<component>sfa:socialPanel</component>
</layoutItem>
<relatedContentItems>
</relatedContent>
<miniLayoutFields>Name</miniLayoutFields>
<miniLayoutFields>OwnerId</miniLayoutFields>
<miniLayoutFields>CurrencyIsoCode</miniLayoutFields>
<miniLayoutFields>Alpha1__c</miniLayoutFields>
<miniLayoutFields>TextArea__c</miniLayoutFields>
<miniRelatedLists>
<relatedList>RelatedNoteList</relatedList>
392
Metadata Types
Layout
</miniRelatedLists>
<relatedLists>
<fields>StepStatus</fields>
<fields>CreatedDate</fields>
<fields>OriginalActor</fields>
<fields>Actor</fields>
<fields>Comments</fields>
<fields>Actor.Alias</fields>
<fields>OriginalActor.Alias</fields>
<relatedList>RelatedProcessHistoryList</relatedList>
</relatedLists>
<relatedLists>
<relatedList>RelatedNoteList</relatedList>
</relatedLists>
</Layout>
393
Metadata Types
Letterhead
Letterhead
Represents formatting options for the letterhead in an email template. Letterheads define the look and feel of your HTML email templates.
Your HTML email templates can inherit the logo, color, and text settings from a letterhead. For more information, see Create a Letterhead
in the Salesforce online help. This type extends the Metadata metadata type and inherits its fullName field.
Version
Letterheads are available in API version 12.0 and later.
394
Metadata Types
Letterhead
Fields
With the exception of logo, and horizontal and vertical alignment, all of these fields are required.
Field Name
Field Type
Description
available
boolean
backgroundColor
string
bodyColor
string
bottomLine
Required. The style for the bottom line. Valid style values
include:
color. The color of the line in hexadecimal, as a string
value.
height. The height of the line, as an int value.
description
string
fullName
string
footer
LetterheadHeaderFooter
header
LetterheadHeaderFooter
middleLine
LetterheadLine
name
string
topLine
LetterheadLine
Required. The style for the top horizontal line below the
header. Valid style values include:
color. The color of the line in hexadecimal, as a string
value.
height. The height of the line, as an int value.
LetterheadHeaderFooter
LetterheadHeaderFooter represents the properties of a header or footer.
395
Metadata Types
Letterhead
Field
Field Type
Description
backgroundColor
string
height
DashboardComponent[]
horizontalAlignment
logo
string
verticalAlignment
LetterheadVerticalAlignment
(enumeration of type string)
LetterheadLine
LetterheadLine represents the properties of a line.
Field
Field Type
Description
color
string
height
int
396
Metadata Types
LiveChatAgentConfig
<horizontalAlignment>Left</horizontalAlignment>
<verticalAlignment>Top</verticalAlignment>
</footer>
<header>
<backgroundColor>#FFFFFF</backgroundColor>
<height>100</height>
<horizontalAlignment>Left</horizontalAlignment>
<verticalAlignment>Top</verticalAlignment>
</header>
<middleLine>
<color>#AAAAFF</color>
<height>5</height>
</middleLine>
<name>SimpleLetterheadLabel</name>
<topLine>
<color>#FF99FF</color>
<height>5</height>
</topLine>
</Letterhead>
LiveChatAgentConfig
Represents the configuration of an organizations Live Agent deployment, such as how many chats can be assigned to an agent and
whether or not chat sounds are enabled. This type extends the Metadata metadata type and inherits its fullName field.
Version
LiveChatAgentConfig is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
assignments
autoGreeting
string
capacity
int
397
Metadata Types
LiveChatAgentConfig
Field Name
Field Type
Description
criticalWaitTime
int
enableAgentSneakPeek
boolean
enableAssistanceFlag
boolean
enableAutoAwayOnDecline
boolean
enableAutoAwayOnPushTimeout
boolean
enableAgentFileTransfer
boolean
enableChatConferencing
boolean
enableChatTransfer
boolean
enableLogoutSound
boolean
enableNotifications
boolean
enableRequestSound
boolean
enableSneakPeek
boolean
enableVisitorBlocking
boolean
label
string
supervisorDefaultAgentStatusFilter SupervisorAgentStatusFilter Specifies the Live Agent status for filtering the Agent Status
(enumeration of type
string)
398
Metadata Types
LiveChatAgentConfig
Field Name
Field Type
Description
Away
Offline
Available in API version 29.0 and later.
supervisorDefaultButtonFilter string
Specifies the default button for filtering the Agent Status list
in the Supervisor Panel. Available in API version 29.0 and
later.
supervisorDefaultSkillFilter string
Specifies the default skill for filtering the Agent Status list in
the Supervisor Panel. Available in API version 29.0 and later.
supervisorSkills
transferableButtons
AgentConfigButtons
transferableSkills
AgentConfigSkills
Specifies the list of skill groups that agents can transfer chats
to. Available in API version 31.0 and later.
AgentConfigAssignments
Represents the assignments of an organizations profiles and users to a Live Agent configuration.
Fields
Field Name
Field Type
Description
profiles
AgentConfigProfileAssignments
users
AgentConfigUserAssignments
AgentConfigButtons
Represents the chat buttons that agents who are associated with the Live Agent configuration can transfer chats to.
Fields
Field Name
Field Type
Description
button
string[]
399
Metadata Types
LiveChatAgentConfig
AgentConfigProfileAssignments
Represents the profiles associated with a specific Live Agent configuration.
Fields
Field Name
Field Type
Description
profile
string
AgentConfigSkills
Represents the skill groups that agents who are associated with the Live Agent configuration can transfer chats to.
Fields
Field Name
Field Type
Description
skill
string[]
Specifies the skill groups that agents can transfer chats to.
AgentConfigUserAssignments
Represents the users associated with a specific Live Agent configuration.
Fields
Field Name
Field Type
Description
user
string
SupervisorAgentConfigSkills
Represents the agent skills associated with a supervisors Live Agent configuration. Available in API version 29.0 and later.
Fields
Field Name
Field Type
Description
skill
string
400
Metadata Types
LiveChatButton
LiveChatButton
Represents a Live Agent deployments settings for the button that customers click to chat with an agent and the chat window, such as
the label that appears on the button and the pre-chat form that appears before a live chat begins. This type extends the Metadata
metadata type and inherits its fullName field.
Version
LiveChatButton is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
chasitorIdleTimeout
int
401
Metadata Types
Field Name
LiveChatButton
Field Type
Description
chasitorIdleTimeoutWarning int
chatPage
string
enableQueue
boolean
label
string
numberOfReroutingAttempts int
offlineImage
string
onlineImage
string
optionsCustomRoutingIsEnabled boolean
optionsHasChasitorIdleTimeout boolean
optionsHasInviteAfterAccept boolean
optionsHasInviteAfterReject boolean
optionsHasRerouteDeclinedRequest boolean
boolean
optionsIsAutoAccept
402
Metadata Types
Field Name
LiveChatButton
Field Type
Description
optionsIsInviteAutoRemove boolean
overallQueueLength
int
perAgentQueueLength
int
postChatPage
string
postChatUrl
string
preChatFormPage
string
preChatFormUrl
string
pushTimeOut
int
routingType
LiveChatButtonRoutingType (enumeration
of type string)
site
string
skills
LiveChatButtonSkills
windowLanguage
Language
403
Metadata Types
LiveChatDeployment
LiveChatButtonSkills
Represents the skills associated with a chat button.
Fields
Field Name
Field Type
Description
skill
string
Note: If you update your chat button through the Metadata API, be sure to update all Web pages that use the same chat button
code.
LiveChatDeployment
Represents the configuration settings for a specific Live Agent deployment, such as the branding image for the deployment and whether
or not chat transcripts are automatically saved. This type extends the Metadata metadata type and inherits its fullName field.
404
Metadata Types
LiveChatDeployment
Version
LiveChatDeployment is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
brandingImage
string
displayQueuePosition
boolean
domainWhiteList
LiveChatDeploymentDomainWhiteList
enablePrechatApi
boolean
enableTranscriptSave
boolean
label
string
mobileBrandingImage
string
site
string
windowTitle
string
LiveChatDeploymentDomainWhiteList
Represents a Live Agent deployments domain whitelist.
405
Metadata Types
LiveChatSensitiveDataRule
Fields
Field Name
Field Type
Description
domain
string
Note: If you update your deployment through the Metadata API, be sure to update all Web pages that use the same deployment
code.
LiveChatSensitiveDataRule
Represents a rule for masking or deleting data of a specified pattern. Written as a regular expression (regex).
Use this object to mask or delete data of specified patterns, such as credit card, social security, phone and account numbers, or even
profanity. This type extends the Metadata metadata type and inherits its fullName field.
Version
LiveChatSensitiveDataRule components are available in API version 35.0 and later.
406
Metadata Types
LiveChatSensitiveDataRule
Fields
Field Name
Field Type
Description
actionType
SensitiveDataActionType Required. The action to take on the text when the sensitive data rule is
(enumeration of
triggered. Possbile values are:
type string)
Remove
Replace
description
string
enforceOn
int
Required. Determines the roles on which the rule is enforced. The value
is determined using bitwise OR operation. There are seven possible
values:
1. Rule enforced on Agent
2. Rule enforced on Visitor
3. Rule enforced on Agent and Visitor
4. Rule enforced on Supervisor
5. Rule enforced on Agent and Supervisor
6. Rule enforced on Visitor and Supervisor
7. Rule enforced on Agent, Visitor, and Supervisor
isEnabled
boolean
pattern
string
replacement
string
The string of characters that replaces the blocked text (if ActionType
Replace is selected).
407
Metadata Types
ManagedTopics
support.liveagent.testsuite.unifiedouting.testDeployButtonMDAPIWithExistingQueue -->
<apiAccessLevel>Unrestricted</apiAccessLevel>
<types>
<members>Change_For_all</members>
<name>LiveChatSensitiveDataRule</name>
</types>
<version>35.0</version>
</Package>
ManagedTopics
Represents navigational and featured topics managed in a community. A specific community is represented by the Network component.
Note: The related network must exist before you deploy managed topics. (This occurs automatically when deploying an entire
organization.)
Version
ManagedTopics components are available in API version 32.0 and later.
Fields
Field Name
Field Type
Description
ManagedTopic
ManagedTopic
ManagedTopic
Field Name
Field Type
Description
name
string
managedTopicType
string
topicDescription
string
parentName
string
The name of a parent topic for which this topic is a child. Child topics are
accessible from the subtopics section of the parent topic page and their
feeds are added to the parent topic feed.
Only navigational topics support parent-child relationships.
408
Metadata Types
ManagedTopics
Field Name
Field Type
Description
position
int
The placement of this topic relative to others of the same type. The results
differ depending on topic type:
For top-level navigational topics, position arranges the Topics
menu in the community.
For child navigational topics, it arranges sibling topics in the subtopics
section.
For featured topics, it arranges topic thumbnail images on the
community home page.
Enter a number between 0 and 24. (The maximum amount of navigational
or featured topics is 25.)
The following example shows a package.xml file referencing the ManagedTopics component:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>NetworkName</members>
<name>ManagedTopics</name>
</types>
<version>32.0</version>
</Package>
409
Metadata Types
MatchingRule
<parentName></parentName>
<position>1</position>
</ManagedTopic>
<ManagedTopic>
<name>Trails</name>
<managedTopicType>Navigational</managedTopicType>
<topicDescription>Maps for local favorites</topicDescription>
<parentName>Hiking</parentName>
<position>0</position>
</ManagedTopic>
<ManagedTopic>
<name>Backpacks</name>
<managedTopicType>Navigational</managedTopicType>
<topicDescription>Recommended models</topicDescription>
<parentName>Hiking</parentName>
<position>1</position>
</ManagedTopic>
<ManagedTopic>
<name>Footwear</name>
<managedTopicType>Featured</managedTopicType>
<topicDescription>Suggested types for each sport</topicDescription>
<parentName></parentName>
<position>0</position>
</ManagedTopic>
<ManagedTopic>
<name>Conditioning</name>
<managedTopicType>Featured</managedTopicType>
<topicDescription>How to get fit for any activity</topicDescription>
<parentName></parentName>
<position>1</position>
</ManagedTopic>
</ManagedTopics>
MatchingRule
Represents a matching rule that is used to identify duplicate records. This type extends the Metadata metadata type and inherits its
fullName field.
Version
MatchingRule is available in API version 33.0 and later.
410
Metadata Types
MatchingRule
Fields
Field Name
Field Type
Description
booleanFilter
string
Specifies filter logic conditions. For more information on filter logic, see
Getting the Most Out of Filter Logic in the Salesforce Help.
description
string
label
string
matchingRuleItems
MatchingRuleItem
ruleStatus
MatchingRuleStatus Required. The activation status of the matching rule. Values are:
(enumeration of
Inactive
type string)
Deactivating
DeactivationFailed
Active
Activating
ActivationFailed
Important: The only valid values you can declare when
deploying a package are Active and Inactive.
MatchingRuleItem
Field Name
Field Type
Description
blankValueBehavior
BlankValueBehavior Specifies how blank fields affect whether the fields being compared are
(enumeration of type considered matches. Valid values are:
string)
MatchBlanks
NullNotAllowed (default)
fieldName
string
matchingMethod
MatchingMethod
Required. Defines how the fields are compared. Choose between the exact
(enumeration of type matching method and various fuzzy matching methods. Valid values are:
string)
Exact
FirstName
LastName
CompanyName
Phone
City
Street
Zip
411
Metadata Types
Field Name
MatchingRule
Field Type
Description
Title
For details on each matching method, see Matching Methods Used with
Matching Rules in the Salesforce Help.
The following package.xml shows how to reference a matching rule by name. It specifies the type name of MatchingRule.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account.AccountMatchingRule</members>
<name>MatchingRule</name>
</types>
<version>36.0</version>
</Package>
The following package.xml shows how to reference all matching rules by specifying the plural MatchingRules type name and using
a wildcard to include all members.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>MatchingRules</name>
</types>
412
Metadata Types
Metadata
<version>36.0</version>
</Package>
Metadata
This is the base class for all metadata types. You cannot edit this object. A component is an instance of a metadata type.
Metadata is analogous to sObject, which represents all standard objects. Metadata represents all components and fields in Metadata
API. Instead of identifying each component with an ID, each custom object or custom field has a unique fullName, which must be
distinct from standard object names, as it must be when you create custom objects or custom fields in the Salesforce user interface.
Version
Metadata components are available in API version 10.0 and later.
Fields
Field Name
Field Type
Description
fullName
string
Required. The name of the component. If a field, the name must specify
the parent object, for example Account.FirstName. The __c suffix
must be appended to custom object names and custom field names
when you are setting the fullName. For example, a custom field in a
custom object could have a fullName of
MyCustomObject__c.MyCustomField__c.
To reference a component in a package, prepend the packages
namespace prefix to the component name in the fullName field. Use
the following syntax: namespacePrefix__ComponentName.
For example, for the custom field component
MyCustomObject__c.MyCustomField__c and the namespace
MyNS, the full name is
MyNS__MyCustomObject__c.MyCustomField__c.
Note: A namespace prefix is a 1 to 15-character alphanumeric
identifier that distinguishes your package and its contents from
other publishers packages. For more information, see Register a
Namespace Prefix in the Salesforce Help.
SEE ALSO:
CustomObject
CustomField
MetadataWithContent
413
Metadata Types
MetadataWithContent
MetadataWithContent
This is the base type for all metadata types that contain content, such as documents or email templates. It extends Metadata. You cannot
edit this object.
Version
MetadataWithContent components are available in API version 14.0 and later.
Fields
Field Name
Field Type
Description
content
base64Binary
fullName
string
SEE ALSO:
Metadata
MilestoneType
Represents the name and description of a milestone, which you can use in an entitlement process to track important steps in cases. This
type extends the Metadata metadata type and inherits its fullName field.
Version
MilestoneType is available in API version 27.0 and later.
414
Metadata Types
ModerationRule
Fields
Field Name
Field Type
Description
description
string
RecurrenceType
MilestoneTypeRecurrenceType The type of recurrence for the milestone. Available in API version 29.0
(enumeration of
type string)
And, heres the sample package.xml file that references the MilestoneType component definition:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>* or a valid name of a milestone type</members>
<name>MilestoneType</name>
</types>
<version>29.0</version>
</Package>
ModerationRule
Represents a rule used in your community to moderate user-generated content. Each rule specifies the user-generated content the rule
applies to, the criteria to enforce the rule on, and the moderation action to take. You can create rules that block, flag, or replace
user-generated content that contains offensive language or inappropriate content. This type extends the Metadata metadata type and
inherits its fullName field.
Community moderation rules created with the Metadata API are more powerful than moderation rules set up in the Community
Management UI. For example, in the UI you could create a rule that moderates posts and comments. In the Metadata API you could
create a rule that moderates only the Link Name of a Link feed type. Use the Metadata API to express complex moderation rules.
Important: Dont update moderation rules you create using the Metadata API in the Community Management UI. If you do, you
overwrite relevant Metadata API fields or the fields are ignored.
Keep the following things in mind when creating moderation rules:
415
Metadata Types
ModerationRule
Your organization can have up to 30 rules. This limit is per organization, not per community.
Each rule can have up to three criteria.
Rules that block content run first, followed by rules that replace content, then rules that flag content. If two or more rules perform
the same action, the oldest rule runs first.
Version
ModerationRule components are available in API version 36.0 and later.
Fields
Field Name
Field Type
Description
action
ModerationRuleAction Required. Indicates the moderation action that you want to take.
activate
boolean
description
string
entitiesAndFields
masterLabel
string
userMessage
string
The message you want your community members to see when their
content is blocked. Use the %BLOCKED_KEYWORD% variable to display
up to five blocked words in the user message. If you dont specify a
message, the user sees the standard message: You can't use
%BLOCKED_KEYWORD% or other inappropriate words in this
community. Review your content and try again.
ModerationRuleAction
The moderation action to take when your criteria is matched.
416
Metadata Types
Field Name
ModerationRule
Field Type
Description
ModerationRuleAction ModerationRuleAction Required. Indicates the moderation action to take when your criteria is matched.
ModeratedEntityField
The fields and entities you want to moderate.
Field Name
Field Type
Description
entityName
string
fieldName
string
keywordList
KeywordList string
417
Metadata Types
NamedCredential
<fieldName>LinkUrl</fieldName>
<keywordList>community1.badword_list</keywordList>
</entitiesAndFields>
<!-- Applies the rule to FeedItem.RawBody (an internal only field), if it contains words
from the keyword list specified -->
<entitiesAndFields>
<entityName>FeedItem</entityName>
<fieldName>RawBody</fieldName>
<keywordList>community1.badword_list</keywordList>
</entitiesAndFields>
<entitiesAndFields>
<entityName>FeedItem</entityName>
<fieldName>Title</fieldName>
<keywordList>community1.badword_list</keywordList>
</entitiesAndFields>
<entitiesAndFields>
<entityName>FeedPollChoice</entityName>
<fieldName>ChoiceBody</fieldName>
<keywordList>community1.badword_list</keywordList>
</entitiesAndFields>
</ModerationRule>
NamedCredential
Represents a named credential, which specifies the URL of a callout endpoint and its required authentication parameters in one definition.
A named credential can be specified as an endpoint to simplify the setup of authenticated callouts.
This type extends the Metadata metadata type and inherits its fullName field.
Version
NamedCredential components are available in API version 33.0 and later.
418
Metadata Types
NamedCredential
Fields
Field Name
Field Type
Description
authProvider
string
certificate
string
endpoint
string
The URL or root URL of the callout endpoint. Corresponds to URL in the
user interface.
label
string
oauthRefreshToken
string
The OAuth refresh token. Used to obtain a new access token for an end
user when a token expires.
oauthScope
string
oauthToken
string
password
string
principalType
External
Determines whether you're using one set or multiple sets of credentials
PrincipalType to access the external system. Corresponds to Identity Type in
(enumeration of
type string)
protocol
Authentication The authentication protocol for accessing the external system. The valid
values are:
Protocol
(enumeration of
type string)
NoAuthentication
Oauth
Password
username
string
419
Metadata Types
Network
Network
Represents a community. Communities are branded spaces for your employees, customers, and partners to connect. You can customize
and create communities to meet your business needs, then transition seamlessly between them. Use the Network component for
Salesforce Communities. If you want to create zones that contain Chatter Answers and Ideas, use the Community (Zone) component.
This type extends the Metadata metadata type and inherits its fullName field.
Version
This object is available in API version 28.0 and later.
Fields
Field
Field Type
Description
allowedExtensions
string
allowMembersToFlag
boolean
branding
Branding
caseCommentEmailTemplate
string
420
Metadata Types
Network
Field
Field Type
Description
changePasswordTemplate
string
description
string
emailSenderAddress
string
emailSenderName
string
enableGuestChatter
boolean
enableInvitation
boolean
enableKnowledgeable
boolean
enableNicknameDisplay
boolean
enablePrivateMessages
boolean
enableReputation
boolean
forgotPasswordTemplate
string
maxFileSizeKb
int
Specifies the maximum file size (in KBs) that members can
upload in your community. Available in API version 36.0
and later. Enter a number between 3072 KB and your orgs
maximum file size. To use the default limit of 2 GB, leave
this field empty.
networkMemberGroups
NetworkMemberGroups
421
Metadata Types
Field
Network
Field Type
Description
associated with a community, the Chatter customer
isnt added to the community.
newSenderAddress
string
Email address that has been entered as the new value for
EmailSenderAddress but has not been verified
yet. After a user has requested to change the sender email
address and has successfully responded to the verification
email, the NewSenderAddress value overwrites the
value in EmailSenderAddress. This becomes the
email address from which community emails are sent.
picassoSite
string
reputationLevels
ReputationLevelDefinitions
reputationPointsRules
ReputationPointsRules
selfRegProfile
string
selfRegistration
boolean
sendWelcomeEmail
boolean
site
string
status
NetworkStatus[]
422
Metadata Types
Network
Field
Field Type
Description
tabs
NetworkTabSet
urlPathPrefix
string
welcomeTemplate
string
Branding
Represents the branding and color scheme applied to the community.
Field
Field Type
Description
loginFooterText
string
loginLogo
string
pageFooter
string
pageHeader
string
primaryColor
string
primaryComplementColor
string
quaternaryColor
string
quaternaryComplementColor
string
secondaryColor
string
tertiaryColor
string
tertiaryComplementColor
string
zeronaryColor
string
zeronaryComplementColor
string
423
Metadata Types
Network
NetworkMemberGroup
Represents the profiles and permission sets that are assigned to the community. Users with one of the profiles or permission sets are
members of the community, unless the user is a Chatter customer (from a customer group).
Field
Field Type
Description
permissionSet
string
string
Field
Field Type
Description
smallImage
string
profile
ReputationBranding
Branding for the reputation level.
ReputationLevelDefinitions
Represents reputation levels members can achieve by performing certain defined actions in a community.
Field
Field Type
Description
level
ReputationLevel[]
ReputationLevel
Represents the name and lower value of the reputation level. The upper value is calculated by the application.
424
Metadata Types
Network
Field
Field Type
Description
branding
ReputationBranding[]
label
string
lowerThreshold
double
ReputationPointsRules
Represents points rules in a communitys point system.
Field
Field Type
Description
pointsRule
ReputationPointsRule[]
ReputationPointsRule
Represents the event and associated point value for a points rule. When a user acts, they accrue the associated points.
425
Metadata Types
Network
Field
Field Type
Description
eventType
string
points
int
426
Metadata Types
Network
NetworkTabSet
Field
Field Type
Description
customTab
string
defaultTab
string
standardTab
string
427
Metadata Types
Network
<profile>Standard</profile>
<profile>ReadOnly</profile>
</networkMemberGroups>
<reputationLevels>
<level>
<branding>
<smallImage>communities_shared
_document_folder/replevel_beginner.png</smallImage>
</branding>
<label>Beginner</label>
<lowerThreshold>0</lowerThreshold>
</level>
<level>
<branding>
<smallImage>communities_shared
_document_folder/replevel_apprentice.png</smallImage>
</branding>
<label>Apprentice</label>
<lowerThreshold>51</lowerThreshold>
</level>
<level>
<branding>
<smallImage>communities_shared
_document_folder/replevel_gettingthere.png</smallImage>
</branding>
<label>Getting There</label>
<lowerThreshold>101</lowerThreshold>
</level>
<level>
<branding>
<smallImage>communities_shared
_document_folder/replevel_skilled.png</smallImage>
</branding>
<label>Skilled</label>
<lowerThreshold>151</lowerThreshold>
</level>
<level>
<branding>
<smallImage>communities_shared
_document_folder/replevel_expert.png</smallImage>
</branding>
<label>Expert</label>
<lowerThreshold>201</lowerThreshold>
</level>
<level>
<branding>
<smallImage>communities_shared
_document_folder/replevel_mentor.png</smallImage>
</branding>
<label>Mentor</label>
<lowerThreshold>251</lowerThreshold>
</level>
<level>
<branding>
428
Metadata Types
Network
<smallImage>communities_shared
_document_folder/replevel_guru.png</smallImage>
</branding>
<label>Guru</label>
<lowerThreshold>301</lowerThreshold>
</level>
</reputationLevels>
<reputationPointsRules>
<pointsRule>
<eventType>FeedItemWriteAPost</eventType>
<points>5</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemWriteAComment</eventType>
<points>3</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemReceiveAComment</eventType>
<points>10</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemLikeSomething</eventType>
<points>3</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemReceiveALike</eventType>
<points>5</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemMentionSomeone</eventType>
<points>5</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemSomeoneMentionsYou</eventType>
<points>10</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemShareAPost</eventType>
<points>5</points>
</pointsRule>
<pointsRule>
<eventType>FeedItemSomeoneSharesYourPost</eventType>
<points>10</points>
</pointsRule>
</reputationPointsRules>
<selfRegistration>false</selfRegistration>
<sendWelcomeEmail>true</sendWelcomeEmail>
<site>Network_11</site>
<status>UnderConstruction</status>
<tabs>
<defaultTab>Chatter</defaultTab>
<standardTab>Chatter</standardTab>
<standardTab>Account</standardTab>
<standardTab>Campaign</standardTab>
429
Metadata Types
Package
<standardTab>Case</standardTab>
<standardTab>Console</standardTab>
<standardTab>Contact</standardTab>
<standardTab>Contract</standardTab>
<standardTab>Dashboard</standardTab>
<standardTab>JigsawSearch</standardTab>
<standardTab>File</standardTab>
<standardTab>CollaborationGroup</standardTab>
<standardTab>home</standardTab>
<standardTab>Idea</standardTab>
<standardTab>Lead</standardTab>
<standardTab>Opportunity</standardTab>
<standardTab>Product2</standardTab>
<standardTab>UserProfile</standardTab>
<standardTab>report</standardTab>
<standardTab>Solution</standardTab>
</tabs>
<urlPathPrefix>network1</urlPathPrefix>
<welcomeTemplate>unfiled$public/CommunityWelcomeEmailTemplate</welcomeTemplate>
</Network>
SEE ALSO:
Community (Zone)
Package
Used to specify metadata components to be retrieved as part of a retrieve() call, or to define a package of components.
Name
Type
Description
apiAccessLevel
APIAccessLevel (enumeration of
type string)
description
string
430
Metadata Types
PathAssistant
Name
Type
Description
fullName
string
namespacePrefix
string
objectPermissions
ProfileObjectPermissions[]
setupWeblink
string
types
PackageTypeMembers[]
version
string
PackageTypeMembers
Use to specify the name and type of components to be retrieved in a package.
Name
Type
Description
members
string
name
string
SEE ALSO:
Sample package.xml Manifest Files
PathAssistant
Represents Sales Path records for Opportunity.This type extends the Metadata metadata type and inherits its fullName field.
Note the following when working with PathAssistant:
Only one sales path can be created per record type, including __Master__ record type.
431
Metadata Types
PathAssistant
Rich text guidance information cannot be retrieved or deployed from or to translation workbench.
The preference does not need to be on to retrieve or deploy PathAssistant.
Version
PathAssistant components are available in API version 34.0 and later.
Fields
Field Name
Field Type
Description
active
boolean
entityName
string
Required. The entity name. This is hard coded for Opportunity. This field
is not updateable.
fieldName
string
Required. The field name. This is hard coded for StageName. This field
is not updateable.
masterLabel
string
pathAssistantSteps
PathAssistantStep[] List of all the steps that have been configured with fields and guidance
on page 432
information. Note that a missing step in the .xml file means it has not
been configured, not that it doesnt exist.
recordTypeName
string
Required. The name of the record type associated with the sales path.
This field is not updateable.
PathAssistantStep
Represents the steps or stages in Sales Path.
Field Name
Field Type
Description
fieldNames
string
info
string
picklistValueName
string
432
Metadata Types
PermissionSet
<active>true</active>
<entityName>Opportunity</entityName>
<fieldName>StageName</fieldName>
<masterLabel>Test Path</masterLabel>
<pathAssistantSteps>
<fieldNames>Amount</fieldNames>
<fieldNames>CloseDate</fieldNames>
<info>Some Text</info>
<picklistValueName>Id. Decision Makers</picklistValueName>
</pathAssistantSteps>
<pathAssistantSteps>
<fieldNames>Amount</fieldNames>
<fieldNames>CloseDate</fieldNames>
<info>Some Text</info>
<picklistValueName>Proposal/Price Quote</picklistValueName>
</pathAssistantSteps>
<recordTypeName>Test_Record_Type</recordTypeName>
</PathAssistant>
PermissionSet
Represents a set of permissions that's used to grant additional access to one or more users without changing their profile or reassigning
profiles. You can use permission sets to grant access, but not to deny access. This type extends the Metadata metadata type and inherits
its fullName field.
433
Metadata Types
PermissionSet
In API version 29.0 and later, you can retrieve and deploy access settings for the following managed components in profiles and permission
sets:
Apex classes
Apps
Custom field permissions
Custom object permissions
Custom tab settings
External data sources
Record types
Visualforce pages
For more information, see Managed Component Access in Sample package.xml Manifest Files on page 20.
Version
Permission sets are available in API version 22.0 and later.
Fields
Field
Field Type
Description
applicationVisibilities PermissionSetApplicationVisibility[]
classAccesses
PermissionSetApexClassAccess[]
customPermissions
PermissionSetCustomPermissions[]
description
string
externalDataSourceAccesses PermissionSetExternal
DataSourceAccess[]
fieldPermissions
PermissionSetFieldPermissions[]
434
Metadata Types
Field
PermissionSet
Field Type
Description
(readable or editable). Available in API version 23.0 and
later.
label
string
objectPermissions
PermissionSetObjectPermissions[]
pageAccesses
PermissionSetApexPageAccess[]
recordTypeVisibilities
tabSettings
PermissionSetTabSetting[]
userLicense
string
userPermissions
PermissionSetUserPermission[]
PermissionSetApplicationVisibility
PermissionSetApplicationVisibility determines whether an app is visible to a user assigned to this permission set.
Field Name
Field Type
Description
application
string
visible
boolean
PermissionSetApexClassAccess
PermissionSetApexClassAccess represents the Apex class access for users assigned to a permission set.
435
Metadata Types
PermissionSet
Field
Field Type
Description
apexClass
string
enabled
boolean
PermissionSetCustomPermissions
PermissionSetCustomPermissions represents the custom permissions access for users assigned to a permission set. Only enabled custom
permissions are retrieved.
Field Name
Field Type
Description
enabled
boolean
name
string
PermissionSetExternalDataSourceAccess
PermissionSetExternalDataSourceAccess represents the data source access for users with identity type of Per User. Available in API
version 27.0 and later.
Field
Field Type
Description
enabled
boolean
externalDataSource
string
PermissionSetFieldPermissions
PermissionSetFieldPermissions represents the field permissions for users assigned to a permission set. In API version 30.0 and later,
permissions for required fields cant be retrieved or deployed.
Field
Field Type
Description
editable
boolean
field
string
readable
boolean
436
Metadata Types
PermissionSet
PermissionSetObjectPermissions
PermissionSetObjectPermissions represents the object permissions for a permission set. Use one of these elements for each permission.
Field
Field Type
Description
allowCreate
boolean
allowDelete
boolean
allowEdit
boolean
allowRead
boolean
modifyAllRecords
boolean
object
string
viewAllRecords
boolean
PermissionSetApexPageAccess
PermissionSetApexPageAccess represents the Visualforce page access for users assigned to a permission set.
Field
Field Type
Description
apexPage
string
enabled
boolean
437
Metadata Types
PermissionSet
PermissionSetRecordTypeVisibility
PermissionSetRecordTypeVisibility represents the visibility of record types for this permission set.
Field
Field Type
Description
recordType
string
visible
boolean
PermissionSetTabSetting
PermissionSetTabSetting represents the tab settings for a permission set.
Field
Field Type
Description
tab
string
visibility
PermissionSetTabVisibility
(enumeration of type string)
Required. Indicates the visibility settings for the tab. Valid values
are:
AvailableThe tab is available on the All Tabs page.
Individual users can customize their display to make the tab
visible in any app.
NoneThe tab isnt available on the All Tabs page or visible
in any apps.
VisibleThe tab is available on the All Tabs page and
appears in the visible tabs for its associated app. Individual
users can customize their display to hide the tab or make it
visible in other apps.
PermissionSetUserPermission
PermissionSetUserPermission represents an app or system permission for a permission set. Use one of these elements for each permission.
Field
Field Type
Description
enabled
boolean
name
string
438
Metadata Types
PermissionSet
439
Metadata Types
PlatformCachePartition
The following is an example package.xml manifest used to retrieve the PermissionSet metadata for an organization. When you retrieve
permission sets, you should also retrieve the related components with assigned permissions. For example, to retrieve
objectPermissions and fieldPermissions for a custom object, you must also retrieve the CustomObject component.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Job_Request__c</members>
<name>CustomTab</name>
</types>
<types>
<members>Job_Request__c</members>
<name>CustomObject</name>
</types>
<types>
<members>JobApps__Recruiting</members>
<name>CustomApplication</name>
</types>
<types>
<members>Recruiting.DevManager</members>
<name>RecordType</name>
</types>
<types>
<members>*</members>
<name>PermissionSet</name>
</types>
<version>36.0</version>
</Package>
PlatformCachePartition
Represents a partition in the Platform Cache. This type extends the Metadata metadata type and inherits its fullName field.
Version
PlatformCachePartition components are available in API version 35.0 and later.
440
Metadata Types
PlatformCachePartition
Fields
Field Name
Field Type
Description
description
string
isDefaultPartition
boolean
masterLabel
string
platformCachePartitionTypes PlatformCachePartitionType[] An array of cache types that the partition can store.
PlatformCachePartitionType
Contains information about a partition type, including its minimum and allocated capacity.
Field Name
Field Type
Description
allocatedCapacity
int
Required. The total storage capacity, in MB, that is allocated for the cache
type, including free, purchased, and trial cache. Purchased capacity
includes organization-wide cache, which can be used in any partition,
and namespace-specific cache, which can be used only in partitions
associated with a namespace.
allocatedPurchasedCapacity int
allocatedTrialCapacity
int
Required. The amount of trial cache space, in MB, that is allocated for the
cache type.
cacheType
441
Metadata Types
Portal
<platformCachePartitionTypes>
<allocatedCapacity>5</allocatedCapacity>
<allocatedPurchasedCapacity>5</allocatedPurchasedCapacity>
<cacheType>Organization</cacheType>
</platformCachePartitionTypes>
</PlatformCachePartition>
If a namespace is defined in your organization, add the namespace prefix to your partition name. For example:
<members>Namespace.myPartition</members>
To retrieve all cache partitions from your organization, use the wildcard character (*) as follows.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>PlatformCachePartition</name>
</types>
<version>36.0</version>
</Package>
Portal
The Portal metadata type represents a partner portal or Customer Portal. It extends Metadata and inherits its fullName field. To use
this metadata type, you must have a partner portal or Customer Portal enabled for your organization. For more information, see Partner
Portal Overview and Enabling Your Customer Portal in the Salesforce online help.
Version
Force.com Portal components are available in API version 15.0 and later.
442
Metadata Types
Portal
Fields
Field
Field Type
Description
active
boolean
admin
string
defaultLanguage
string
The default language for HTML messages for the portal. Use the
abbreviation for the language, for example, en_US for United
States English.
description
string
emailSenderAddress
string
emailSenderName
string
enableSelfCloseCase
boolean
For the Customer Portal, allows portal users to close their own
cases.
footerDocument
string
forgotPassTemplate
string
fullName
string
headerDocument
string
isSelfRegistrationActivated boolean
loginHeaderDocument
string
The file to be used as the header for this portal's login page.
logoDocument
string
logoutUrl
string
newCommentTemplate
string
newPassTemplate
string
newUserTemplate
string
443
Metadata Types
Portal
Field
Field Type
Description
ownerNotifyTemplate
string
selfRegNewUserUrl
string
selfRegUserDefaultProfile string
The default role for self-registered users. The valid values are:
type string)
Executive
Manager
User
PersonAccount
selfRegUserTemplate
string
showActionConfirmation boolean
stylesheetDocument
string
type
PortalType (enumeration of type Required. The type for this portal. The valid values are:
string)
CustomerSuccess
Partner
SEE ALSO:
CustomSite
444
Metadata Types
PostTemplate
PostTemplate
Represents the metadata associated with an approval post template for Approvals in Chatter. With approval post templates, you can
customize the information included in approval request posts that appear in Chatter feeds. This type extends the Metadata metadata
type and inherits its fullName field.
Note:
You can only create an approval post template for an object that is both enabled for approvals and supported for Chatter feed
tracking. You can't associate a post template to an approval process unless feed tracking for the object has been turned on.
Deleting a custom field removes it from any approval post template that references it. Existing posts aren't affected. Undeleting
the custom field restores it to the available fields list, but doesn't restore it to any approval post templates that previously
contained it.
Deleting (or undeleting) a custom object also deletes (or undeletes) its associated approval post templates and any of its
approval request posts that are already in Chatter feeds.
If you rename a custom object, approval post templates associated with it update accordingly.
You can create custom approval post templates for one or more approval processes, but you can only associate custom post
templates with approval processes after enabling Approvals in Chatter.
Version
PostTemplate components are available in API version 29.0 and later.
Fields
Field Name
Field Type
Description
default
boolean
Required. Specifies whether this is the default post template for the given object.
When set to true, this post template is used by approval processes that are
associated with the same object and dont specify a post template.
When an object has no default post template, each of its approval processes uses
the system default post template, unless the approval process specifies its own
post template.
description
string
fields
string[]
label
string
Required. Name of the post template. This non-unique label is different from the
unique name of the post template.
445
Metadata Types
Profile
The following is an example package manifest that references the previous PostTemplate component.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Lead.leadtemplate</members>
<name>PostTemplate</name>
</types>
<version>29.0</version>
</Package>
Profile
Represents a user profile. A profile defines a user's permission to perform different functions within Salesforce. This type extends the
Metadata metadata type and inherits its fullName field.
In API version 29.0 and later, you can retrieve and deploy access settings for the following managed components in profiles and permission
sets:
Apex classes
Apps
Custom field permissions
Custom object permissions
Custom tab settings
External data sources
Record types
Visualforce pages
For more information, see Managed Component Access in Sample package.xml Manifest Files on page 20.
Version
Profiles are available in API version 10.0 and later.
446
Metadata Types
Profile
Fields
The content of a profile returned by Metadata API depends on the content requested in the RetrieveRequest message. For example,
profiles only include field-level security for fields included in custom objects returned in the same RetrieveRequest as the profiles. The
profile definition contains the following fields:
Field Name
Field Type
Description
applicationVisibilities ProfileApplicationVisibility[]
classAccesses
ProfileApexClassAccess[]
custom
boolean
customPermissions
ProfileCustomPermissions[]
description
string
externalDataSourceAccesses ProfileExternalDataSourceAccess[]
fieldLevelSecurities
ProfileFieldLevelSecurity[]
fieldPermissions
ProfileFieldLevelSecurity[]
fullName
string
layoutAssignments
ProfileLayoutAssignments[]
447
Metadata Types
Profile
Field Name
Field Type
Description
loginHours
ProfileLoginHours[]
loginIpRanges
ProfileLoginIpRange[]
objectPermissions
ProfileObjectPermissions[]
pageAccesses
ProfileApexPageAccess[]
recordTypeVisibilities
ProfileRecordTypeVisibility[]
tabVisibilities
ProfileTabVisibility[]
userLicense
string
userPermissions
ProfileUserPermission[]
ProfileApplicationVisibility
ProfileApplicationVisibility determines whether an app is visible to a user assigned to this profile.
Field Name
Field Type
Description
application
string
default
boolean
Required. Indicates whether the app is the default app (true) or not
(false). Only one app per profile can be set to true.
visible
boolean
448
Metadata Types
Profile
ProfileApexClassAccess
ProfileApexClassAccess determines which top-level Apex classes have methods that users assigned to this profile can execute.
Field Name
Field Type
Description
apexClass
string
enabled
boolean
ProfileCustomPermissions
ProfileCustomPermissions represents the custom permissions access for users assigned to a profile. Only enabled custom permissions
are retrieved.
Field Name
Field Type
Description
enabled
boolean
name
string
ProfileExternalDataSourceAccess
ProfileExternalDataSourceAccess represents the data source access for users with identity type of Per User. Available in API version
27.0 and later.
Field Name
Field Type
Description
enabled
boolean
externalDataSource
string
ProfileFieldLevelSecurity
ProfileFieldLevelSecurity represents the field level security for users assigned to a profile. In API version 30.0 and later, permissions for
required fields cant be retrieved or deployed.
Field Name
Field Type
Description
editable
boolean
field
string
449
Metadata Types
Profile
Field Name
Field Type
Description
hidden
boolean
Indicates whether this field is hidden (true) or not (false). This field
is available in API version 22.0 and earlier.
For portal profiles, this is set to true by default in API version 19.0 and
later.
readable
boolean
Indicates whether this field is readable (true) or not (false). This field
is available in API version 23.0 and later. It replaces the hidden field.
In API version 30.0 and later, when deploying a new custom field, this
field is false by default.
For portal profiles, this is set to false by default.
ProfileLayoutAssignments
ProfileLayoutAssignments determines which layout to use for a profile and a given entity.
Field Name
Field Type
Description
layout
string
recordType
string
ProfileLoginHours
ProfileLoginHours restricts the days and times within which users with a particular profile can log in.
Field Name
Field Type
Description
weekdayStart
string
Specifies the earliest time on that day that a user with this profile may
log in. If a start time for a particular day is specified, an end time for that
day must be specified as well. Start cant be greater than end for a
particular day.
Valid values for weekday: monday, tuesday, wednesday,
thursday, friday, saturday, or sunday. For example,
mondayStart indicates the beginning of the login period for
Monday.
Valid values for Start: the number of minutes since midnight. Must
be evenly divisible by 60 (full hours). For example, 300 is 5:00 a.m.
weekdayEnd
string
Specifies the time on that day by which a user with this profile must log
out.
Valid values for weekday: monday, tuesday, wednesday,
thursday, friday, saturday, or sunday. For example,
mondayEnd indicates the close of the login period for Monday.
450
Metadata Types
Profile
Field Name
Field Type
Description
Valid values for End: the number of minutes since midnight. Must be
evenly divisible by 60 (full hours). For example, 1020 is 5:00 p.m.
To delete login hour restrictions from a profile that previously had them, you must explicitly include an empty loginHours tag without
any start or end times.
ProfileLoginIpRange
ProfileLoginIpRange IP defines an IP address ranges from which users with a particular profile can log in.
Field Name
Field Type
Description
description
string
Use this field to identify the purpose of the range, such as which part of
a network corresponds to this range. This field is available in API version
31.0 and later.
endAddress
string
startAddress
string
ProfileObjectPermissions
ProfileObjectPermissions represents a user's access to objects.
Note: In API version 18.0 and later, these permissions are disabled in new custom objects for any profiles in which View All Data
or Modify All Data is disabled.
Field Name
Field Type
Description
allowCreate
boolean
allowDelete
boolean
451
Metadata Types
Profile
Field Name
Field Type
Description
allowEdit
boolean
allowRead
boolean
modifyAllRecords
boolean
object
string
Required. The name of the object whose permissions are altered by this
profile, for example, MyCustomObject__c.
viewAllRecords
boolean
ProfileApexPageAccess
ProfileApexPageAccess determines which Visualforce pages that users assigned to this profile can execute.
452
Metadata Types
Profile
Field Name
Field Type
Description
apexPage
string
enabled
boolean
ProfileRecordTypeVisibility
ProfileRecordTypeVisibility represents the visibility of record types for this profile. Record types let you offer different business processes,
picklist values, and page layouts to different users.
Field Name
Field Type
Description
default
boolean
Required. Indicates whether the record type is the default for this pair of
profile and object (true) or not (false). Only one default is allowed
per object.
personAccountDefault
boolean
Indicates whether the record type is the default person account record
type for this pair of profile and object (true) or not (false). Only one
person account record type default is allowed per object. This field is
only relevant for record types for account or contact objects.
For more information about person accounts, see What Is a Person
Account? in the Salesforce online help. Person accounts are not enabled
by default in Salesforce. To request person accounts, contact Salesforce.
recordType
string
visible
boolean
ProfileTabVisibility
ProfileTabVisibility represents the visibility of tabs for this profile. For version 17.0 and later, ProfileTabVisibility supports visibility of tabs
for standard objects. The manifest file must include the standard object corresponding to a standard tab to retrieve the tab visibility in
a profile.
Field Name
Field Type
Description
tab
string
visibility
TabVisibility
(enumeration of type
string)
453
Metadata Types
Field Name
Profile
Field Type
Description
HiddenThe tab isnt available on the All Tabs page or visible in
any apps.
ProfileUserPermission
ProfileUserPermission represents an app or system permission for a profile. Use one of these elements for each permission.
Field
Field Type
Description
enabled
boolean
name
string
Java Sample
The following sample uses picklists, profiles, record types, and a custom app:
public void profileSample() {
try {
// Create an expense report record, tab and app...
CustomObject expenseRecord = new CustomObject();
expenseRecord.setFullName("ExpenseReport__c");
expenseRecord.setLabel("Expense Report");
expenseRecord.setPluralLabel("Expense Reports");
expenseRecord.setDeploymentStatus(DeploymentStatus.Deployed);
expenseRecord.setSharingModel(SharingModel.ReadWrite);
CustomField nameField = new CustomField();
nameField.setType(FieldType.AutoNumber);
nameField.setLabel("Expense Report Number");
nameField.setDisplayFormat("ER-{0000}");
expenseRecord.setNameField(nameField);
AsyncResult[] arsExpenseRecord =
metadataConnection.create(new Metadata[] {expenseRecord});
Picklist expenseStatus = new Picklist();
PicklistValue unsubmitted = new PicklistValue();
unsubmitted.setFullName("Unsubmitted");
PicklistValue submitted = new PicklistValue();
submitted.setFullName("Submitted");
PicklistValue approved = new PicklistValue();
approved.setFullName("Approved");
PicklistValue rejected = new PicklistValue();
rejected.setFullName("Rejected");
expenseStatus.setPicklistValues(new PicklistValue[] {
unsubmitted, submitted, approved, rejected}
454
Metadata Types
Profile
);
CustomField expenseStatusField = new CustomField();
expenseStatusField.setFullName(
"ExpenseReport__c.ExpenseStatus__c"
);
expenseStatusField.setLabel("Expense Report Status");
expenseStatusField.setType(FieldType.Picklist);
expenseStatusField.setPicklist(expenseStatus);
AsyncResult[] arsStatusField =
metadataConnection.create(new Metadata[]
{expenseStatusField});
CustomTab expenseTab = new CustomTab();
expenseTab.setFullName("ExpenseReport__c");
expenseTab.setMotif("Custom70: Handsaw");
expenseTab.setCustomObject(true);
AsyncResult[] arsTab =
metadataConnection.create(new Metadata[] {expenseTab});
CustomApplication application = new CustomApplication();
application.setFullName("ExpenseForce");
application.setTab(new String[] {expenseTab.getFullName()});
AsyncResult[] arsApp =
metadataConnection.create(new Metadata[] {application});
// Employees and managers have the same app visibility...
ProfileApplicationVisibility appVisibility =
new ProfileApplicationVisibility();
appVisibility.setApplication("ExpenseForce");
appVisibility.setVisible(true);
Profile employee = new Profile();
employee.setFullName("Employee");
employee.setApplicationVisibilities(
new ProfileApplicationVisibility[] {appVisibility}
);
AsyncResult[] arsProfileEmp =
metadataConnection.create(new Metadata[] {employee});
Profile manager = new Profile();
manager.setFullName("Manager");
manager.setApplicationVisibilities(
new ProfileApplicationVisibility[] {appVisibility}
);
AsyncResult[] arsProfileMgr =
metadataConnection.create(new Metadata[] {manager});
// But employees and managers have different access
// to the state of the expense sheet
RecordType edit = new RecordType();
edit.setFullName("ExpenseReport__c.Edit");
RecordTypePicklistValue editStatuses =
new RecordTypePicklistValue();
455
Metadata Types
Profile
editStatuses.setPicklist("ExpenseStatus__c");
editStatuses.setValues(new PicklistValue[]
{unsubmitted, submitted});
edit.setPicklistValues(new RecordTypePicklistValue[]
{editStatuses});
AsyncResult[] arsRecTypeEdit =
metadataConnection.create(new Metadata[] {edit});
RecordType approve = new RecordType();
approve.setFullName("ExpenseReport__c.Approve");
RecordTypePicklistValue approveStatuses =
new RecordTypePicklistValue();
approveStatuses.setPicklist("ExpenseStatus__c");
approveStatuses.setValues(new PicklistValue[]
{approved, rejected});
approve.setPicklistValues(new RecordTypePicklistValue[]
{approveStatuses});
AsyncResult[] arsRecTypeApp =
metadataConnection.create(new Metadata[] {approve});
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}
456
Metadata Types
Profile
Usage
When you use the retrieve() call to get information about profiles in your organization, the returned .profile files only include
security settings for the other metadata types referenced in the retrieve request (with the exception of user permissions, IP address
ranges, and login hours, which are always retrieved). For example, the package.xml file below contains a types element that
matches all custom objects, so the returned profiles contain object and field permissions for all custom objects in your organization, but
do not include permissions for standard objects, such as Account, and standard fields.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>Profile</name>
</types>
<version>36.0</version>
</Package>
The wildcard * on CustomObject does not match standard objects and this helps to avoid making unintended, high-impact profile
changes. If you create a few custom objects in a Developer Edition organization, retrieve() the information, and subsequently
deploy() the custom objects to your production organization, the profile and field-level security for all your standard objects, such
as Account, and standard fields are not overwritten unless you explicitly create separate types elements for the standard objects or
fields.
Metadata API intentionally makes it somewhat difficult to include standard fields in retrieve() calls in order to prevent unexpected
profile changes. However, you can still retrieve and deploy profile permissions for custom and standard fields in standard objects, such
as Account.
The next package.xml file allows you to return profile permissions for Account standard and custom fields. Note how the standard
Account object is defined in a types element by specifying it as a member of a CustomObject type.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>Profile</name>
</types>
<version>36.0</version>
</Package>
The final package.xml file allows you to return profile permissions for the MyCustomField__c custom field in the Account
object.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account.MyCustomField__c</members>
<name>CustomField</name>
457
Metadata Types
Queue
</types>
<types>
<members>*</members>
<name>Profile</name>
</types>
<version>36.0</version>
</Package>
Queue
Represents a holding area for items before they are processed.
Version
Queue components are available in API version 24.0 and later.
Fields
This metadata type represents the valid values that define a queue:
Field Name
Field Type
doesSendEmailToMembers boolean
Description
Indicates whether emails are sent to queue members (true) or not
(false) when a new record is added to the queue.
string
fullName
string
The unique identifier for API access. The fullName can contain only
underscores and alphanumeric characters. It must be unique, begin with
a letter, not include spaces, not end with an underscore, and not contain
two consecutive underscores. This field is inherited from the Metadata
component. Corresponds to Queue Name in the user interface.
name
string
queueSobject
QueueSobject[]
QueueSobject
QueueSobject represents an entity type that the queue supports.
458
Metadata Types
QuickAction
Field Name
Field Type
Description
sobjectType
string
QuickAction
Represents a specified create or update quick action for an object that then becomes available in the Chatter publisher. For example,
you can create an action that, on the detail page of an account, allows a user to create a contact related to that account from the Chatter
feed on that page. QuickAction can be created on objects that allow custom fields. The parent objects supported include:
Account
Campaign
Case
Contact
Custom objects
Group
Lead
Opportunity
459
Metadata Types
QuickAction
Version
QuickAction components are available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
canvas
string
If a custom action is created using a canvas app, the app name. Returns
the fully qualified name of the canvas app in the format
<namespace>__<dev_name>, if the quick action type is Canvas;
otherwise, returns null. This field is available in API version 29.0 and later.
description
string
fieldOverrides
FieldOverride
height
int
icon
string
isProtected
boolean
label
string
Identifies the action and displays to users. This is also the default identifier
used for the API and managed packages.
optionsCreateFeedItem
boolean
page
string
quickActionLayout
standardLabel
QuickActionLabel
(enumeration of
type string)
Specifies the standard label to use for the action. The valid values are:
LogACall
LogANote
New (A new record)
460
Metadata Types
Field Name
QuickAction
Field Type
Description
NewRecordType (For example, a label with something like New
Idea)
Update
UpdateRecordType
NewChild (A new child record)
NewChildRecordType
CreateNew
CreateNewRecordType (For example, a label with something
like Create New Idea)
SendEmail (This value is available in API version 31.0 and later.)
QuickRecordType
Quick (A quick record)
successMessage
string
targetObject
string
targetParentField
string
The parent object type of the action. Links the target object to the parent
object. For example, use Account if the target object is Contact and the
parent object is Account.
targetRecordType
string
type
QuickActionType
(enumeration of
type string)
461
Metadata Types
QuickAction
Field Name
Field Type
Description
width
int
FieldOverride
Represents the field names and their respective formulas and literal values that comprise overrides in a QuickAction.
Field Name
Field Type
Description
field
string
formula
string
literalValue
string
QuickActionLayout
The layout of fields on the action. There is no hard limit to the number of fields you can add to an action layout. However, for optimum
usability, we recommend a maximum of eight fields. Adding more than 20 fields can severely affect user efficiency.
Field Name
Field Type
Description
layoutSectionStyle
LayoutSectionStyle
(enumeration of type
string)
QuickActionLayoutColumn
A column defined for a QuickActionLayout.
Field Name
Field Type
Description
[]
QuickActionLayoutItem
A row item comprised of fields and defined for a QuickActionLayoutColumn.
462
Metadata Types
QuickAction
Field Name
Field Type
Description
emptySpace
boolean
field
string
uiBehavior
UiBehavior
(enumeration of type
string)
463
Metadata Types
RemoteSiteSetting
</quickActionLayoutItems>
<quickActionLayoutItems>
<emptySpace>false</emptySpace>
<field>Status</field>
<uiBehavior>Required</uiBehavior>
</quickActionLayoutItems>
<quickActionLayoutItems>
<emptySpace>false</emptySpace>
<field>Priority</field>
<uiBehavior>Required</uiBehavior>
</quickActionLayoutItems>
</quickActionLayoutColumns>
<quickActionLayoutColumns/>
</quickActionLayout>
<successMessage>This is a success message</successMessage>
<targetObject>Task</targetObject>
<targetParentField>What</targetParentField>
<type>Create</type>
</QuickAction>
RemoteSiteSetting
Represents a remote site setting. Before any Visualforce page, Apex callout, or JavaScript code using XmlHttpRequest in an s-control or
custom button can call an external site, that site must be registered in the Remote Site Settings page, or the call will fail. RemoteSiteSetting
extends the Metadata metadata type and inherits its fullName field.
Version
RemoteSiteSetting components are available in API version 19.0 and later.
Fields
Field
Field Type
Description
description
string
disableProtocolSecurity boolean
464
Metadata Types
Field
Report
Field Type
Description
Warning: Only set to true if you understand the
security implications.
fullName
string
isActive
boolean
url
string
Report
Represents a custom report. This type extends the Metadata metadata type and inherits its fullName field. This metadata type only
supports custom reports; standard reports are not supported.
Retrieving Reports
You cant use the wildcard (*) symbol with reports in package.xml. To retrieve the list of reports for populating package.xml
with explicit names, call listMetadata() and pass in ReportFolder as the type. Note that ReportFolder is not returned as a
type in describeMetadata(). Report is returned from describeMetadata() with an associated attribute of inFolder
set to true. If that attribute is set to true, you can construct the type by using the component name with the word Folder, such as
ReportFolder.
465
Metadata Types
Report
Version
Report components are available in API version 14.0 and later.
Fields
The following information assumes that you are familiar with creating and running reports. For more information on these fields, see
Create a Report in the Salesforce online help.
Field
Field Type
Description
aggregates
ReportAggregate[]
block
Report[]
blockInfo
ReportBlockInfo
buckets
ReportBucketField[]
chart
ReportChart
colorRanges
ReportColorRange[]
466
Metadata Types
Report
Field
Field Type
Description
columns
ReportColumn[]
crossFilters
ReportCrossFilter[]
currency
string)
description
string
division
string
filter
ReportFilter
string
467
Metadata Types
Report
Field
Field Type
Description
format
fullName
string
groupingsAcross
ReportGrouping[]
groupingsDown
ReportGrouping[]
historicalSelector
ReportHistoricalSelector
name
string
params
ReportParam[]
reportType
string
468
Metadata Types
Report
Field
Field Type
Description
roleHierarchyFilter
string
rowLimit
int
scope
string
showCurrentDate
boolean
showDetails
boolean
string
sortOrder
territoryHierarchyFilter string
timeFrameFilter
ReportTimeFrameFilter
userFilter
string
469
Metadata Types
Field
Report
Field Type
Description
display Hierarchy links that allow you to drill
down to different data sets based on the user
hierarchy.
This field is available in API version 17.0 and later.
ReportAggregate
ReportAggregate defines custom summary formulas on summary, matrix, and joined reports. For more information on these fields, see
Build a Custom Summary Formula in the Salesforce online help.
Field
Field Type
Description
acrossGroupingContext
string
Defines the row grouping level at which you want your custom
summary formula to be displayed. This is a new field in API
version 15.0.
calculatedFormula
string
datatype
ReportAggregateDatatype
(enumeration of type string)
description
string
developerName
string
downGroupingContext
string
isActive
booleanblo
isCrossBlock
boolean
masterLabel
string
reportType
string
scale
int
470
Metadata Types
Report
ReportBlockInfo
ReportBlockInfo defines blocks in a joined report.
Field
Field Type
Description
aggregateReferences
ReportAggregateReference[]
blockId
string
joinTable
string
ReportAggregateReference
ReportAggregateReference defines the developer name used for custom summary formulas in joined reports.
Field
Field Type
Description
aggregate
string
ReportBucketField
ReportBucketField defines a bucket to be used in the report.
Field
Field Type
Description
bucketType
ReportBucketFieldType
(enumeration of type string)
developerName
string
masterLabel
string
471
Metadata Types
Field
Report
Field Type
Description
the label are removed. Any of these characters within the label
are reduced to a single space.
nullTreatment
ReportBucketFieldNullTreatment For numeric bucket fields only. Specifies whether empty values
(enumeration of type string)
are treated as zeros (z) or not (n).
otherBucketLabel
string
sourceColumnName
string
Required. The source field that the bucket is applied to. For
example, SALES or INDUSTRY.
values
ReportBucketFieldValue
(enumeration of type string)
ReportBucketFieldValue
ReportBucketFieldValue defines a bucket value used in the bucket field.
Field
Field Type
Description
sourceValues
value
string
ReportGrouping
ReportGrouping defines how to group, subtotal, and sort data for summary, matrix, and joined reports.
472
Metadata Types
Report
Field
Field Type
Description
aggregateType
ReportAggrType (enumeration The type of aggregate value to sort by. Valid values are:
of type string)
Sum
Average
Maximum
Minimum
RowCount
dateGranularity
UserDateGranularity
(enumeration of type string)
field
string
sortByName
string
sortOrder
SortOrder
sortType
ReportSortType (enumeration
of type string)
ReportHistoricalSelector
ReportHistoricalSelector defines a date range for historical data.
Field
Field Type
Description
snapshot
string
SortOrder
An enumeration of type string that defines the order in which data is sorted in the report fields. Valid values:
Field
Description
Asc
473
Metadata Types
Report
Field
Description
Desc
UserDateGranularity
An enumeration of type string that defines the time period by which to group data. Valid values:
Enumeration Value
Description
None
No grouping by date
Day
By day
Week
By week
Month
By month
Quarter
By quarter
Year
By year
FiscalQuarter
By fiscal quarter. You can set the fiscal year for your organization. See Set the Fiscal Year in the
Salesforce online help.
FiscalYear
By fiscal year
MonthInYear
DayInMonth
FiscalPeriod
FiscalWeek
ReportSummaryType
An enumeration of type string that defines how report fields are summarized. Valid values:
Enumeration Value
Description
Sum
Total
Average
Average
Maximum
Largest value
Minimum
Smallest value
None
ReportColorRange
ReportColorRange defines conditional highlighting for report summary data.
474
Metadata Types
Report
Field
Field Type
Description
aggregate
ReportSummaryType
(enumeration of type string)
columnName
string
highBreakpoint
double
highColor
string
lowBreakpoint
double
lowColor
string
midColor
string
ReportColumn
ReportColumn defines how fields (columns) are displayed in the report.
Field
Field Type
Description
aggregateTypes
ReportSummaryType[]
(enumeration of type string)
field
string
reverseColors
boolean
showChanges
boolean
ReportFilter
ReportFilter limits the report results by filtering data on specified fields.
475
Metadata Types
Report
Field
Field Type
Description
booleanFilter
string
criteriaItems
ReportFilterItem
language
Language (enumeration of type The language used when a report filters against a picklist value
string)
using the operators contains or startsWith. For a list
of valid language values, see Language.
ReportFilterItem
ReportFilterItem limits the report results by filtering data on specified fields.
Field
Field Type
Description
column
string
Required. The field on which you want to filter data. For example,
AMOUNT
columnToColumn
boolean
operator
snapshot
string
value
string
The value by which you want to filter the data, for example,
1000. Note that the Metadata API filter condition values do
not always match those that you enter in the report wizard. For
example, in the Metadata API dates are always converted to the
US date format and values entered in a non-US English language
may be converted to a standard US English equivalent.
476
Metadata Types
Report
ReportFormat
An enumeration of type string that defines the report format. Valid values:
Enumeration Value
Description
Matrix
Summary
Tabular
Joined
Joins data from different report types storing each reports data in its own block.
ReportParam
ReportParam represents settings specific to a report type, especially options that let you filter a report to certain useful subsets.
Field
Field Type
Description
name
string
value
string
ReportAggregateDatatype
An enumeration of type string that specifies the data type for formatting and display of custom summary formula results. Valid values:
Enumeration Value
currency
number
percent
ReportChart
ReportChart represents charts on summary, matrix, and joined reports.
Field
Field Type
Description
backgroundColor1
string
backgroundColor2
string
Specifies the end color (in HTML format) for a gradient color
background.
backgroundFadeDir
ChartBackgroundDirection
(enumeration of type string)
477
Metadata Types
Field
Report
Field Type
Description
design. Use white for both if you do not want a background
design. Valid values:
diagonal
leftToRight
topToBottom
chartSummaries
ChartSummary[]
Specifies the summaries you want to use for the chart. Invalid
summaries are ignored without notification. If there are no valid
summaries, RowCount is used by default for the axis value. This
field is available in API version 17.0 and later.
chartType
ChartType (enumeration of type Required. Specifies the chart type. Available chart types depend
string)
on the report type.
enableHoverLabels
boolean
expandOthers
boolean
groupingColumn
string
legendPosition
ChartLegendPosition
(enumeration of type string)
Required.
The location of the legend with respect to the chart. The valid
values are:
Bottom
OnChart
Right
location
ChartPosition (enumeration of
type string)
secondaryGroupingColumn string
showAxisLabels
boolean
For bar and line charts: Specifies whether the chart displays
names for each axis.
showPercentage
boolean
478
Metadata Types
Report
Field
Field Type
Description
showTotal
boolean
showValues
boolean
size
ReportChartSize (enumeration
of type string)
summaryAggregate
ReportSummaryType
(enumeration of type string)
summaryAxisManualRangeEnd double
summaryAxisManualRangeStart double
summaryAxisRange
ChartRangeType (enumeration Required. For bar, line, and column charts: Defines whether to
of type string)
specify the axis range manually or automatically.
summaryColumn
string
textColor
string
The color (in HTML format) of the chart text and labels.
textSize
int
title
string
titleColor
string
titleSize
int
479
Metadata Types
Field
Report
Field Type
Description
14
18
24
36
The maximum size is 18. Larger values are shown at 18 points.
ChartType
An enumeration of type string that defines the chart type. For information on each of these chart types, see Chart Types in the Salesforce
online help. Valid values:
Enumeration Value
None
HorizontalBar
HorizontalBarGrouped
HorizontalBarStacked
HorizontalBarStackedTo100
VerticalColumn
VerticalColumnGrouped
VerticalColumnStacked
VerticalColumnStackedTo100
Line
LineGrouped
LineCumulative
LineCumulativeGrouped
Pie
Donut
Funnel
Scatter
ScatterGrouped
VerticalColumnLine
VerticalColumnGroupedLine
VerticalColumnStackedLine
480
Metadata Types
Report
Enumeration Value
Plugin
Reserved for future use. This value is available in API version 31.0 and later.
ChartPosition
An enumeration of type string that specifies the position of the chart in the report. Valid values:
Enumeration Value
CHART_TOP
CHART_BOTTOM
ChartSummary
ChartSummary defines how data in the chart is summarized. Valid values:
Field
Field Type
Description
aggregate
ReportSummaryType
axisBinding
ChartAxis
Specifies the axis or axes to use on the chart. Use the column
field to specify the summary value to use for the axis.
column
string
Required. Specifies the summary field for the chart data. If all
columns are invalid, RowCount is used by default for the axis
value. For vertical column and horizontal bar combination charts,
you can specify up to four values.
ChartAxis
An enumeration of type string that specifies the axis or axes to be used in charts. Valid values:
Enumeration Value
Description
y2
The secondary Y-axis for vertical column combination charts with a line added.
481
Metadata Types
Report
ReportChartSize
An enumeration of type string that specifies the chart size. Valid values:
Enumeration Value
Tiny
Small
Medium
Large
Huge
ChartRangeType
An enumeration of type string that defines the report format. Valid values:
Enumeration Value
Auto
Manual
ReportTimeFrameFilter
ReportTimeFrameFilter represents the report time period.
Field
Field Type
Description
dateColumn
string
endDate
date
interval
startDate
date
ReportCrossFilter
ReportCrossFilter represents the cross filter functionality in reports.
482
Metadata Types
Report
Field
Field Type
Description
criteriaItems
ReportFilterItem
operation
ObjectFilterOperator.
Enumeration of type string
primaryTableColumn
string
relatedTable
string
relatedTableJoinColumn string
The field from the child object that is used to join the parent.
Note: This sample was generated using the API version 23.0.
UserDateInterval
An enumeration of type string that defines the period of time. Valid values:
Enumeration Value
Description
INTERVAL_CURRENT
INTERVAL_CURNEXT1
INTERVAL_CURPREV1
INTERVAL_NEXT1
INTERVAL_PREV1
INTERVAL_CURNEXT3
483
Metadata Types
Report
Enumeration Value
Description
INTERVAL_CURFY
INTERVAL_PREVFY
INTERVAL_PREV2FY
INTERVAL_AGO2FY
INTERVAL_NEXTFY
INTERVAL_PREVCURFY
INTERVAL_PREVCUR2FY
INTERVAL_CURNEXTFY
INTERVAL_CUSTOM
A custom time period. Use startDate and endDate fields to specify the
time period's start date and end date.
INTERVAL_YESTERDAY
Yesterday
INTERVAL_TODAY
Today
INTERVAL_TOMORROW
Tomorrow
INTERVAL_LASTWEEK
INTERVAL_THISWEEK
INTERVAL_NEXTWEEK
INTERVAL_LASTMONTH
INTERVAL_THISMONTH
INTERVAL_NEXTMONTH
INTERVAL_LASTTHISMONTH
INTERVAL_THISNEXTMONTH
INTERVAL_CURRENTQ
INTERVAL_CURNEXTQ
INTERVAL_CURPREVQ
INTERVAL_NEXTQ
INTERVAL_PREVQ
INTERVAL_CURNEXT3Q
INTERVAL_CURY
INTERVAL_PREVY
INTERVAL_PREV2Y
INTERVAL_AGO2Y
484
Metadata Types
Report
Enumeration Value
Description
INTERVAL_NEXTY
INTERVAL_PREVCURY
INTERVAL_PREVCUR2Y
INTERVAL_CURNEXTY
INTERVAL_LAST7
Last 7 days
INTERVAL_LAST30
Last 30 days
INTERVAL_LAST60
Last 60 days
INTERVAL_LAST90
Last 90 days
INTERVAL_LAST120
INTERVAL_NEXT7
Next 7 days
INTERVAL_NEXT30
Next 30 days
INTERVAL_NEXT60
Next 60 days
INTERVAL_NEXT90
Next 90 days
INTERVAL_NEXT120
LAST_FISCALWEEK
THIS_FISCALWEEK
NEXT_FISCALWEEK
LAST_FISCALPERIOD
THIS_FISCALPERIOD
NEXT_FISCALPERIOD
LASTTHIS_FISCALPERIOD
When custom fiscal years are enabled: This fiscal period and last fiscal period
THISNEXT_FISCALPERIOD
When custom fiscal years are enabled: This fiscal period and next fiscal period
CURRENT_ENTITLEMENT_PERIOD
PREVIOUS_ENTITLEMENT_PERIOD
PREVIOUS_TWO_ENTITLEMENT_PERIODS
TWO_ENTITLEMENT_PERIODS_AGO
485
Metadata Types
Report
486
Metadata Types
Report
<from>25000</from>
</sourceValues>
<value>high</value>
</values>
</buckets>
<buckets>
<bucketType>text</bucketType>
<developerName>BucketField_Region</developerName>
<masterLabel>TextBucket</masterLabel>
<nullTreatment>n</nullTreatment>
<otherBucketLabel>Other</otherBucketLabel>
<sourceColumnName>ADDRESS1_STATE</sourceColumnName>
<values>
<sourceValues>
<sourceValue>CA</sourceValue>
</sourceValues>
<value>west</value>
</values>
<values>
<sourceValues>
<sourceValue>NY</sourceValue>
</sourceValues>
<sourceValues>
<sourceValue>Ontario</sourceValue>
</sourceValues>
<value>east</value>
</values>
</buckets>
<chart>
<backgroundColor1>#FFFFFF</backgroundColor1>
<backgroundColor2>#FFFFFF</backgroundColor2>
<backgroundFadeDir>Diagonal</backgroundFadeDir>
<chartSummaries>
<axisBinding>y</axisBinding>
<column>FORMULA1</column>
</chartSummaries>
<chartSummaries>
<axisBinding>y</axisBinding>
<column>FORMULA2</column>
</chartSummaries>
<chartSummaries>
<aggregate>Maximum</aggregate>
<axisBinding>y</axisBinding>
<column>CRT_Object__c$Number__c</column>
</chartSummaries>
<chartSummaries>
<axisBinding>y</axisBinding>
<column>RowCount</column>
</chartSummaries>
<chartType>VerticalColumn</chartType>
<groupingColumn>CRT_Object__c$LastModifiedDate</groupingColumn>
<legendPosition>Right</legendPosition>
<location>CHART_TOP</location>
<size>Medium</size>
487
Metadata Types
Report
<summaryAxisRange>Auto</summaryAxisRange>
<textColor>#000000</textColor>
<textSize>12</textSize>
<titleColor>#000000</titleColor>
<titleSize>18</titleSize>
</chart>
<columns>
<field>CRT_Object__c$Name</field>
</columns>
<columns>
<aggregateTypes>Average</aggregateTypes>
<field>CRT_Object__c$Currency__c</field>
</columns>
<columns>
<aggregateTypes>Maximum</aggregateTypes>
<field>CRT_Object__c$Number__c</field>
</columns>
<columns>
<field>BucketField__Region</field>
</columns>
<format>Matrix</format>
<groupingsAcross>
<dateGranularity>Day</dateGranularity>
<field>CRT_Object__c$Id</field>
<sortOrder>Asc</sortOrder>
</groupingsAcross>
<groupingsAcross>
<dateGranularity>Year</dateGranularity>
<field>CRT_Object__c$LastModifiedDate</field>
<sortOrder>Asc</sortOrder>
</groupingsAcross>
<groupingsDown>
<dateGranularity>Day</dateGranularity>
<field>CRT_Object__c$CreatedBy</field>
<sortOrder>Asc</sortOrder>
</groupingsDown>
<groupingsDown>
<dateGranularity>Day</dateGranularity>
<field>CRT_Object__c$Currency__c</field>
<sortOrder>Desc</sortOrder>
</groupingsDown>
<name>CrtMMVC</name>
<reportType>CRT1__c</reportType>
<scope>organization</scope>
<showDetails>false</showDetails>
<timeFrameFilter>
<dateColumn>CRT_Object__c$CreatedDate</dateColumn>
<interval>INTERVAL_CUSTOM</interval>
</timeFrameFilter>
</Report>
488
Metadata Types
Report
489
Metadata Types
Report
<value>all</value>
</params>
<params>
<name>probability</name>
<value>0</value>
</params>
<params>
<name>co</name>
<value>1</value>
</params>
<reportType>Opportunity</reportType>
<scope>organization</scope>
<timeFrameFilter>
<dateColumn>CLOSE_DATE</dateColumn>
<interval>INTERVAL_CUSTOM</interval>
</timeFrameFilter>
</block>
<block>
<blockInfo>
<!-- This is how the block defines that the custom summary formula should be referenced.
In this example, its the cross-block custom summary formula FORMULA 1 defined above. This
block report has blockId B2.-->
<aggregateReferences>
<aggregate>FORMULA1</aggregate>
</aggregateReferences>
<blockId>B2</blockId>
<joinTable>a</joinTable>
</blockInfo>
<columns>
<field>USERS.NAME</field>
</columns>
<columns>
<field>TYPE</field>
</columns>
<columns>
<field>DUE_DATE</field>
</columns>
<columns>
<field>LAST_UPDATE</field>
</columns>
<columns>
<field>ADDRESS1_STATE</field>
</columns>
<format>Summary</format
<name>Accounts block 5</name>
<params>
<name>terr</name>
<value>all</value>
</params>
<params>
<name>co</name>
<value>1</value>
</params>
<reportType>AccountList</reportType>
490
Metadata Types
Report
<scope>organization</scope>
<timeFrameFilter>
<dateColumn>CREATED_DATE</dateColumn>
<interval>INTERVAL_CUSTOM</interval>
</timeFrameFilter>
</block>
<blockInfo>
<blockId xsi:nil="true"/>
<joinTable>a</joinTable>
</blockInfo>
<chart>
<backgroundColor1>#FFFFFF</backgroundColor1>
<backgroundColor2>#FFFFFF</backgroundColor2>
<backgroundFadeDir>Diagonal</backgroundFadeDir>
<chartSummaries>
<axisBinding>y</axisBinding>
<!-- This is how chart aggregates are designed in multiblock. We're using RowCount from
Block 1.-->
<column>B1#RowCount</column>
</chartSummaries>
<chartType>HorizontalBar</chartType>
<enableHoverLabels>false</enableHoverLabels>
<expandOthers>true</expandOthers>
<groupingColumn>ACCOUNT_NAME</groupingColumn>
<location>CHART_TOP</location>
<showAxisLabels>true</showAxisLabels>
<showPercentage>false</showPercentage>
<showTotal>false</showTotal>
<showValues>false</showValues>
<size>Medium</size>
<summaryAxisRange>Auto</summaryAxisRange>
<textColor>#000000</textColor>
<textSize>12</textSize>
<titleColor>#000000</titleColor>
<titleSize>18</titleSize>
</chart>
<format>MultiBlock</format>
<groupingsDown>
<dateGranularity>Day</dateGranularity>
<field>ACCOUNT_NAME</field>
<sortOrder>Asc</sortOrder>
</groupingsDown>
<name>mb_mbapi</name>
<reportType>Opportunity</reportType>
<showDetails>true</showDetails>
</Report>
SEE ALSO:
Dashboard
491
Metadata Types
ReportType
ReportType
Represents the metadata associated with a custom report type. This type extends the Metadata metadata type and inherits its fullName
field. Custom report types allow you to build a framework from which users can create and customize reports. For more information,
see Set Up a Custom Report Type in the Salesforce online help.
Version
Custom report types are available in API version 14.0 and later.
Fields
Field Name
Field Type
Description
autogenerated
boolean
Indicates that the report type was automatically generated when historical
trending was enabled for an entity.
Available in API version 29 and later.
baseObject
string
Required. The primary object for the custom report type, for example,
Account. All objects, including custom objects, are supported. You cannot
edit this field after initial creation.
category
ReportTypeCategory
(enumeration of type string)
Required. This field controls the category for the report. The valid values
are:
accounts
opportunities
forecasts
cases
leads
campaigns
activities
busop
products
admin
territory
territory2 (This value is available in API version 31.0 and later.)
usage_entitlement
wdc (This value is available in API version 29.0 and later.)
calibration (This value is available in API version 29.0 and later.)
492
Metadata Types
Field Name
ReportType
Field Type
Description
other
content
deployed
boolean
description
string
fullName
string
The report type developer name used as a unique identifier for API access.
The fullName can contain only underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces, not
end with an underscore, and not contain two consecutive underscores.
join
ObjectRelationship
label
string
sections
ReportLayoutSection[]
The groups of columns available for the report type. Though columns are
not strictly required, a report without columns is not very useful.
ObjectRelationship
ObjectRelationship represents a join to another object. For more information, see Add Child Objects To Your Custom Report Type in
the Salesforce online help.
Field Name
Field Type
Description
join
ObjectRelationship
This field is a recursive reference that allows you to join more than two objects.
A maximum of four objects can be joined in a custom report type. When more
than two objects are joined, an inner join is not allowed if there has been an
outer join earlier in the join sequence. The baseObject is first joined to the
object specified in relationship; the resulting data set is then joined with
any objects specified in this field.
outerJoin
boolean
relationship
string
Required. The object joined to the primary object; for example, Contacts.
ReportLayoutSection
ReportLayoutSection represents a group of columns used in the custom report type.
Field Name
Field Type
Description
columns
ReportTypeColumn[]
493
Metadata Types
ReportType
Field Name
Field Type
Description
masterLabel
string
ReportTypeColumn
ReportTypeColumn represents a column in the custom report type.
Field Name
Field Type
Description
checkedByDefault boolean
displayNameOverride string
field
string
table
string
Required. The table associated with the field; for example, Account.
494
Metadata Types
Role
<field>Opportunity__c.Amount</field>
<table>Account</table>
</columns>
<columns>
<checkedByDefault>false</checkedByDefault>
<field>Owner.IsActive</field>
<table>Account</table>
</columns>
<masterLabel>Accounts</masterLabel>
</sections>
<sections>
<columns>
<checkedByDefault>false</checkedByDefault>
<field>Owner.Email</field>
<table>Account.Contacts</table>
</columns>
<columns>
<checkedByDefault>false</checkedByDefault>
<field>byr__c</field>
<table>Account.Contacts</table>
</columns>
<columns>
<checkedByDefault>true</checkedByDefault>
<field>ReportsTo.CreatedBy.Contact.Owner.MobilePhone</field>
<table>Account.Contacts</table>
</columns>
<masterLabel>Contacts</masterLabel>
</sections>
</ReportType>
Usage
The custom report type refers to fields by using their API names. For a historical field (one that has trackTrending set to true)
the API name includes hst, such as Field2__c_hst.
<sections>
<columns>
<checkedByDefault>false</checkedByDefault>
<field>Field2__c_hst</field>
<table>CustomTrendedObject__c.CustomTrendedObject__c_hst</table>
</columns>
<masterLabel>History</masterLabel>
</sections>
Role
Represents a role in your organization.
495
Metadata Types
RoleOrTerritory
Version
Role components are available in API version 24.0 and later.
Fields
This metadata type extends to subtype RoleOrTerritory on page 496.
Field Name
Field Type
Description
fullName
string
The unique identifier for API access. The fullName can contain only
underscores and alphanumeric characters. It must be unique, begin with
a letter, not include spaces, not end with an underscore, and not contain
two consecutive underscores. This field is inherited from the Metadata
component. Corresponds to Role Name in the user interface.
parentRole
string
RoleOrTerritory
Represents the common base type and valid values for role or territory.
Version
RoleOrTerritory components are available in API version 24.0 and later.
Note: You cant create a RoleOrTerritory component directly. Use the Role or Territory metadata types instead.
496
Metadata Types
RoleOrTerritory
Fields
Field Name
Field Type
Description
caseAccessLevel
string
Specifies whether a user can access other users cases that are associated
with accounts the user owns. Valid values are:
Read
Edit
None
This field is not visible if your organizations sharing model for cases is
Public Read/Write.
If no value is set for this field, this field value uses the default access level
that is specified in the Manage Territory page in Setup.
contactAccessLevel
string
Specifies whether a user can access other users contacts that are
associated with accounts the user owns. Valid values are:
Read
Edit
None
This field is not visible if your organizations sharing model for contacts
is Public Read/Write or Controlled by Parent.
If no value is set for this field, this field value uses the default access level
that is specified in the Manage Territory page in Setup.
description
string
fullName
string
The unique identifier for API access. The fullName can contain only
underscores and alphanumeric characters. It must be unique, begin with
a letter, not include spaces, not end with an underscore, and not contain
two consecutive underscores. This field is inherited from the Metadata
component.
mayForecastManagerShare boolean
name
string
opportunityAccessLevel string
Indicates whether the forecast manager can manually share their own
forecast.
Required. The name of the role or territory.
Specifies whether a user can access other users opportunities that are
associated with accounts the user owns. Valid values are:
Read
Edit
None
This field is not visible if your organizations sharing model for
opportunities is Public Read/Write.
If no value is set for this field, this field value uses the default access level
that is specified in the Manage Territory page in Setup.
497
Metadata Types
SamlSsoConfig
SEE ALSO:
Role
Territory
SamlSsoConfig
Represents a SAML Single Sign-On configuration. This type extends the Metadata metadata type and inherits its fullName field.
Single sign-on is a process that allows network users to access all authorized network resources without having to log in separately to
each resource. Single sign-on allows you to validate usernames and passwords against your corporate user database or other client
application rather than having separate user passwords managed by Salesforce.
Version
SamlSsoConfig components are available in API version 28.0 and later.
498
Metadata Types
SamlSsoConfig
Fields
Field Name
Field Type
Description
attributeName
string
The name of the identity providers application. Get this from your identity
provider.
attributeNameIdFormat string
decryptionCertificate string
errorUrl
string
The URL of the page users should be directed to if theres an error during
SAML login. It must be a publicly accessible page, such as a public site
Visualforce page. The URL can be absolute or relative.
executionUserId
string
The user that runs the Apex handler class. The user must have the
Manage Users permission. A user is required if you specify a SAML JIT
handler class.
identityLocation
SamlIdentityLocationType The location in the assertion where a user should be identified. Valid
(enumeration of type
values are:
string)
SubjectNameId The identity is in the <Subject>
statement of the assertion.
Attribute The identity is specified in an
<AttributeValue>, located in the <Attribute> of the
assertion.
identityMapping
SamlIdentityType
(enumeration of type
string)
The identifier the service provider uses for the user during Just-in-Time
user provisioning. Valid values are:
Username The users Salesforce username.
FederationId The federation ID from the user object; the
identifier used by the service provider for the user.
UserId The user ID from the users Salesforce organization.
issuer
string
loginUrl
string
For SAML 2.0 only: The URL where Salesforce sends a SAML request to
start the login sequence.
logoutUrl
string
For SAML 2.0 only: The URL to direct the user to when they click the
Logout link. The default is http://www.salesforce.com.
name
string
The unique name used by the API and managed packages. The name
must begin with a letter and use only alphanumeric characters and
499
Metadata Types
Field Name
SamlSsoConfig
Field Type
Description
underscores. The name cannot end with an underscore or have two
consecutive underscores.
oauthTokenEndpoint
string
For SAML 2.0 only: The ACS URL used with enabling Salesforce as an
identity provider in the Web single sign-on OAuth assertion flow.
redirectBinding
boolean
requestSignatureMethod string
The method thats used to sign the SAML request. Valid values are
RSA-SHA1 and RSA-SHA256.
salesforceLoginUrl
string
The URL associated with login for the Web single sign-on flow.
samlEntityId
string
samlJitHandlerId
string
samlVersion
userProvisioning
boolean
validationCert
string
The certificate used to validate the request. Get this from your identity
provider.
500
Metadata Types
Scontrol
</loginUrl>
<logoutUrl>https://www.salesforce.com</logoutUrl>
<name>SomeCompany</name>
<oauthTokenEndpoint>
https://login.salesforce.com/services/oauth2/token?so=00DD0000000JxeI
</oauthTokenEndpoint>
<redirectBinding>true</redirectBinding>
<requestSignatureMethod>RSA-SHA1</requestSignatureMethod>
<salesforceLoginUrl>
https://login.salesforce.com?so=00DD0000000JxeI
</salesforceLoginUrl>
<samlEntityId>
https://saml.salesforce.com/customPath
</samlEntityId>
<samlVersion>SAML2_0</samlVersion>
<userProvisioning>false</userProvisioning>
<validationCert>
MIIEojCCA4qgAwIBAgIOATtxsoBFAAAAAD4...
</validationCert>
</SamlSsoConfig>
Scontrol
Important: Visualforce pages supersede s-controls. Organizations that havent previously used s-controls cant create them.
Existing s-controls are unaffected, and can still be edited.
Deprecated. Represents an Scontrol component, corresponding to an s-control in the Salesforce user interface. For more information,
see About S-Controls in the Salesforce online help. This metadata type extends the MetadataWithContent component and shares its
fields.
Version
Scontrols are available in API version 10.0 and later.
Fields
This metadata type contains the following fields:
Field Name
Field Type
Description
content
base64Binary
501
Metadata Types
Field Name
Scontrol
Field Type
Description
for you by a SOAP client. This field is inherited from the
MetadataWithContent component.
of type string)
description
string
encodingKey
Encoding (enumeration of type string) Required. The default encoding setting is Unicode: UTF-8. Change
it if you are passing information to a URL that requires data in a different
format. This option is available when you select URL as the value for
contentSource.
fileContent
base64
File contents displayed if you add this s-control to a custom link. The
file can contain a Java applet, Active-X control, or any other type of
content you want. This option only applies to s-controls with a value
of HTML for contentSource.
fileName
string
The unique name for the s-control. This name can contain only
underscores and alphanumeric characters, and must be unique in
your organization. It must begin with a letter, not include spaces, not
end with an underscore, and not contain two consecutive underscores.
This field cannot be changed for components installed by a managed
package. It is only relevant if the fileContent field also has a value.
This is a new field in API version 14.0.
fullName
string
The s-control developer name used as a unique identifier for API access.
The fullName can contain only underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces,
not end with an underscore, and not contain two consecutive
underscores. If this field contained characters before version 14.0 that
are no longer allowed, the characters were stripped out of this field,
and the previous value of the field was saved in the name field. This
field is inherited from the Metadata component.
name
string
supportsCaching boolean
Optional text that describes the s-control. This only displays to users
with View All Data permission (administrator).
502
Metadata Types
Field Name
Settings
Field Type
Description
which s-controls are on the page when it reloads. This option only
applies to HTML s-controls.
Myriad_Publishing.scf-meta.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Scontrol xmlns="http://soap.sforce.com/2006/04/metadata">
<contentSource>URL</contentSource>
<description>s-control to open Myriad Publishing website.</description>
<encodingKey>UTF-8</encodingKey>
<name>Myriad Publishing</name>
<supportsCaching>true</supportsCaching>
</Scontrol>
Settings
Represents the organization settings related to a feature. For example, your password policies, session settings and network access
controls are all available in the SecuritySettings component type. Not all feature settings are available in the Metadata API. See Unsupported
Metadata Types on page 113 for information on which feature settings are not available.
Settings can be accessed using the specific component member or via wildcard. For example, in the package manifest file you would
use the following section to access SecuritySettings:
<types>
<members>Security</members>
<name>Settings</name>
</types>
The member format when used in the package manifest is the component metadata type name without the Settings suffix, so in the
preceding example Security is used instead of SecuritySettings.
503
Metadata Types
Settings
Version
Settings is available in API version 27.0 and later. See the version information for the individual setting component to determine which
API version the settings component became available.
The following is an example package manifest used to deploy or retrieve all the available settings metadata for an organization, using
a wildcard:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>Settings</name>
</types>
<version>27.0</version>
</Package>
SEE ALSO:
AccountSettings
ActivitiesSettings
AddressSettings
CaseSettings
ChatterAnswersSettings
CompanySettings
ContractSettings
EntitlementSettings
ForecastingSettings
IdeasSettings
KnowledgeSettings
MobileSettings
SecuritySettings
504
Metadata Types
AccountSettings
AccountSettings
Represents an organizations account settings for account teams, account owner report, and the View Hierarchy link. This type extends
the Metadata metadata type and inherits its fullName field.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
AccountSettings is available in API versions 29.0 and later.
Fields
Field Name
Field Type
enableAccountOwnerReport boolean
enableAccountTeams
boolean
Description
Indicates whether Account Owner Report may (true) or may not
(false) be run by all users.
Indicates whether Account Teams are enabled (true) or not (false).
The Metadata API cant be used to disable Account Teams.
showViewHierarchyLink
boolean
505
Metadata Types
ActivitiesSettings
<version>29.0</version>
</Package>
SEE ALSO:
Settings
ActivitiesSettings
Represents an organizations activity settings, and its user interface settings for the calendar. Use the ActivitiesSettings component type
to control the following activity settings:
Configure group and recurring tasks, recurring and multiday events, and email tracking
Relate multiple contacts to tasks and events (shared activities)
Display custom logos in meeting requests
Also use the ActivitiesSettings component type to control user interface settings for the calendar, including hover links and drag-and-drop
editing.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
ActivitiesSettings is available in API versions 28.0 and later.
Fields
Settings for all types listed below are controlled on the Activity settings page or the User Interface settings page as noted.
Field Name
Field Type
allowUsersToRelateMultipleContactsToTasksAndEvents boolean
Description
This read only field indicates whether Shared Activities is enabled. When
the value is true, allows users to relate multiple contacts to a task or
event.
Important: Beginning with API v36.0, this field is read-only in
all versions of the API. You cant change the value of this field.
Even though this field was updateable before Spring '16, changing
this fields value wasn't supported and could have resulted in an
incorrect integration. If you have code in older API versions that
changes the value of this field, ensure you update that code to
prevent any errors.
enableActivityReminders
boolean
506
Metadata Types
ActivitiesSettings
Field Name
Field Type
Description
enableClickCreateEvents
boolean
enableDragAndDropScheduling boolean
enableEmailTracking
boolean
enableGroupTasks
boolean
enableListViewScheduling boolean
enableMultidayEvents
boolean
Enables creation of events that end more than 24 hours after they start.
Administrators control this field on the Activity settings page.
enableRecurringEvents
boolean
enableRecurringTasks
boolean
enableSidebarCalendarShortcut boolean
enableSimpleTaskCreateUI boolean
507
Metadata Types
Field Name
ActivitiesSettings
Field Type
enableUNSTaskDelegatedToNotifications boolean
meetingRequestsLogo
string
Description
On the Activity settings page, exposes a setting for administrators to
hide or show a user setting that lets individual users enable or disable
email notifications when tasks are assigned to them.
Available when showCustomLogoMeetingRequests is enabled.
Uploads a custom logo. An administrator can select only a logo that has
been uploaded to certain folders in the Documents tab.
Administrators control this field on the Activity settings page.
showCustomLogoMeetingRequests boolean
showEventDetailsMultiUserCalendar boolean
showHomePageHoverLinksForEvents boolean
showMyTasksHoverLinks
boolean
In the My Tasks section of the Home tab and on the calendar day view:
When a user hovers over the subject of a task, a hover link displays
an overlay with selected task details.
When a user clicks the subject of a task, displays the task detail page.
Administrators use a mini page layout to configure the fields shown in
the overlay.
Administrators control this field on the User Interface settings page.
showRequestedMeetingsOnHomePage boolean
508
Metadata Types
AddressSettings
SEE ALSO:
Document
AddressSettings
Represents the configuration of country and state picklists. Use the AddressSettings component type to configure state and country
data in your organization so that you can convert text-based values into standard picklist values. To convert your state and country
values, from Setup, enter State and Country Picklists in the Quick Find box, then select State and Country Picklists
. For more information, see State and Country Picklists in the Salesforce online help.
This type extends the Metadata metadata type and inherits its fullName field.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
509
Metadata Types
AddressSettings
Version
AddressSettings is available in API versions 27.0 and later.
CountriesAndStates
This complex metadata type represents valid definitions of states and countries in picklists.
Note: You can use the Metadata API to edit existing states and countries in state and country picklists. You cant use the Metadata
API to create or delete new states or countries.
Field
Field Type
Description
countries
Country[]
Country
This metadata type provides the definition for a country in a picklist.
Field
Field Type
Description
active
boolean
integrationValue
string
isoCode
string
510
Metadata Types
AddressSettings
Field
Field Type
Description
label
string
orgDefault
boolean
standard
boolean
Standard states and countries are states and countries that are
included with Salesforce. You cant edit the standard
attribute.
states
State[]
visible
boolean
State
This metadata type provides the definition for a state in a picklist.
Field
Field Type
Description
active
boolean
integrationValue
string
isoCode
string
label
string
511
Metadata Types
AddressSettings
Field
Field Type
Description
standard
boolean
Standard states and countries are states and countries that are
included with Salesforce. You cant edit the standard
attribute.
visible
boolean
512
Metadata Types
BusinessHoursSettings
<active>true</active>
<integrationValue>Alberta</integrationValue>
<isoCode>AB</isoCode>
<label>Alberta</label>
<standard>true</standard>
<visible>true</visible>
</state>
<state>
<active>true</active>
<integrationValue>British Columbia</integrationValue>
<isoCode>BC</isoCode>
<label>British Columbia</label>
<standard>true</standard>
<visible>true</visible>
</state>
</states>
<visible>true</visible>
</country>
<country>
<active>true</active>
<integrationValue>Greenland</integrationValue>
<isoCode>GL</isoCode>
<label>Greenland</label>
<standard>true</standard>
<visible>false</visible>
</country>
</countries>
</countriesAndStates>
</AddressSettings>
SEE ALSO:
Settings
BusinessHoursSettings
Represents the metadata used to manage settings for business hours and holidays in entitlements, entitlement templates, campaigns,
and cases. This type extends the Metadata metadata type and inherits its fullName field.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
BusinessHoursSettings is available in API version 29.0 and later.
513
Metadata Types
BusinessHoursSettings
Fields
Field Name
Field Type
Description
businessHours
BusinessHoursEntry[]
holidays
Holidays[]
BusinessHoursEntry
Represents the application of business hours to entitlements, entitlement templates, campaigns, and cases.
Field Name
Field Type
Description
timeZoneId
string
The time zone for the time that defines business hours.
name
string
active
string
default
string
Indicates whether the business hours are used as the default business
hours.
mondayStartTime
string
Start time for the business hours on Monday. Uses the format
HH:mm:ss.SSSZ.
mondayEndTime
string
End time for the business hours on Monday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Monday.
tuesdayStartTime
string
Start time for the business hours on Tuesday. Uses the format
HH:mm:ss.SSSZ.
tuesdayEndTime
string
End time for the business hours on Tuesday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Tuesday.
wednesdayStartTime
string
Start time for the business hours on Wednesday. Uses the format
HH:mm:ss.SSSZ.
wednesdayEndTime
string
End time for the business hours on Wednesday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Wednesday.
thursdayStartTime
string
Start time for the business hours on Thursday. Uses the format
HH:mm:ss.SSSZ.
thursdayEndTime
string
End time for the business hours on Thursday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Thursday.
fridayStartTime
string
Start time for the business hours on Friday. Uses the format
HH:mm:ss.SSSZ.
514
Metadata Types
BusinessHoursSettings
Field Name
Field Type
Description
fridayEndTime
string
End time for the business hours on Friday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Friday.
saturdayStartTime
string
Start time for the business hours on Saturday. Uses the format
HH:mm:ss.SSSZ.
saturdayEndTime
string
End time for the business hours on Saturday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Saturday.
sundayStartTime
string
Start time for the business hours on Sunday. Uses the format
HH:mm:ss.SSSZ.
sundayEndTime
string
End time for the business hours on Sunday. Uses the format
HH:mm:ss.SSSZ. The value 00:00:00.000Z specifies midnight
on Sunday.
Holidays
Represents a holiday and its usage in businessHours.
Field Name
Field Type
Description
name
string
description
string
isRecurring
string
activityDate
string
The date of the holiday. Use for non-recurring holidays. Uses the format
HH:mm:ss.SSSZ.
recurrenceStartDate
string
The date the holiday starts recurring. Uses the format yyyy-mm-dd.
recurrenceEndDate
string
The date the holiday stops recurring. Uses the format yyyy-mm-dd.
Optional.
startTime
string
The start time on the date of the holiday. Uses the format
HH:mm:ss.SSSZ. startTime and endTime must be both null
or both not null. If they are both null, indicates the whole day.
endTime
string
The end time on the date of the holiday. Uses the format
HH:mm:ss.SSSZ. startTime and endTime must be both null
or both not null. If they are both null, indicates the whole day.
recurrenceType
string
recurrenceInterval
string
515
Metadata Types
BusinessHoursSettings
Field Name
Field Type
Description
recurrenceDayOfWeek
string
The day of week the holiday recurs. Valid values: Monday, Tuesday,
Wednesday, Thursday, Friday, Saturday, Sunday.
recurrenceDayOfMonth
string
The day of month the holiday recurs. Valid values: integers 1-31.
recurrenceInstance
string
Valid values: First, Second, Third, Fourth, Last. Only used for
recurrenceType RecursMonthlyNth and RecursYearlyNth. For example,
if the recurenceInstance value is First, the holiday recurs on the
first Monday of the month every 3 months.
recurrenceMonthOfYear
string
Valid values: January, February, March, April, May, June, July, August,
September, October, November, December.
businessHours
string
The name of the business hours setting that applies to this holiday.
516
Metadata Types
CaseSettings
<sundayStartTime>00:00:00.000Z</sundayStartTime>
<thursdayEndTime>17:00:00.000Z</thursdayEndTime>
<thursdayStartTime>10:50:00.000Z</thursdayStartTime>
<timeZoneId>America/Los_Angeles</timeZoneId>
<tuesdayEndTime>13:00:00.000Z</tuesdayEndTime>
<tuesdayStartTime>09:00:00.000Z</tuesdayStartTime>
<wednesdayEndTime>15:00:00.000Z</wednesdayEndTime>
<wednesdayStartTime>09:00:00.000Z</wednesdayStartTime>
</businessHours>
<holidays>
<activityDate>2013-09-02</activityDate>
<businessHours>Default</businessHours>
<businessHours>bh1</businessHours>
<isRecurring>false</isRecurring>
<name>Labor Day</name>
</holidays>
<holidays>
<businessHours>bh1</businessHours>
<isRecurring>true</isRecurring>
<name>Thanksgiving</name>
<recurrenceDayOfMonth>21</recurrenceDayOfMonth>
<recurrenceMonthOfYear>November</recurrenceMonthOfYear>
<recurrenceStartDate>2013-11-21</recurrenceStartDate>
<recurrenceType>RecursYearly</recurrenceType>
</holidays>
</BusinessHoursSettings>
The following is an example package.xml manifest that references the BusinessHoursSettings definitions:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>BusinessHours</members>
<name>Settings</name>
</types>
<version>29.0</version>
</Package>
CaseSettings
Represents an organizations case settings, such as the default case owner, which case-related features are enabled, and which email
templates are used for various case activities.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
CaseSettings is available in API version 27.0 and later.
517
Metadata Types
CaseSettings
Fields
Field Name
Field Type
Description
caseAssignNotificationTemplate string
caseCloseNotificationTemplate string
caseCommentNotificationTemplate string
caseCreateNotificationTemplate string
caseFeedItemSettings
FeedItemSettings[]
closeCaseThroughStatusChange boolean
defaultCaseOwner
string
defaultCaseOwnerType
string
defaultCaseUser
string
Specifies the user listed in the Case History related list for
automated case changes from:
Assignment rules
Escalation rules
On-Demand Email-to-Case
Cases logged in the Self-Service portal
emailToCase
EmailToCaseSettings
enableCaseFeed
boolean
enableDraftEmails
boolean
enableEarlyEscalationRuleTriggers boolean
518
Metadata Types
Field Name
CaseSettings
Field Type
Description
enableNewEmailDefaultTemplate boolean
enableSuggestedArticlesApplication boolean
enableSuggestedArticlesCustomerPortal boolean
enableSuggestedArticlesPartnerPortal boolean
boolean
enableSuggestedSolutions
keepRecordTypeOnAssignmentRule boolean
newEmailDefaultTemplateClass string
notifyContactOnCaseComment
boolean
notifyDefaultCaseOwner
boolean
notifyOwnerOnCaseComment
boolean
notifyOwnerOnCaseOwnerChange boolean
showFewerCloseActions
boolean
519
Metadata Types
CaseSettings
Field Name
Field Type
Description
useSystemEmailAddress
boolean
webToCase
WebToCaseSettings
EmailToCaseSettings
Represents an organizations Email-to-Case settings.
Fields
Field Name
Field Type
Description
enableEmailToCase
boolean
enableHtmlEmail
boolean
enableOnDemandEmailToCase boolean
boolean
enableThreadIDInSubject boolean
notifyOwnerOnNewCaseEmail boolean
enableThreadIDInBody
overEmailLimitAction
preQuoteSignature
boolean
routingAddresses
EmailToCaseRoutingAddress[]
520
Metadata Types
Field Name
CaseSettings
Field Type
Description
EmailToCaseRoutingAddress
Represents an organizations Email-to-Case routing address.
Fields
Field Name
Field Type
Description
addressType
authorizedSenders
string
caseOrigin
string
Specifies the default case origin for cases created through this
routing address.
caseOwner
string
caseOwnerType
string
casePriority
string
createTask
boolean
emailAddress
string
routingName
string
saveEmailHeaders
boolean
521
Metadata Types
CaseSettings
Field Name
Field Type
Description
taskStatus
string
FeedItemSettings
Represents an organizations feed item settings. Available in API version 32.0 and later.
Field Name
Field Type
Description
characterLimit
int
collapseThread
boolean
displayFormat
FeedItemDisplayFormat
(enumeration of type string)
Indicates how email feed items are displayed. Valid values are:
DefaultBlank lines in email feed items are displayed.
HideBlankLinesBlank lines in email feed items
are not displayed.
feedItemType
FeedItemType (enumeration of The type of feed item to which the settings apply. For
type string)
FeedItemSettings, the only valid feedItemType
value is EmailMessageEvent.
WebToCaseSettings
Represents an organizations Web-to-Case settings.
Fields
Field Name
Field Type
Description
caseOrigin
string
Specifies the default case origin for cases created through this web form.
Only applies if enableWebToCase is set to true.
defaultResponseTemplate
string
enableWebToCase
boolean
522
Metadata Types
CaseSettings
523
Metadata Types
ChatterAnswersSettings
<enableEarlyEscalationRuleTriggers>true</enableEarlyEscalationRuleTriggers>
<enableNewEmailDefaultTemplate>true</enableNewEmailDefaultTemplate>
<enableSuggestedArticlesApplication>true</enableSuggestedArticlesApplication>
<enableSuggestedArticlesCustomerPortal>true</enableSuggestedArticlesCustomerPortal>
<enableSuggestedArticlesPartnerPortal>false</enableSuggestedArticlesPartnerPortal>
<enableSuggestedSolutions>false</enableSuggestedSolutions>
<keepRecordTypeOnAssignmentRule>true</keepRecordTypeOnAssignmentRule>
<newEmailDefaultTemplateClass>CaseTemplateController</newEmailDefaultTemplateClass>
<notifyContactOnCaseComment>true</notifyContactOnCaseComment>
<notifyDefaultCaseOwner>true</notifyDefaultCaseOwner>
<notifyOwnerOnCaseComment>true</notifyOwnerOnCaseComment>
<notifyOwnerOnCaseOwnerChange>false</notifyOwnerOnCaseOwnerChange>
<showFewerCloseActions>false</showFewerCloseActions>
<useSystemEmailAddress>true</useSystemEmailAddress>
<webToCase>
<caseOrigin>Web</caseOrigin>
<defaultResponseTemplate>unfiled$public/SupportCaseResponse</defaultResponseTemplate>
<enableWebToCase>true</enableWebToCase>
</webToCase>
</CaseSettings>
SEE ALSO:
Settings
ChatterAnswersSettings
Represents the metadata used to manage settings for Chatter Answers.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
ChatterAnswersSettings is available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
emailFollowersOnBestAnswer boolean
Indicates whether users are notified when a best answer is selected for
a question that theyre following (true) or not (false).
boolean
Indicates whether users are notified when other users reply to questions
theyre following (true) or not (false).
emailFollowersOnReply
524
Metadata Types
Field Name
ChatterAnswersSettings
Field Type
emailOwnerOnPrivateReply boolean
Description
Indicates whether users are notified when customer support responds
to their questions privately (true) or not (false).
emailOwnerOnReply
boolean
Indicates whether users are notified when other users reply to their
questions (true) or not (false).
enableAnswerViaEmail
boolean
enableChatterAnswers
boolean
enableFacebookSSO
boolean
enableInlinePublisher
boolean
enableReputation
boolean
enableRichTextEditor
boolean
Indicates whether the rich text editor is enabled for users to format text
and upload images when posting questions (true) or not (false).
To enable rich text editor, you must enable Optimize Question Flow.
facebookAuthProvider
string
showInPortals
boolean
525
Metadata Types
CompanySettings
<enableChatterAnswers>true</enableChatterAnswers>
<enableFacebookSSO>true</enableFacebookSSO>
<enableInlinePublisher>true</enableInlinePublisher>
<enableReputation>true</enableReputation>
<enableRichTextEditor>true</enableRichTextEditor>
<facebookAuthProvider>FacebookAuthProvider</facebookAuthProvider>
<showInPortals>true</showInPortals>
</ChatterAnswersSettings>
The following is an example package.xml manifest that references the ChatterAnswersSettings definitions:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>ChatterAnswers</members>
<name>Settings</name>
</types>
<version>29.0</version>
</Package>
SEE ALSO:
Settings
CompanySettings
Represents global settings that affect multiple features in your organization.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
Company Profile Settings are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
fiscalYear
FiscalYearSetting
526
Metadata Types
ContractSettings
FiscalYearSetting
Represents your organizations fiscal year setting.
Field
Field Type
Description
fiscalYearNameBasedOn
string
This field is used to determine the fiscal year name. Valid values
are endingMonth or startingMonth. For example, if
your fiscal year starts in April 2012 and ends in March 2013, and
this value is:
endingMonth, then 2013 is used for the fiscal year name.
startingMonth, then 2012 is used for the fiscal year
name.
startMonth
string
SEE ALSO:
Settings
ContractSettings
Represents contract settings. For more information, see Customizing Contract Settings in the Salesforce online help.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
ContractSettings is available in API version 27.0 and later.
527
Metadata Types
EntitlementSettings
Fields
Field Name
Field Type
Description
autoCalculateEndDate
boolean
notifyOwnersOnContractExpiration boolean
SEE ALSO:
Settings
EntitlementSettings
Represents an organizations entitlement settings.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
EntitlementSettings is available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
assetLookupLimitedToActiveEntitlementsOnAccount boolean
assetLookupLimitedToActiveEntitlementsOnContact boolean
528
Metadata Types
EntitlementSettings
Field Name
Field Type
Description
assetLookupLimitedToSameAccount
boolean
assetLookupLimitedToSameContact
boolean
enableEntitlements
boolean
enableEntitlementVersioning
boolean
entitlementLookupLimitedToActiveStatus boolean
entitlementLookupLimitedToSameAccount boolean
entitlementLookupLimitedToSameAsset boolean
entitlementLookupLimitedToSameContact boolean
529
Metadata Types
ForecastingSettings
</enableEntitlements>
<entitlementLookupLimitedToActiveStatus>
false
</entitlementLookupLimitedToActiveStatus>
<entitlementLookupLimitedToSameAccount>
false
</entitlementLookupLimitedToSameAccount>
<entitlementLookupLimitedToSameAsset>
false
</entitlementLookupLimitedToSameAsset>
<entitlementLookupLimitedToSameContact>
false
</entitlementLookupLimitedToSameContact>
</EntitlementSettings>
SEE ALSO:
Settings
ForecastingSettings
Represents the Collaborative Forecasts settings options. This type extends the Metadata metadata type and inherits its fullName
field.
Note: This information only applies to Collaborative Forecasts.
Version
ForecastingSettings components are available in API version 28 and later. The structure of the ForecastingSettings type changed
significantly in API version 30.0.
Fields
Field Name
Field Type
Description
displayCurrency
DisplayCurrency
(enumeration of
type string)
530
Metadata Types
ForecastingSettings
Field Name
Field Type
Description
enableForecasts
boolean
forecastingTypeSettings
ForecastingType
Settings[]
forecastingCategoryMappings ForecastingCategoryMappings[] A list of mappings associating forecast types with forecast rollups.
ForecastingTypeSettings
The settings for each forecast type. An organization can have up to 4 forecast types active. Omitting a previously enabled forecast type
that has a minimum API version less than or equal to the metadata package version deletes its quota and adjustment data from the
organization.
Warning: Omitting a forecast type field from the XML can deactivate that forecast type: if the forecast type was available in the
release specified by the XML package version, that forecast type is deactivated and its quota and adjustment data are deleted.
Field Name
Field Type
Description
active
boolean
This indicates whether the forecast type specified in the name field is
active.
Note: Setting the active field to false purges all forecasting
data, adjustments, and quotas for the forecast type. When
active is set to true, some values on the Forecasts tab may
not appear immediately. An in-process icon appears to indicate
that the values are being calculated.
adjustmentsSettings
forecastRangeSettings
name
string
The name of the forecast type. Each forecast type requires a specific
string.
Valid values include:
OpportunityRevenue : Opportunities - Revenue
OpportunityQuantity : Opportunities - Quantity
OpportunitySplitRevenue : Opportunity Revenue Splits Revenue
OpportunityOverlayRevenue : Opportunity Overlay Splits
- Revenue
OpportunityLineItemRevenue : Product Families Revenue
OpportunityLineItemQuantity : Product Families Quantity
531
Metadata Types
Field Name
ForecastingSettings
Field Type
Description
The name of a custom opportunity split type that has been enabled
as a forecast type. Custom split types are based on currency fields,
which can only contain revenue amounts.
opportunityListFields
SelectedSettings
OpportunityListFields The fields selected to appear in the opportunity pane of the forecast
SelectedSettings
page for the forecast type. Opportunity Name is required. You
can select up to 15 fields.
quotasSettings
QuotasSettings
forecastedCategoryApiNames string
displayedCategoryApiNames string
This read-only field appears four times to specify the four forecast rollup
categories displayed in the Forecasts tab, for either cumulative forecast
rollups, or individual forecast category rollups. Always use the same 4
values for both displayedCategoryApiNames and
forecastedCategoryApiNames.
Valid values for organizations using cumulative forecast rollups:
openpipeline
bestcaseforecast
commitforecast
closedonly
Valid values for organizations using individual forecast category rollups:
pipelineonly
bestcaseonly
commitonly
closedonly
532
Metadata Types
Field Name
ForecastingSettings
Field Type
managerAdjustableCategoryApiNames string
Description
This read-only field appears twice to specify the two forecast rollup
categories that forecast managers can adjust in the organization for
either cumulative forecast rollups or individual forecast category rollups.
This field can only be used when the enableAdjustments field
contains a value of true. If both the
managerAdjustableCategoryApiNames and
ownerAdjustableCategoryApiNames fields are being used,
they must contain the same two values. Their values must also be
consistent with the values of the enableAdjustments and
enableOwnerAdjustments fields.
Valid values for organizations using cumulative forecast rollups:
bestcaseforecast
commitforecast
Valid values for organizations using individual forecast category rollups:
bestcaseonly
commitonly
ownerAdjustableCategoryApiNames string
This read-only field appears twice to specify the two forecast rollup
categories that forecast owners can adjust in the organization, for either
cumulative forecast rollups, or individual forecast category rollups. This
field can only be used when the enableOwnerAdjustments field
contains a value of true. If both the
managerAdjustableCategoryApiNames and
ownerAdjustableCategoryApiNames fields are being used,
they must contain the same two values. Their values must also be
consistent with the values of the enableAdjustments and
enableOwnerAdjustments fields.
Valid values for organizations using cumulative forecast rollups:
bestcaseforecast
commitforecast
Valid values for organizations using individual forecast category rollups:
bestcaseonly
commitonly
AdjustmentsSettings
The adjustment options for Collaborative Forecasts.
533
Metadata Types
ForecastingSettings
Field
Field Type
Description
enableAdjustments
boolean
enableOwnerAdjustments boolean
ForecastRangeSettings
The default periods and range selections in Collaborative Forecasts. Users can forecast up to 12 months or eight quarters in the future
or past. If your forecast range includes the current month or quarter, the Forecasts page displays the current month or quarter by default.
If not, then the first month or quarter of the range is selected by default. All forecast types must contain the same
forecastRangeSettings field values.
Warning: If you change the period setting from monthly to quarterly or quarterly to monthly, or you change the standard fiscal
year, all adjustments and quotas are purged. If you enable custom fiscal years, creating the first custom fiscal year deletes any
quotas and adjustments in the corresponding and subsequent standard fiscal years. These changes trigger a forecast recalculation
that can take significant time, depending on the quantity of your data.
Field
Field Type
Description
beginning
int
displaying
int
periodType
PeriodTypes (enumeration of
type string)
OpportunityListFieldsSelectedSettings
The fields selected to appear in the opportunity pane of the forecast page for the forecast type. Opportunity Name is required.
You can select up to 15 fields.
Field
Field Type
Description
field
string
534
Metadata Types
ForecastingSettings
QuotasSettings
QuotasSettings indicates if quotas is available in Collaborative Forecasts.
Field
Field Type
Description
showQuotas
boolean
ForecastingCategoryMappings
The forecasting category mappings for Collaborative Forecasts. This subtype appears eight times within the ForecastingSettings
type. Each occurrence includes fields that specify a type of forecast category rollup, which forecast categories each rollup includes, and
the weight of each forecast category in the rollup. Organizations using either cumulative forecast rollups or individual forecast category
columns must include all eight occurrences of this subtype.
Field
Field Type
Description
forecastingItemCategoryApiName string
This field specifies the API name of the rollup type. The valid
values are:
openpipeline
bestcaseforecast
commitforecast
pipelineonly
bestcaseonly
commitonly
closedonly
omittedonly
weightedSourceCategories WeightedSourceCategories[]
This field can occur more than once when specifying more than
one forecast category to include in the rollup type. Each
occurrence contains two subfields that specify a forecast
category to include in the forecast rollup type and its weight.
Some rollup types include more than one forecast category. This
list shows the forecast categories that are included in each rollup
type.
Rollup: openpipeline, Forecast categories: pipeline, best
case, commit
Rollup: bestcaseforecast, Forecast categories: best case,
commit, closed
Rollup: commitforecast, Forecast categories: commit, closed
Rollup: pipelineonly, Forecast categories: pipeline
Rollup: bestcaseonly, Forecast categories: best case
Rollup: commitonly, Forecast categories: commit
Rollup: closedonly, Forecast categories: closed
Rollup: omittedonly, Forecast categories: omitted
535
Metadata Types
ForecastingSettings
WeightedSourceCategories
This field can occur more than once when specifying more than one forecast category to include in the rollup type. Each occurrence
contains two subfields that specify a forecast category to include in the forecast rollup type and its weight. Some rollup types include
more than one forecast category. This table shows the forecast categories that are included in each rollup type.
Field
Field Type
Description
sourceCategoryApiName
string
weight
double
536
Metadata Types
ForecastingSettings
<enableAdjustments>true</enableAdjustments>
</adjustmentsSettings>
<name>OpportunityLineItemQuantity</name>
<forecastRangeSettings>
<beginning>0</beginning>
<displaying>6</displaying>
<periodType>Month</periodType>
</forecastRangeSettings>
<opportunityListFieldsSelectedSettings>
<field>OPPORTUNITY.NAME</field>
</opportunityListFieldsSelectedSettings>
<quotasSettings>
<showQuotas>true</showQuotas>
</quotasSettings>
<displayedCategoryApiNames>pipelineonly</displayedCategoryApiNames>
<displayedCategoryApiNames>bestcaseonly</displayedCategoryApiNames>
<displayedCategoryApiNames>commitonly</displayedCategoryApiNames>
<displayedCategoryApiNames>closedonly</displayedCategoryApiNames>
<forecastedCategoryApiNames>commitonly</forecastedCategoryApiNames>
<forecastedCategoryApiNames>closedonly</forecastedCategoryApiNames>
<forecastedCategoryApiNames>bestcaseonly</forecastedCategoryApiNames>
<forecastedCategoryApiNames>pipelineonly</forecastedCategoryApiNames>
<managerAdjustableCategoryApiNames>commitonly</managerAdjustableCategoryApiNames>
<managerAdjustableCategoryApiNames>bestcaseonly</managerAdjustableCategoryApiNames>
<ownerAdjustableCategoryApiNames>commitonly</ownerAdjustableCategoryApiNames>
<ownerAdjustableCategoryApiNames>bestcaseonly</ownerAdjustableCategoryApiNames>
</forecastingTypeSettings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>commitonly</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>commit</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>closedonly</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>closed</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>bestcaseforecast</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>commit</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
<weightedSourceCategories>
<sourceCategoryApiName>best case</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
537
Metadata Types
ForecastingSettings
<weightedSourceCategories>
<sourceCategoryApiName>closed</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>omittedonly</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>omitted</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>openpipeline</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>commit</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
<weightedSourceCategories>
<sourceCategoryApiName>best case</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
<weightedSourceCategories>
<sourceCategoryApiName>pipeline</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>bestcaseonly</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>best case</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>commitforecast</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>closed</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
<weightedSourceCategories>
<sourceCategoryApiName>commit</sourceCategoryApiName>
<weight>1.0</weight>
</weightedSourceCategories>
</forecastingCategoryMappings>
<forecastingCategoryMappings>
<forecastingItemCategoryApiName>pipelineonly</forecastingItemCategoryApiName>
<weightedSourceCategories>
<sourceCategoryApiName>pipeline</sourceCategoryApiName>
<weight>1.0</weight>
538
Metadata Types
IdeasSettings
</weightedSourceCategories>
</forecastingCategoryMappings>
SEE ALSO:
Settings
IdeasSettings
Represents the metadata used to manage settings for Ideas.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
IdeasSettings is available in API version 27.0 and later.
Ideas
Represents settings for Ideas and Idea Themes.
Fields
Field Name
Field Type
Description
enableIdeaThemes
boolean
enableIdeas
boolean
enableIdeasReputation
boolean
enableChatterProfile
boolean
Indicates that the Chatter user profile is used for Ideas user profiles. If
enableChatterProfile is true, the ideasProfilePage
value must not be specified. If enableChatterProfile is false,
then specify a ideasProfilePage value, otherwise the Ideas zone
profile is used. This field is available in API version 29.0 and later.
ideasProfilePage
string
The name of the Visualforce page to use for a custom Ideas user profile,
if enableChatterProfile is false. If
enableChatterProfile is false, then specify a
ideasProfilePage value, otherwise the Ideas zone profile is used.
This field is available in API version 29.0 and later.
539
Metadata Types
KnowledgeSettings
Field Name
Field Type
Description
halfLife
double
Indicates how quickly old ideas drop in ranking on the Popular Ideas
subtab. The half-life setting determines how the number of days after
which old ideas drop in ranking on the Popular Ideas subtab, to make
room for ideas with more recent votes. A shorter half-life moves older
ideas down the page faster than a longer half-life.
SEE ALSO:
Settings
KnowledgeSettings
Represents the metadata used to manage settings for Salesforce Knowledge. This type extends the Metadata metadata type and inherits
its fullName field.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
KnowledgeSettings is available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
answers
KnowledgeAnswerSettings
540
Metadata Types
KnowledgeSettings
Field Name
Field Type
Description
cases
KnowledgeCaseSettings
defaultLanguage
string
languages
KnowledgeLanguageSettings
enableChatterQuestionKBDeflection boolean
enableCreateEditOnArticlesTab boolean
enableExternalMediaContent
boolean
enableKnowledge
boolean
showArticleSummariesCustomerPortal boolean
showArticleSummariesInternalApp boolean
showArticleSummariesPartnerPortal boolean
boolean
showValidationStatusField
KnowledgeAnswerSettings
Represents the metadata used to manage settings for Salesforce Knowledge and Answers.
Field Name
Field Type
Description
assignTo
string
defaultArticleType
string
The default article type for articles created from Answers. Uses the API
name of the article type.
enableArticleCreation
boolean
Indicates whether users can create articles from Answers (true) or not
(false).
541
Metadata Types
KnowledgeSettings
KnowledgeCaseSettings
Represents the metadata used to manage settings for Salesforce Knowledge and Cases.
Field Name
Field Type
Description
articlePDFCreationProfile
string
articlePublicSharingSites
KnowledgeSitesSettings
articlePublicSharingCommunities KnowledgeSitesSettings
articlePublicSharingSitesChatterAnswers KnowledgeSitesSettings
assignTo
string
customizationClass
string
defaultContributionArticleType
string
editor
KnowledgeCaseEditor
(enumeration of type string)
boolean
enableArticlePublicSharingSites boolean
boolean
enableArticleCreation
useProfileForPDFCreation
KnowledgeSitesSettings
Represents the metadata used to manage settings for Salesforce Knowledge and Sites.
Field Name
Field Type
Description
site
string[]
KnowledgeLanguageSettings
A list of languages enabled for Salesforce Knowledge. KnowledgeLanguageSettings is available in API version 28.0 and later.
542
Metadata Types
KnowledgeSettings
Field Name
Field Type
Description
language
KnowledgeLanguage
KnowledgeLanguage
Represents the metadata used to manage settings for the languages enabled for Salesforce Knowledge. KnowledgeLanguage is available
in API version 28.0 and later.
Field Name
Field Type
Description
active
boolean
defaultAssignee
string
defaultAssigneeType
KnowledgeLanguageLookupValueType
(enumeration of type string)
defaultReviewer
string
defaultReviewerType
KnowledgeLanguageLookupValueType
(enumeration of type string)
name
string
543
Metadata Types
LiveAgentSettings
<site>ChatterAnswersSite</site>
</articlePublicSharingSitesChatterAnswers>
<assignTo>[email protected]</assignTo>
<defaultContributionArticleType>Support</defaultContributionArticleType>
<editor>simple</editor>
<enableArticleCreation>true</enableArticleCreation>
<enableArticlePublicSharingSites>true</enableArticlePublicSharingSites>
<useProfileForPDFCreation>true</useProfileForPDFCreation>
</cases>
<defaultLanguage>ja</defaultLanguage>
<enableCreateEditOnArticlesTab>true</enableCreateEditOnArticlesTab>
<enableExternalMediaContent>true</enableExternalMediaContent>
<enableKnowledge>true</enableKnowledge>
<showArticleSummariesCustomerPortal>true</showArticleSummariesCustomerPortal>
<showArticleSummariesInternalApp>true</showArticleSummariesInternalApp>
<showArticleSummariesPartnerPortal>true</showArticleSummariesPartnerPortal>
<showValidationStatusField>true</showValidationStatusField>
</KnowledgeSettings>
SEE ALSO:
Settings
LiveAgentSettings
Represents an organizations Live Agent settings, such as whether or not Live Agent is enabled. This type extends the Metadata metadata
type and inherits its fullName field.
Version
LiveAgentSettings is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
enableLiveAgent
boolean
544
Metadata Types
MobileSettings
MobileSettings
Represents an organizations mobile settings, such as mobile Chatter settings, whether Mobile Lite is enabled for an organization, and
so on. For more information, see Manage Salesforce Classic Mobile Devices and Chatter Mobile for BlackBerry in the Salesforce online
help.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
Mobile settings are available in API version 27.0 and later.
Fields
Field
Field Type
Description
chatterMobile
ChatterMobileSettings
dashboardMobile
DashboardMobileSettings
salesforceMobile
SFDCMobileSettings
touchMobile (Deprecated)
TouchMobileSettings
ChatterMobileSettings
Represents your organizations Chatter Mobile settings.
Field
Field Type
Description
IPadAuthorized
boolean
545
Metadata Types
MobileSettings
Field
Field Type
Description
IPhoneAuthorized
boolean
androidAuthorized
boolean
blackBerryAuthorized
boolean
enableChatterMobile
boolean
enablePushNotifications
boolean
sessionTimeout
MobileSessionTimeout (enumeration of type The length of time after which users without
string)
activity are prompted to log out or continue
working. Valid values are:
Never
OneMinute
FiveMinutes
TenMinutes
ThirtyMinutes
DashboardMobileSettings
Represents your organizations Mobile Dashboards iPad app settings.
Field
Field Type
Description
enableDashboardIPadApp
boolean
546
Metadata Types
MobileSettings
SFDCMobileSettings
Represents your organizations general mobile settings.
Field
Field Type
Description
enableUserToDeviceLinking
boolean
enableMobileLite
boolean
TouchMobileSettings
These fields are deprecated. Salesforce Touch has been upgraded to the Salesforce1 app.
Field
Field Type
Description
enableTouchBrowserIPad
boolean
enableTouchAppIPad
boolean
547
Metadata Types
NameSettings
<enableTouchBrowserIPad>false</enableTouchBrowserIPad>
<enableTouchAppIPad>true</enableTouchAppIPad>
</touchMobile>
</MobileSettings>
SEE ALSO:
Settings
NameSettings
Enables or disables middle name and suffix attributes for the following person objects: Contact, Lead, Person Account, and User.
Version
NameSettings components are available in API version 31.0 and later.
Fields
Field Name
Field Type
Description
enableMiddleName
boolean
enableNameSuffix
boolean
The following is an example package.xml manifest that references the NameSettings definitions.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Name</members>
<name>Settings</name>
</types>
548
Metadata Types
OpportunitySettings
<version>31.0</version>
</Package>
OpportunitySettings
Represents organization preferences for features such as automatic opportunity updates and similar-opportunity filters. This type extends
the Metadata metadata type and inherits its fullName field.
Version
OpportunitySettings is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
enableUpdateReminders
boolean
autoActivateNewReminders boolean
enableFindSimilarOpportunities boolean
findSimilarOppFilter
multipicklist
enableOpportunityTeam
boolean
promptToAddProducts
boolean
FindSimilarOppFilter
Defines whether to match by entire columns or fields.
Field
Field Type
Description
similarOpportunitiesDisplayColumns string
similarOpportunitiesMatchFields string
549
Metadata Types
OrderSettings
<types>
<members>Opportunity</members>
<name>Settings</name>
</types>
<version>28.0</version>
</Package>
<similarOpportunitiesDisplayColumns>CustomField__c</similarOpportunitiesDisplayColumns>
</findSimilarOppFilter>
<enableOpportunityTeam>true</enableOpportunityTeam>
<enableUpdateReminders>true</enableUpdateReminders>
<promptToAddProducts>false</promptToAddProducts>
</OpportunitySettings>
OrderSettings
Represents order settings. This type extends the Metadata metadata type and inherits its fullName field. For more information, see
Customizing Order Settings in the Salesforce Help.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
OrderSettings components are available in API version 30.0 and later.
550
Metadata Types
PathAssistantSettings
Fields
Field Name
Field Type
Description
enableNegativeQuantity
boolean
Indicates whether users in the organization can add order products with
quantities of less than zero (true) or not (false).
To enable this preference, enableOrders must be set to true.
enableOrders
boolean
enableReductionOrders
boolean
PathAssistantSettings
Represents the Sales Path preference setting.This type extends the Metadata metadata type and inherits its fullName field.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
551
Metadata Types
ProductSettings
Version
PathAssistantSettings components are available in API version 34.0 and later.
Fields
Field Name
Field Type
pathAssistantForOpportunityEnabled boolean
Description
Determines whether the preference is enabled for Sales Path in
Opportunity or not.
ProductSettings
Represents organization preferences for quantity schedules, revenue schedules, and active flag interaction with prices. This type extends
the Metadata metadata type and inherits its fullName field.
Version
ProductSettings is available in API version 28.0 and later.
552
Metadata Types
QuoteSettings
Fields
Field Name
Field Type
enableCascadeActivateToRelatedPrices boolean
Description
When changing active flag on a product record, automatically updates
active flag on related prices.
enableQuantitySchedule
boolean
enableRevenueSchedule
boolean
QuoteSettings
Enables or disables Quotes, which show proposed prices for products and services. This type extends the Metadata metadata type and
inherits its fullName field.
Version
QuoteSettings is available in API version 28.0 and later.
553
Metadata Types
SecuritySettings
Fields
Field Name
Field Type
Description
enableQuote
boolean
SecuritySettings
Represents an organizations security settings. Security settings define trusted IP ranges for network access, password and login
requirements, and session expiration and security settings.
In the package manifest, all organization settings metadata types are accessed using the Settings name. See Settings for more details.
Version
Security settings are available in API version 27.0 and later.
Fields
Field Name
Field Type
Description
networkAccess
NetworkAccess
The trusted IP address ranges from which users can always log
in without requiring computer activation.
554
Metadata Types
SecuritySettings
Field Name
Field Type
Description
passwordPolicies
PasswordPolicies
sessionSettings
SessionSettings
NetworkAccess
Represents your organizations trusted IP address ranges for network access.
Field
Field Type
Description
ipRanges
IpRange[]
The trusted IP address ranges from which users can always log
in without requiring computer activation.
Note: In order to add an IP range, deploy all existing IP
ranges, as well as the one you want to add. Otherwise,
the existing IP ranges are replaced with the ones you
deploy. To remove all the IP ranges in an organization,
leave the networkAccess field blank
(<networkAccess></networkAccess>).
IpRange
Defines a range of trusted IP addresses for network access.
Field
Field Type
Description
description
string
end
string
start
string
PasswordPolicies
Represents your organizations password and login policies.
Field
Field Type
Description
apiOnlyUserHomePageURL string
The URL to which users with the API Only User permission are
redirected instead of the login page.
555
Metadata Types
SecuritySettings
Field
Field Type
Description
complexity
Complexity (enumeration of
type string)
expiration
Expiration (enumeration of type Required. The length of time until user passwords expire and
string)
must be changed. Valid values are:
Never
ThirtyDays
SixtyDays
NinetyDays. This value is the default value.
SixMonths
OneYear
minimumPasswordLifetime boolean
passwordAssistanceURL
string
passwordAssistanceMessage string
The text that appears in the Account Lockout email and at the
bottom of the Confirm Identity screen for users resetting their
passwords.
historyRestriction
string
lockoutInterval
LockoutInterval (enumeration
of type string)
556
Metadata Types
Field
SecuritySettings
Field Type
Description
SixtyMinutes
Forever (must be reset by admin)
maxLoginAttempts
MaxLoginAttempts
(enumeration of type string)
minimumPasswordLength
string
obscureSecretAnswer
boolean
questionRestriction
QuestionRestriction
(enumeration of type string)
SessionSettings
Represents your organizations session expiration and security settings.
557
Metadata Types
SecuritySettings
Field
Field Type
Description
disableTimeoutWarning
boolean
enableCSPOnEmail
boolean
enableCSRFOnGet
boolean
enableCSRFOnPost
boolean
enableCacheAndAutocomplete boolean
enableClickjackNonsetupSFDC boolean
enableClickjackNonsetupUser boolean
enableClickjackNonsetupUserHeaderless boolean
enableClickjackSetup
boolean
enablePostForSessions
boolean
enableSMSIdentity
boolean
enforceIpRangesEveryRequest boolean
forceLogoutOnSessionTimeout boolean
Indicates that when sessions time out for inactive users, current
sessions become invalid. The browser refreshes and returns to
558
Metadata Types
Field
SecuritySettings
Field Type
Description
the login page. To access the organization, the user must log
in again. Enabled (true) or not (false). Available in API
version 31.0 and later.
forceRelogin
boolean
lockSessionsToDomain
boolean
lockSessionsToIp
boolean
logoutURL
string
The URL to which users are redirected when they log out of
Salesforce. If no value is specified, the default is
https://login.salesforce.com unless MyDomain
is enabled. If My Domain is enabled, the default is
https://customdomain.my.salesforce.com.
Available in API version 34.0 and later.
sessionTimeout
SessionTimeout (enumeration
of type string)
559
Metadata Types
Territory2Settings
</networkAccess>
<passwordPolicies>
<apiOnlyUserHomePageURL>http://www.altPage.com</apiOnlyUserHomePageURL>
<complexity>SpecialCharacters</complexity>
<expiration>OneYear</expiration>
<passwordAssistanceURL>http://www.acme.com/forgotpassword</passwordAssistanceURL>
<passwordAssistanceMessage>Forgot your password? Reset it
here.</passwordAssistanceMessage>
<historyRestriction>3</historyRestriction>
<lockoutInterval>ThirtyMinutes</lockoutInterval>
<maxLoginAttempts>ThreeAttempts</maxLoginAttempts>
<minimumPasswordLength>10</minPasswordLength>
<questionRestriction>None</questionRestriction>
</passwordPolicies>
<sessionSettings>
<disableTimeoutWarning>true</disableTimeoutWarning>
<enableCSRFOnGet>false</enableCSRFOnGet>
<enableCSRFOnPost>false</enableCSRFOnPost>
<enableCacheAndAutocomplete>false</enableCacheAndAutocomplete>
<enableClickjackNonsetupSFDC>true</enableClickjackNonsetupSFDC>
<enableClickjackNonsetupUser>true</enableClickjackNonsetupUser>
<enableClickjackSetup>true</enableClickjackSetup>
<enableSMSIdentity>true</enableSMSIdentity>
<forceRelogin>true</forceRelogin>
<lockSessionsToIp>true</lockSessionsToIp>
<sessionTimeout>TwelveHours</sessionTimeout>
</sessionSettings>
</SecuritySettings>
SEE ALSO:
Settings
Territory2Settings
Represents the metadata for the default settings for Territory Management 2.0 users to access and modify records associated with sales
territories. The standard record access settings apply to accounts and opportunities. If your organization uses Private default internal
access for contacts or cases, you can also set access for those records. This type extends the Metadata metadata type and inherits its
fullName field. Available only if Territory Management 2.0 has been enabled for your organization.
Version
Territory2Settings components are available in API version 32.0 and later.
560
Metadata Types
Territory2Settings
Fields
Field Name
Field Type
defaultAccountAccessLevel string
defaultCaseAccessLevel
string
Description
The default level of access users will have to account records in territories:
view and edit accounts assigned to territories or view, edit,
transfer, and delete accounts assigned to territories.
The default level of access users will have to case records in territories:
view and edit accounts assigned to territories or view, edit,
transfer, and delete accounts assigned to territories.
defaultContactAccessLevel string
The default level of access users will have to contact records in territories:
view and edit accounts assigned to territories or view, edit,
transfer, and delete accounts assigned to territories.
defaultOpportunityAccessLevel string
Usage
Territory Management 2.0 components dont support packaging or change sets and arent supported in CRUD calls.
561
Metadata Types
SharedTo
SharedTo
SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing
rules. See Sharing Considerations and What Is a Group? in the Salesforce online help.
Version
SharedTo is available in API version 17.0 and later.
Fields
Field
Field Type
Description
allCustomerPortalUsers string
allInternalUsers
string
allPartnerUsers
string
group
string[]
A list of groups with sharing access. Use this field instead of the
groups field.
This field is available in API version 22.0 and later.
groups
string[]
managerSubordinates
string[]
managers
string[]
portalRole
string[]
portalRoleandSubordinates string[]
562
Metadata Types
SharedTo
Field
Field Type
Description
role
string[]
A list of roles with sharing access. Use this field instead of the
roles field.
This field is available in API version 22.0 and later.
roleAndSubordinates
string[]
A list of roles with sharing access. All roles below each of these
roles in the role hierarchy also have sharing access. If portal
accounts are enabled, then all roles and portal accounts below
each of these roles in the role hierarchy also have sharing access.
Use this field instead of the rolesAndSubordinates field
.
This field is available in API version 22.0 and later.
roleAndSubordinatesInternal string[]
A list of roles with sharing access. All roles below each of these
roles in the role hierarchy also have sharing access.
This field is available in API version 22.0 and later.
roles
string[]
rolesAndSubordinates
string[]
A list of roles with sharing access. All roles below each of these
roles in the role hierarchy also have sharing access. If portal
accounts are enabled, then all roles and portal accounts below
each of these roles in the role hierarchy also have sharing access.
Use the roleAndSubordinates field instead for API
version 22.0 and later.
territories
string[]
territoriesAndSubordinates string[]
territory
string[]
territoryAndSubordinates string[]
563
Metadata Types
SharingBaseRule
Field
Field Type
Description
queue
string[]
SharingBaseRule
Represents sharing rule settings such as access level and to whom access is granted. This type extends the Metadata metadata type and
inherits its fullName field.
Note: You cant create a SharingBaseRule component directly. Use the components under SharingRules instead.
Version
SharingBaseRule replaces BaseSharingRule and is available in API version 33.0 and later.
Fields
Field
Field Type
Description
accessLevel
string
accountSettings
AccountSharingRuleSettings[]
description
string
label
string
sharedTo
SharedTo
AccountSharingRuleSettings
Defines the access level for the case, contact, and opportunity associated with the account.
Field
Field Type
Description
caseAccessLevel
string
564
Metadata Types
Field
SharingRules
Field Type
Description
Edit
contactAccessLevel
string
opportunityAccessLevel string
SharingRules
Represents the base container for sharing rules, which can be criteria-based, ownership-based, or territory-based. SharingRules enables
you to share records with a set of users, using rules that specify the access level for the target user group.
This type extends the Metadata metadata type and inherits its fullName field. For more information, see Sharing Rules in the
Salesforce online help.
In API version 33.0 and later, retrieving, deleting, or deploying of all sharing rules in an organization is available . Wildcard support is also
available. You cant retrieve, delete, or deploy manual sharing rules or sharing rules by their type (owner, criteria-based, or territory).
Version
SharingRules components are available in API version 24.0 and later, but these components are no longer available in API version 33.0
and later: AccountSharingRules, CampaignSharingRules, CaseSharingRules, ContactSharingRules, LeadSharingRules,
OpportunitySharingRules, AccountTerritorySharingRules, CustomObjectSharingRules, UserSharingRules.
In API version 33.0 and later, use SharingCriteriaRule, SharingOwnerRule and SharingTerritoryRule.
565
Metadata Types
SharingRules
Fields
The following information assumes that you are familiar with implementing sharing rules for standard objects and custom objects. For
more information on these fields, see Sharing Settings in the Salesforce online help.
Field
Field Type
Description
sharingCriteriaRules SharingCriteriaRule[]
SharingOwnerRule[]
sharingOwnerRules
sharingTerritoryRules SharingTerritoryRule[]
SharingCriteriaRule
Defines a criteria-based sharing rule. It extends SharingBaseRule and inherits all its fields. Available in API version 33.0 and later.
Field
Field Type
Description
booleanFilter
string
criteriaItems
FilterItem[]
SharingOwnerRule
Defines a ownership-based sharing rule. It extends SharingBaseRule and inherits all its fields. Available in API version 33.0 and later.
Field
Field Type
Description
sharedFrom
SharedTo
SharingTerritoryRule
Defines a territory-based sharing rule. It extends SharingOwnerRule and inherits all its fields. Available in API version 33.0 and later.
AccountSharingRules
Represents the sharing rules for accounts. It extends the SharingRules metadata type and inherits its fullName field. Only available
in API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
AccountCriteriaBasedSharingRule[]
566
Metadata Types
SharingRules
Field
Field Type
Description
ownerRules
AccountOwnerSharingRule[]
CampaignSharingRules
Represents the sharing rules for campaigns. It extends the SharingRules metadata type and inherits its fullName field. Only available
in API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
CampaignCriteriaBasedSharingRule[]
ownerRules
CampaignOwnerSharingRule[]
CaseSharingRules
Represents the sharing rules for cases. It extends the SharingRules metadata type and inherits its fullName field. Only available in
API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
CaseCriteriaBasedSharingRule[]
ownerRules
CaseOwnerSharingRule[]
ContactSharingRules
Represents the sharing rules for contacts. It extends the SharingRules metadata type and inherits its fullName field. Only available
in API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
ContactCriteriaBasedSharingRule[]
ownerRules
ContactOwnerSharingRule[]
LeadSharingRules
Represents the sharing rules for leads. It extends the SharingRules metadata type and inherits its fullName field. Only available in
API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
LeadCriteriaBasedSharingRule[]
ownerRules
LeadOwnerSharingRule[]
567
Metadata Types
SharingRules
OpportunitySharingRules
Represents the sharing rules for opportunities. It extends the SharingRules metadata type and inherits its fullName field. Only available
in API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
OpportunityCriteriaBasedSharingRule[]
ownerRules
OpportunityOwnerSharingRule[]
AccountTerritorySharingRules
Represents the sharing rules for account territories. It extends the SharingRules metadata type and inherits its fullName field. Only
available in API version 32.0 and earlier.
Field
Field Type
Description
rules
AccountTerritorySharingRule[]
CustomObjectSharingRules
Represents the sharing rules for custom objects. It extends the SharingRules metadata type and inherits its fullName field. Only
available in API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
ownerRules
CustomObjectOwnerSharingRule[]
UserSharingRules
Represents the sharing rules for users. With user sharing rules, you can share members of a group with members of another group. It
extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.
Field
Field Type
Description
criteriaBasedRules
UserCriteriaBasedSharingRule[]
membershipRules
UserMembershipSharingRule[]
568
Metadata Types
SharingRules
The following sample XML definition represents an ownership-based sharing rule in API version 33.0.
<?xml version="1.0" encoding="UTF-8"?>
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
<sharingOwnerRules>
<fullName>MyCase</fullName>
<accessLevel>Edit</accessLevel>
<description>my case test owner sharing rule desc</description>
<label>MyCase</label>
<sharedFrom>
<role>COO</role>
</sharedFrom>
<sharedTo>
<role>CEO</role>
</sharedTo>
</sharingOwnerRules>
</SharingRules>
The following sample XML definition represents a territory-based sharing rule in API version 33.0.
<?xml version="1.0" encoding="UTF-8"?>
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
<sharingTerritoryRules>
<fullName>MyAccountTerritoryRule</fullName>
<accessLevel>Read</accessLevel>
<accountSettings>
<caseAccessLevel>None</caseAccessLevel>
569
Metadata Types
SharingRules
<contactAccessLevel>Read</contactAccessLevel>
<opportunityAccessLevel>None</opportunityAccessLevel>
</accountSettings>
<description>MyAccountTerritoryRule desc</description>
<label>MyAccountTerritoryRule</label>
<sharedFrom>
<territory>My_territory</territory>
</sharedFrom>
<sharedTo>
<role>CEO</role>
</sharedTo>
</sharingTerritoryRules>
</SharingRules>
The following is the definition of two account owner-based sharing rules in API version 32.0 and earlier. The file name corresponds to
Account.sharingRules under the accountSharingRules directory. In this definition, ownerRules corresponds to
AccountOwnerSharingRule.
<?xml version="1.0" encoding="UTF-8"?>
<AccountSharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
<ownerRules>
<fullName>G1Dev_G2New</fullName>
<sharedFrom>
<group>G1Dev</group>
</sharedFrom>
<sharedTo>
<group>G2New</group>
</sharedTo>
<accountAccessLevel>Read</caseAccessLevel>
<caseAccessLevel>None</caseAccessLevel>
<contactAccessLevel>Read</contactAccessLevel>
<name>G1Dev_G2New</name>
<opportunityAccessLevel>Edit</opportunityAccessLevel>
</ownerRules>
<ownerRules>
<fullName>G2New_R1New</fullName>
<sharedFrom>
<group>G2New</group>
</sharedFrom>
<sharedTo>
<roleAndSubordinates>R1New</roleAndSubordinates>
</sharedTo>
<accountAccessLevel>Edit</accountAccessLevel>
<caseAccessLevel>Read</caseAccessLevel>
<contactAccessLevel>Edit</contactAccessLevel>
<name>G2New_R1New</name>
<opportunityAccessLevel>None</opportunityAccessLevel>
</ownerRules>
</AccountSharingRules>
The following is the definition of a user criteria-based sharing rule and a user membership-based sharing rule in API version 32.0 and
earlier. The file name corresponds to User.sharingRules under the userSharingRules directory.
<?xml version="1.0" encoding="UTF-8"?>
<UserSharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
570
Metadata Types
BaseSharingRule
<criteriaBasedRules>
<fullName>shareUsers2</fullName>
<sharedTo>
<group>Asia_Division</group>
</sharedTo>
<criteriaItems>
<field>FirstName</field>
<operation>equals</operation>
<value>John</value>
</criteriaItems>
<name>shareUsers2</name>
<userAccessLevel>Read</userAccessLevel>
</criteriaBasedRules>
<membershipRules>
<fullName>shareUsers1</fullName>
<sharedTo>
<group>South_America_Division</group>
</sharedTo>
<sharedFrom>
<group>Asia_Division</group>
</sharedFrom>
<name>shareUsers1</name>
<userAccessLevel>Read</userAccessLevel>
</membershipRules>
</UserSharingRules>
BaseSharingRule
This component is removed as of API version 33.0 and is available in earlier versions only. Use SharingBaseRule instead.
Represents the base container for criteria-based and owner-based sharing rules. This type extends the Metadata metadata type and
inherits its fullName field.
Note: You cant create a BaseSharingRule component directly. Use the components under the CriteriaBasedSharingRule or
OwnerSharingRule metadata types instead.
Version
BaseSharingRule components are available in API version 24.0 and later.
571
Metadata Types
CriteriaBasedSharingRule
Fields
For more information on these fields, see Sharing Settings in the Salesforce online help.
Field
Field Type
Description
sharedTo
SharedTo
fullName
string
CriteriaBasedSharingRule
This component is removed as of API version 33.0 and is available in earlier versions only. Use SharingRules instead.
Represents a criteria-based sharing rule. CriteriaBasedSharingRule enables you to share records based on specific criteria. It extends the
BaseSharingRule metadata type and inherits its sharedTo field. For more information, see Criteria-Based Sharing Rules Overview
in the Salesforce online help.
Note: You cant create a CrteriaBasedSharingRule component directly. Use the child components instead.
Version
CriteriaBasedSharingRule components are available in API version 24.0 and later.
Fields
The following information assumes that you are familiar with implementing sharing rules for standard objects and custom objects. For
more information on these fields, see Sharing Settings in the Salesforce online help.
Field
Field Type
Description
criteriaItems
FilterItem[]
572
Metadata Types
CriteriaBasedSharingRule
AccountCriteriaBasedSharingRule
Represents a criteria-based sharing rule for accounts. It extends the CriteriaBasedSharingRule metadata type and inherits its
criteriaItems field.
AccountCriteriaBasedSharingRule is used by the criteriaBasedRules field in AccountSharingRules.
Field
Field Type
Description
accountAccessLevel
ShareAccessLevelNoNone Required. A value that represents the level of access that the
booleanFilter
string
caseAccessLevel
ShareAccessLevelNoAll Required. A value that represents the level of access that the
contactAccessLevel
ShareAccessLevelNoAll Required. A value that represents the level of access that the
description
string
name
string
opportunityAccessLevel ShareAccessLevelNoAll Required. A value that represents the level of access that a target
573
Metadata Types
CriteriaBasedSharingRule
CampaignCriteriaBasedSharingRule
Represents a criteria-based sharing rule for campaigns. It extends the CriteriaBasedSharingRule metadata type and inherits its
criteriaItems field.
CampaignCriteriaBasedSharingRule is used by the criteriaBasedRules field in CampaignSharingRules.
Field
Field Type
Description
booleanFilter
string
description
string
campaignAccessLevel
ShareAccessLevelNoNone Required. A value that represents the level of access that a target
name
string
CaseCriteriaBasedSharingRule
Represents a criteria-based sharing rule for cases. It extends the CriteriaBasedSharingRule metadata type and inherits its
criteriaItems field.
CaseCriteriaBasedSharingRule is used by the criteriaBasedRules field in CaseSharingRules.
Field
Field Type
Description
booleanFilter
string
description
string
caseAccessLevel
name
string
574
Metadata Types
CriteriaBasedSharingRule
ContactCriteriaBasedSharingRule
Represents a criteria-based sharing rule for contacts. It extends the CriteriaBasedSharingRule metadata type and inherits its
criteriaItems field.
ContactCriteriaBasedSharingRule is used by the criteriaBasedRules field in ContactSharingRules.
Field
Field Type
Description
booleanFilter
string
description
string
contactAccessLevel
name
string
LeadCriteriaBasedSharingRule
Represents a criteria-based sharing rule for leads. It extends the CriteriaBasedSharingRule metadata type and inherits its criteriaItems
field.
LeadCriteriaBasedSharingRule is used by the criteriaBasedRules field in LeadSharingRules.
Field
Field Type
Description
booleanFilter
string
description
string
leadAccessLevel
name
string
575
Metadata Types
CriteriaBasedSharingRule
OpportunityCriteriaBasedSharingRule
Represents a criteria-based sharing rule for opportunities. It extends the CriteriaBasedSharingRule metadata type and inherits its
criteriaItems field.
OpportunityCriteriaBasedSharingRule is used by the criteriaBasedRules field in OpportunitySharingRules.
Field
Field Type
Description
booleanFilter
string
description
string
opportunityAccessLevel ShareAccessLevelReadEdit Required. A value that represents the level of allowed access.
name
string
CustomObjectCriteriaBasedSharingRule
Represents a criteria-based sharing rule for custom objects. It extends the CriteriaBasedSharingRule metadata type and inherits its
criteriaItems field.
CustomObjectCriteriaBasedSharingRule is used by the criteriaBasedRules field in CustomObjectSharingRules.
Field
Field Type
Description
accessLevel
string
booleanFilter
string
description
string
name
string
576
Metadata Types
CriteriaBasedSharingRule
UserCriteriaBasedSharingRule
Represents a criteria-based sharing rule for users. It extends the CriteriaBasedSharingRule metadata type and inherits its criteriaItems
field.
UserCriteriaBasedSharingRule is used by the criteriaBasedRules field in UserSharingRules.
Field
Field Type
Description
booleanFilter
string
description
string
name
string
userAccessLevel
577
Metadata Types
OwnerSharingRule
<name>G2New_R1New</name>
<opportunityAccessLevel>None</opportunityAccessLevel>
</ownerRules>
<criteriaBasedRules>
<fullName>AccountCriteria</fullName>
<sharedTo>
<group>G1</group>
</sharedTo>
<criteriaItems>
<field>BillingCity</field>
<operation>equals</operation>
<value>San Francisco</value>
</criteriaItems>
<criteriaItems>
<field>MyChkBox__c</field>
<operation>notEqual</operation>
<value>False</value>
</criteriaItems>
<accountAccessLevel>Read</accountAccessLevel>
<booleanFilter>1 OR 2</booleanFilter>
<caseAccessLevel>None</caseAccessLevel>
<contactAccessLevel>Read</contactAccessLevel>
<name>AccountCriteria</name>
<opportunityAccessLevel>None</opportunityAccessLevel>
</criteriaBasedRules>
</AccountSharingRules>
OwnerSharingRule
This component is removed as of API version 33.0 and is available in earlier versions only.
Represents an ownership-based sharing rule. OwnerSharingRule enables you to share records owned by a set of users with another set,
using rules that specify the access level of the target user group. It extends the BaseSharingRule metadata type and inherits its SharedTo
field. For more information, see Sharing Rules in the Salesforce online help.
Note: You cant create a OwnerSharingRule component directly. Use the child components instead.
Version
OwnerSharingRules components are available in API version 24.0 and later.
Fields
The following information assumes that you are familiar with implementing sharing rules for standard objects and custom objects. For
more information on these fields, see Sharing Settings in the Salesforce online help.
578
Metadata Types
OwnerSharingRule
Field
Field Type
Description
sharedFrom
SharedTo
sharedTo
SharedTo
fullName
string
AccountOwnerSharingRule
Represents a sharing rule for an account with users other than the owner. It extends the OwnerSharingRule metadata type and inherits
its fullName, sharedFrom, and sharedTo fields.
AccountOwnerSharingRule is used by the ownerRules field in AccountSharingRules.
Field
Field Type
Description
accountAccessLevel
ShareAccessLevelNoNone Required. A value that represents the level of access that a group
caseAccessLevel
ShareAccessLevelNoAll Required. A value that represents the level of access that a group
contactAccessLevel
ShareAccessLevelNoAll Required. A value that represents the level of access that a group
description
string
579
Metadata Types
OwnerSharingRule
Field
Field Type
Description
name
string
opportunityAccessLevel ShareAccessLevelNoAll Required. A value that represents the level of access that a group
CampaignOwnerSharingRule
Represents a sharing rule for a campaign with users other than the owner. It extends the OwnerSharingRule metadata type and inherits
its fullName, sharedFrom, and sharedTo fields.
CampaignOwnerSharingRule is used by the ownerRules field in CampaignSharingRules.
Field
Field Type
Description
campaignAccessLevel
ShareAccessLevelNoNone A value that represents the level of access that a group or role
description
string
name
string
CaseOwnerSharingRule
Represents a sharing rule for a case with users other than the owner. It extends the OwnerSharingRule metadata type and inherits its
fullName, sharedFrom, and sharedTo fields.
CaseOwnerSharingRule is used by the ownerRules field in CaseSharingRules. All the following fields are required.
Field
Field Type
Description
caseAccessLevel
ShareAccessLevelReadEdit Required. A value that represents the level of access that a group
580
Metadata Types
OwnerSharingRule
Field
Field Type
Description
description
string
name
string
ContactOwnerSharingRule
Represents a sharing rule for a contact with users other than the owner. It extends the OwnerSharingRule metadata type and inherits
its fullName, sharedFrom, and sharedTo fields.
ContactOwnerSharingRule is used by the ownerRules field in ContactSharingRules.
Field
Field Type
Description
contactAccessLevel
ShareAccessLevelReadEdit Required. A value that represents the level of access that a group
description
string
name
string
LeadOwnerSharingRule
Represents a sharing rule for a lead with users other than the owner. It extends the OwnerSharingRule metadata type and inherits its
fullName, sharedFrom, and sharedTo fields.
LeadOwnerSharingRule is used by the ownerRules field in LeadSharingRules.
Field
Field Type
Description
leadAccessLevel
ShareAccessLevelReadEdit Required. A value that represents the level of access that a group
description
string
581
Metadata Types
OwnerSharingRule
Field
Field Type
Description
name
string
OpportunityOwnerSharingRule
Represents a sharing rule for an opportunity with users other than the owner. It extends the OwnerSharingRule metadata type and
inherits its fullName, sharedFrom, and sharedTo fields.
OpportunityOwnerSharingRule is used by the ownerRules field in OpportunitySharingRules.
Field
Field Type
Description
name
string
description
string
opportunityAccessLevel ShareAccessLevelReadEdit Required. A value that represents the level of access that a group
AccountTerritorySharingRule
Represents a rule for sharing an account within a territory. It extends the OwnerSharingRule metadata type and inherits its fullName,
sharedFrom, and sharedTo fields.
AccountTerritorySharingRule is used by the ownerRules field in AccountTerritorySharingRules.
Field
Field Type
Description
accountAccessLevel
caseAccessLevel
582
Metadata Types
Field
OwnerSharingRule
Field Type
Description
Edit
contactAccessLevel
description
string
name
string
opportunityAccessLevel ShareAccessLevelNoAll Required. A value that represents the level of access that a
CustomObjectOwnerSharingRule
Represents a sharing rule for custom objects. It extends the OwnerSharingRule metadata type and inherits its fullName, sharedFrom,
and sharedTo fields.
CustomObjectOwnerSharingRule is used by the ownerRules field in CustomObjectSharingRules.
Field
Field Type
Description
accessLevel
string
description
string
name
string
583
Metadata Types
SharingSet
UserMembershipSharingRule
Represents a sharing rule to share members of a group with another group of users. It extends the OwnerSharingRule metadata type
and inherits its fullName, sharedFrom, and sharedTo fields.
UserMembershipSharingRule is used by the ownerRules field in UserSharingRules on page 568.
Field
Field Type
Description
description
string
name
string
userAccessLevel
ShareAccessLevelReadEdit Required. A value that represents the level of access that a group
SharingSet
Represents a sharing set. A sharing set defines an access mapping that grants portal or community users access to objects that are
associated with their accounts or contacts. This type extends the Metadata metadata type and inherits its fullName field.
For example, you can grant portal or community users access to all cases related to their account record. Similarly, you can grant portal
or community users access to all cases related to a parent account that is identified on the users account record. For more information,
see Sharing Set Overview in the Salesforce Help.
Version
SharingSet components are available in API version 30.0 and later.
Fields
Field Name
Field Type
Description
accessMappings
AccessMapping[]
description
string
name
string
584
Metadata Types
SharingSet
Field Name
Field Type
Description
profiles
string[]
The profiles of users that are granted access to the target objects. Valid
values are:
Authenticated Website
Customer Community User
Customer Community Login User
High Volume Customer Portal User
Overage Authenticated Website User
Overage High Volume Customer Portal User
AccessMapping
AccessMapping represents an access mapping in the sharing set, which grants access to a target object by looking up to an account or
contact associated with the user.
You can grant portal users access to a target object, or to both a target object and its associated objects, such as an account and its
contacts and cases.
Field Name
Field Type
Description
accessLevel
string
The target object access level granted to the portal user. Valid values are:
Read
Edit
objectField
string
object
string
The target object to which the portal user is gaining access, and refers to one
of the following:
Account
Contact
Case
ServiceContract
User
Custom Objects (e.g. ObjA__c)
Portal users gain access to all order entitlements and order items under an
account to which they have access.
userField
string
585
Metadata Types
Field Name
SharingSet
Field Type
Description
Contact
Contact.Field
Manager.Account
Manager.Contact
Field refers to a standard or custom field based on an account or contact.
The following is an example of a SharingSet component that grants users access to all cases that are related to an entitlement, which is
associated with the users account.
<?xml version="1.0" encoding="UTF-8"?>
<SharingSet xmlns="http://soap.sforce.com/2006/04/metadata">
<name>Case</name>
<accessMappings>
<accessLevel>Edit</accessLevel>
<objectField>Entitlement.Account</objectField>
<object>Case</object>
<userField>Account</userField>
</accessMappings>
</SharingSet>
586
Metadata Types
SiteDotCom
</accessMappings>
<accessMappings>
<accessLevel>Edit</accessLevel>
<objectField>Account</objectField>
<object>Contact</object>
<userField>Account</userField>
</accessMappings>
<accessMappings>
<accessLevel>Edit</accessLevel>
<objectField>Contact</objectField>
<object>Case</object>
<userField>Contact</userField>
</accessMappings>
<accessMappings>
<accessLevel>Read</accessLevel>
<objectField>AccountLookup__c</objectField>
<object>HVPUAccessible__c</object>
<userField>Account</userField>
</accessMappings>
</SharingSet>
SiteDotCom
Represents a site for deployment. It extends the MetadataWithContent type and inherits its fullName and content fields.
587
Metadata Types
Skill
Note: There is a file size limitation when using the Metadata API to deploy a site from sandbox to production. The assets in the
.site file cant be larger than 40 MB. The site gets created, but the assets show in the new site as broken. To fix the assets, export
the assets from the sandbox environment separately and then import them into your new site.
Version
SiteDotCom components are available in API version 30.0 and later.
Fields
Field
Field Type
Description
label
string
siteType
(enumeration of type
string)
Skill
Represents the settings for a skill used to route chats to agents in Live Agent, such as the name of the skill and which agents the skills
are assigned to. This type extends the Metadata metadata type and inherits its fullName field.
588
Metadata Types
Skill
Version
Skill is available in API version 28.0 and later.
Fields
Field Name
Field Type
Description
assignments
SkillAssignments
label
string
SkillAssignments
Represents which users and user profiles to whom specific skills are assigned.
Fields
Field Name
Field Type
Description
profiles
SkillProfileAssignments
users
SkillUserAssignments
SkillProfileAssignments
Represents the profiles that are associated with a specific skill.
Fields
Field Name
Field Type
Description
profile
string
SkillUserAssignments
Represents the users that are associated with a specific skill.
589
Metadata Types
StaticResource
Fields
Field Name
Field Type
Description
user
string
StaticResource
Represents a static resource file, often a code library in a ZIP file. This metadata type extends the MetadataWithContent component and
shares its fields.
Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files),
images, style sheets, JavaScript, and other files.
Version
Static resources are available in API version 12.0 and later.
Fields
This metadata type contains the following fields:
590
Metadata Types
Field Name
SynonymDictionary
Field Type
cacheControl StaticResourceCacheControl
Description
Required. Indicates whether the static resource is marked with a public caching
tag so that a third-party delivery client can cache the content. This is a new field
in API version 14.0. The valid values are:
Private
Public
content
base64Binary
The static resource content. Base 64-encoded binary data. Prior to making an
API call, client applications must encode the binary attachment data as base64.
Upon receiving a response, client applications must decode the base64 data to
binary. This conversion is usually handled for you by a SOAP client. This field is
inherited from the MetadataWithContent component.
contentType
string
description
string
fullName
string
The static resource name. The name can only contain characters, letters, and the
underscore (_) character, must start with a letter, and cannot end with an
underscore or contain two consecutive underscore characters.
Inherited from the Metadata component, this field is not defined in the WSDL
for this component. It must be specified when creating, updating, or deleting.
See create() to see an example of this field specified for a call.
SynonymDictionary
Represents a set of synonym groups, which are groups of words or phrases that are treated as equivalent in users searches. You can
define synonym groups to optimize search results for acronyms, variations of product names, and other terminology unique to your
organization. Synonyms are available in Service Cloud features such as Salesforce Knowledge. This type extends the Metadata metadata
type and inherits its fullName field.
Version
SynonymDictionary components are available in API version 29.0 and later.
591
Metadata Types
SynonymDictionary
Fields
Field Name
Field Type
Description
groups
SynonymGroup
isProtected
boolean
label
string
SynonymGroup
Represents a group of synonymous words or phrases.
Field Name
Field Type
Description
languages
Language
Required. Specifies the languages the synonym group applies to. If synonyms
are specific to a single language, specify only that language. If the synonyms
apply to multiple languages, specify multiple languages for one synonym
group.
terms
string
592
Metadata Types
Territory
<terms>clio</terms>
</groups>
<label>Sample Dictionary</label>
</SynonymDictionary>
Usage
If you have existing synonym groups defined before API version 29.0, your existing groups are associated with a default dictionary called
_Default.
If you have a set of synonyms that require frequent updates, we recommend assigning the synonym group or groups to a dedicated
dictionary with a small number of groups. Each time you deploy an existing dictionary, all of its synonym groups are overwritten. We
dont support deploying updates to only a single synonym group within a dictionary.
Territory
Represents a territory in your organization.
Version
Territory components are available in API version 24.0 and later.
Fields
This metadata type extends to subtype RoleOrTerritory.
Field Name
Field Type
Description
accountAccessLevel
string
Specifies whether users in this territory can access accounts that are
assigned to this territory and are otherwise inaccessible. Valid values are:
Read
Edit
All
593
Metadata Types
Field Name
Territory2
Field Type
Description
If your organizations sharing model for accounts is Public Read/Write,
valid values are only Edit and All.
If no value is set for this field, this field value uses the default access level
that is specified in the Manage Territory page in Setup.
This field is available in API version 31.0 and later.
fullName
string
The unique identifier for API access. The fullName can contain only
underscores and alphanumeric characters. It must be unique, begin with
a letter, not include spaces, not end with an underscore, and not contain
two consecutive underscores. This field is inherited from the Metadata
component. Corresponds to Territory Name in the user interface.
parentTerritory
string
Territory2
Represents the metadata associated with a sales territory in Territory Management 2.0. This type extends the Metadata metadata type
and inherits its fullName field.Available only if Territory Management 2.0 has been enabled for your organization.
Version
Territory2 components are available in API version 32.0 and later.
594
Metadata Types
Territory2
Fields
Field Name
Field Type
Description
accountAccessLevel
string
Specifies whether users in this territory can access accounts that are
assigned to this territory and are otherwise inaccessible. Valid values
are:
Read
Edit
All
If your organizations sharing model for accounts is Public Read/Write,
valid values are only Edit and All. If no value is set for this field,
this field value uses the default access level that is specified in
Territory2Settings as permitted by the organizations sharing settings.
caseAccessLevel
string
Specifies whether users in this territory can access cases that are
assigned to this territory and are otherwise inaccessible. Valid values
are:
None
Read
Edit
No value should be specified if your organizations sharing model for
cases/opportunities is Public Read/Write,If no value is set for this field,
this field value uses the default access level that is specified in
Territory2Settings as permitted by the organizations sharing settings.
contactAccessLevel
string
Specifies whether users in this territory can access contacts that are
assigned to this territory and are otherwise inaccessible. Valid values
are:
None
Read
Edit
No value should be specified if your organizations sharing model for
contacts is Public Read/Write or Controlled By Parent,
595
Metadata Types
Territory2
Field Name
Field Type
Description
customFields
FieldValue
Values for custom fields defined on the Territory2 object and used by
this territory. Their metadata is captured separately in CustomObject
on page 209. Note the following:
Territory2 and Territory2Model objects do not handle values for
Text Area (Long), Text Area (Rich), and text-encrypted custom fields.
Fields are referenced using their API names. Compound field types
like Geolocation will appear as their constituent column fields. For
example, nnn_Latitude__s, nnn_Longitude__s where
nnn is the field name and the suffixes are the Geolocation
components.
Values of required custom fields are enforced during the
deploy() operation.
description
string
name
string
opportunityAccessLevel
string
parentTerritory
string
The name of the territorys parent. When you specify the parent territory,
use the developer name. Do not use the fully qualified name. Custom
fields with no values are retrieved with values of type: <value
xsi:nil="true"/>. You can also use <value
xsi:nil="true"/> syntax to remove existing values in custom
fields.
ruleAssociations
territory2Type
string
FieldValue
Represents the values of custom fields on the Territory2 object. Available in API version 32.0 and later.
Field Name
Field Type
Description
name
string
596
Metadata Types
Territory2
Field Name
Field Type
Description
value
any type
The value of the field, which can also be null. The field type is specified in
the XML and depends on the field value.
Territory2RuleAssociation
Represents the association of an object assignment rule to a territory. Available in API version 32.0 and later.
Field Name
Field Type
Description
inherited
boolean
Required. Indicates whether the rule is inherited from a parent territory (true)
or local to the current territory (false).
Rule inheritance flows from the parent territory where the rule is created to
the rules descendent territories (if any) in the territory model hierarchy. A local
rule is created within a single territory and affects that territory only.
ruleName
string
Required. The name of a rule associated with the territory. ruleName doesnt
need to be fully qualified because Metadata API assumes that the rule belongs
to the same model as the territory.
597
Metadata Types
Territory2Model
<name>AutoNumber__c</name>
<value xsi:type="xsd:string">T# 000001</value>
</customFields>
<customFields>
<name>DeactivationDate__c</name>
<value xsi:type="xsd:date">2016-07-12</value>
</customFields>
<customFields>
<name>External_Id__c</name>
<value xsi:type="xsd:string">AB2345</value>
</customFields>
<customFields>
<name>ManagersPhone__c</name>
<value xsi:nil="true"/>
</customFields>
</Territory2>
The following is a package.xml sample. FY13 and FY14 represent the names of territory models and demonstrate that rules
can have identical developer names within different models. A wildcard character (*) in place of the model name can be used to retrieve
all rules in all models in an organization.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>FY13</members>
<members>FY14</members>
<name>Territory2Model</name>
</types>
<types>
<members>FY13.USA</members>
<members>FY13.Worldwide_Sales</members>
<members>FY14.APAC</members>
<members>FY14.USA</members>
<name>Territory2</name>
</types>
<version>36.0</version>
</Package>
Usage
Triggers defined on Territory2 will not fire during a deploy() operation.
Territory Management 2.0 components dont support packaging or change sets and arent supported in CRUD calls.
Territory2Model
Represents the metadata associated with a territory model in Territory Management 2.0. This type extends the Metadata metadata type
and inherits its fullName field.Available only if Territory Management 2.0 has been enabled for your organization.
598
Metadata Types
Territory2Model
Version
Territory2Model components are available in API version 32.0 and later.
Fields
Field Name
Field Type
Description
customFields
FieldValue
description
string
name
string
599
Metadata Types
Territory2Rule
<customFields>
<name>Activation_DateTime__c</name>
<value xsi:type="xsd:dateTime">2014-07-16T05:05:00.000Z</value>
</customFields>
<customFields>
<name>AutoNumber__c</name>
<value xsi:type="xsd:string">M# 000001</value>
</customFields>
<customFields>
<name>DeactivationDate__c</name>
<value xsi:type="xsd:date">2016-07-12</value>
</customFields>
<customFields>
<name>External_Id__c</name>
<value xsi:nil="true"/>
</customFields>
</Territory2Model>
Usage
The retrieve() call will not return models in these four states: Cloning, Cloning Failed, Deleting, and Deletion
Failed.
Whenever a model is created, its initial state is Planning. You can only do a deploy() operation for models in Planning
or Active state. The same requirement applies to territories and rules associated with those models. For example, you might have
a model in Planning state on a sandbox org, and a model with the same developer name in Archived state on your production
org. The deploy() operation on production will fail because that models state is Archived and that state prevents changes
to the model.
Because of the state restrictions, if you have territory models in different organizations with identical developer names and you
attempt a deploy() operation, Metadata API will attempt to create new models, but that operation will fail because of the
developer name conflict. For example, you might have a model in Planning state on a sandbox org, and a model with the same
developer name in Archived state on your production org. The deploy() operation on production will fail because that
models state is Archived and that state prevents changes to the model.
If you try to delete a model that has territories, then the delete() call will change the models state to Deleting and cascade
delete all territories, rules, and user associations in the model. Deleting may take some time depending on the number of territries
in the model.
Whenever a model is created, its initial state is Planning. If a model with the same developer name already exists, it will already
have a state, so we do not include the State field in Territory2.
Territory Management 2.0 components dont support packaging or change sets and arent supported in CRUD calls.
Territory2Rule
Represents the metadata associated with a territory assignment rule associated with an object, such as Account, in Territory Management
2.0. This type extends the Metadata metadata type and inherits its fullName field.Available only if Territory Management 2.0 has
been enabled for your organization.
600
Metadata Types
Territory2Rule
Version
Territory2Rule components are available in API version 32.0 and later.
Special Access
The Territory2Model object has a State field in the SOAP API. States include Planning, Active, Archived, and a number of
other states, such as Cloning, that indicate that a process is underway. Users who do not have the Manage Territories permission
can access only rules that belong to the model in Active state. The Manage Territories permission is required for deploy() calls
for all territory management entities, in addition to the Modify All Data permission required by Metadata API. Using retrieve()
without the Manage Territories permission will return only entities that belong to a Territory2Model in Active state. We recommend
against retrieving without the Manage Territories permission because the call will retrieve only partial data.The SOAP API and the user
interface require that a user attempting to create or edit a rules has field-level security access to the fields referenced in the rule item.
This restriction is relaxed for Metadata API deploy() operations, as those require Modify All Data and Manage Territories permissions.
Modify All Data is the base permission requirement for all Metadata API operations.
Fields
Field Name
Field Type
Description
active
boolean
booleanFilter
string
name
string
objectType
string
Required. The object that the rule is defined for. For API version 32.0, the
only available object is Account.
ruleItems
Territory2RuleItem
on page 601
The items that define a rules the selection criteria, such as Billing
State equals California.
Territory2RuleItem
Represents the association of a rule item to a rule. Available in API version 32.0 and later.
Field Name
Field Type
Description
field
string
The standard or custom object field that the rule item operates on.
601
Metadata Types
Territory2Rule
Field Name
Field Type
Description
operation
FilterOperation
The criterion to apply for the rule item. For example: equals or starts
(enumeration of type with.
string)
value
string
The field value or values to evaluate. For example: if the field is Billing
ZIP/Postal Code, a value might be 94105.
The following is a package.xml sample. FY13 and FY14 represent names of territory models and demonstrate that rules can
have identical developer names within different models. A wildcard character (*) in place of the model name can be used to retrieve all
rules in all models in an organization.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>FY13</members>
<members>FY14</members>
<name>Territory2Model</name>
</types>
<types>
<members>FY13.AccRule1</members>
602
Metadata Types
Territory2Type
<members>FY14.AccRule1</members>
<name>Territory2Rule</name>
</types>
<version>36.0</version>
</Package>
Usage
A territory rule can have up to 10 rule items.
The sort order of rule items is implicitly derived from the position of the rule items in the XML
Rules cant be run via Metadata API.
Territory Management 2.0 components dont support packaging or change sets and arent supported in CRUD calls.
Territory2Type
Represents the metadata for a category of territories in Territory Management 2.0. Every Territory2 must have a Territory2Type. This type
extends the Metadata metadata type and inherits its fullName field.Available only if Enterprise Territory Management has been
enabled for your organization.
Version
Territory2Type components are available in API version 32.0 and later.
Fields
Field Name
Field Type
Description
description
string
name
string
priority
int
603
Metadata Types
Field Name
TransactionSecurityPolicy
Field Type
Description
priority field value on each territory type must be unique.
Further, if there are multiple territories with the same territory type
(and therefore the same priority) assigned to the account, no territory
is not assigned to the opportunity.
Usage
Territory Management 2.0 components dont support packaging or change sets and arent supported in CRUD calls.
TransactionSecurityPolicy
Represents a transaction security policy definition. This type extends the Metadata metadata type and inherits its fullName field.
Version
TransactionSecurityPolicy components are available in API version 35.0 and later.
Fields
Field Name
Field Type
Description
action
TransactionSecurityAction
active
boolean
apexClass
string
604
Metadata Types
TransactionSecurityPolicy
Field Name
Field Type
Description
eventType
MonitoredEvents (enumeration Indicates which type of event is being monitored. Valid values are:
of type string)
AccessResourceNotifies you when the selected
resource has been accessed.
AuditTrailReserved for future use.
DataExportNotifies you when the selected object type
has been exported using the Data Loader API client.
EntityNotifies you on use of an object type such as an
authentication provider or client browser.
LoginNotifies you when a user logs in.
executionUser
string
resourceName
string
TransactionSecurityAction
Describes the action to take when the matching Transaction Security policy is triggered.
Field Name
Field Type
Description
block
boolean
endSession
boolean
notifications
TransactionSecurityNotification[] Specifies how to notify the ystem administrator when the action
is triggered. There can be none, one, or multiple notifications.
twoFactorAuthentication boolean
605
Metadata Types
Translations
TransactionSecurityNotification
Describes who to notify and how to notify them when the matching Transaction Security policy is triggered.
Field Name
Field Type
Description
inApp
boolean
sendEmail
boolean
user
string
The following is an example package manifest used to deploy or retrieve the transaction security metadata for an organization.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MySecurityPolicy</members>
<name>TransactionSecurityPolicy</name>
</types>
<version>35.0</version>
</Package>
Translations
This metadata type allows you to work with translations for various supported languages. This type extends the Metadata metadata
type and inherits its fullName field. The ability to translate component labels is part of the Translation Workbench. For more information,
see Enable and Disable the Translation Workbench in the Salesforce online help.
606
Metadata Types
Translations
Language
Salesforce offers three levels of language support: fully supported languages, end-user languages, and platform-only languages. Each
language is identified by a two-character language code, such as en, or a five-character locale code, such as en_AU.
Note: Setting a default locale is different from setting a default language.
Salesforce offers full support for the following languages.
Chinese (Simplified): zh_CN
Chinese (Traditional): zh_TW
Danish: da
Dutch: nl_NL
English: en_US
Finnish: fi
French: fr
German: de
Italian: it
Japanese: ja
Korean: ko
Norwegian: no
Portuguese (Brazil): pt_BR
Russian: ru
Spanish: es
Spanish (Mexico): es_MX
Swedish: sv
Thai: th
End-user languages are useful if you have a multilingual organization or partners who speak languages other than your companys
default language. For end-user languages, Salesforce provides translated labels for all standard objects and pages, except administrative
pages, Setup, and Help. When you specify an end-user language, labels and Help that arent translated appear in English. End-user
languages are intended only for personal use by end users. Dont use end-user languages as corporate languages. Salesforce doesnt
provide customer support in end-user languages.
End-user languages include:
Arabic: ar
Bulgarian: bg
Croatian: hr
Czech: cs
English (UK): en_GB
Greek: el
Hebrew: iw
Hungarian: hu
Indonesian: in
Polish: pl
607
Metadata Types
Translations
608
Metadata Types
Translations
609
Metadata Types
Translations
Maltese: mt
Romanian (Moldova): ro_MD
Montenegrin: sh_ME
Romansh: rm
Serbian (Cyrillic): sr
Serbian (Latin): sh
Spanish (Argentina): es_AR
Spanish (Bolivia): es_BO
Spanish (Chile): es_CL
Spanish (Colombia): es_CO
Spanish (Costa Rica): es_CR
Spanish (Dominican Republic): es_DO
Spanish (Ecuador): es_EC
Spanish (El Salvador): es_SV
Spanish (Guatemala): es_GT
Spanish (Honduras): es_HN
Spanish (Nicaragua): es_NI
Spanish (Panama): es_PA
Spanish (Paraguay): es_PY
Spanish (Peru): es_PE
Spanish (Puerto Rico): es_PR
Spanish (United States): es_US
Spanish (Uruguay): es_UY
Spanish (Venezuela): es_VE
Tagalog: tl
Tamil: ta
Urdu: ur
Welsh: cy
Version
Translations components are available in API version 14.0 and later.
610
Metadata Types
Translations
Fields
Field
Field Type
Description
customApplications
CustomApplicationTranslation[]
customLabels
CustomLabelTranslation[]
customPageWebLinks
CustomPageWebLinkTranslation[]
customTabs
CustomTabTranslation[]
fullName
string
quickActions
GlobalQuickActionTranslation[]
reportTypes
ReportTypeTranslation[]
scontrols
ScontrolTranslation[]
CustomApplicationTranslation
CustomApplicationTranslation contains details for a custom application translation. For more details, see CustomApplication.
Field
Field Type
Description
label
string
name
string
CustomLabelTranslation
CustomLabelTranslation contains details for a custom label translation. For more details, see CustomLabels.
Field
Field Type
Description
label
string
name
string
611
Metadata Types
Translations
CustomPageWebLinkTranslation
CustomPageWebLinkTranslation contains details for a translation of a web link defined in a home page component. For more details,
see CustomPageWebLink.
Field
Field Type
Description
label
string
name
string
CustomTabTranslation
CustomTabTranslation contains details for a translation of a custom tab. For more details, see CustomTab.
Field
Field Type
Description
label
string
name
string
GlobalQuickActionTranslation
GlobalQuickActionTranslation contains details for the translation of a quick action, globally. For more information, see QuickAction.
Field
Field Type
Description
label
string
name
string
ReportTypeTranslation
ReportTypeTranslation contains details for a translation of a custom report type. For more details, see ReportType.
Field
Field Type
Description
description
string
label
string
name
string
sections
ReportTypeSectionTranslation[]
ReportTypeSectionTranslation
ReportTypeSectionTranslation contains details for a report type section translation.
612
Metadata Types
Translations
Field
Field Type
Description
columns
ReportTypeColumnTranslation[]
label
string
name
string
ReportTypeColumnTranslation
ReportTypeColumnTranslation contains details for a report type column translation.
Field
Field Type
Description
label
string
name
string
ScontrolTranslation
Important: Visualforce pages supersede s-controls. Organizations that havent previously used s-controls cant create them.
Existing s-controls are unaffected, and can still be edited.
ScontrolTranslation contains details for a translation of an s-control. For more information, see About S-Controls in the Salesforce online
help.
Field
Field Type
Description
label
string
name
string
613
Metadata Types
WaveApplication (Pilot)
Usage
When you use the retrieve() call to get translations in your organization, the files returned in the .translations folder only
include translations for the other metadata types referenced in package.xml. For example, the following package.xml file
contains types elements that match all custom applications, custom labels, Web links defined in home page components, custom
tabs, report types, and s-controls. Translations for all these metadata types are returned because each metadata type is explicitly listed
in package.xml.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>CustomApplication</name>
</types>
<types>
<members>*</members>
<name>CustomLabels</name>
</types>
<types>
<members>*</members>
<name>CustomPageWebLink</name>
</types>
<types>
<members>*</members>
<name>CustomTab</name>
</types>
<types>
<members>*</members>
<name>ReportType</name>
</types>
<types>
<members>*</members>
<name>Scontrol</name>
</types>
<types>
<members>*</members>
<name>Translations</name>
</types>
<version>36.0</version>
</Package>
SEE ALSO:
CustomLabels
WaveApplication (Pilot)
This metadata represents the Wave Analytics Application.
Represents the Wave Application.
This type extends the Metadata metadata type and inherits its fullName field.
614
Metadata Types
WaveDataset (Pilot)
Version
WaveApplication components are available in API version 36.0 and later.
Fields
Field Name
Field Type
Description
assetIcon
string
description
string
folder
string
masterLabel
string
shares
FolderShare
WaveDataset (Pilot)
This metadata reperesents the WaveDataset object in the Wave Analytics Application.
Represents the WaveDataset object in the Wave Analytics Application.
This type extends the Metadata metadata type and inherits its fullName field.
615
Metadata Types
WaveTemplateBundle
Version
WaveDataset components are available in API version 36.0 and later.
Fields
Field Name
Field Type
Description
application
string
description
string
masterLabel
string
WaveTemplateBundle
Represents a Wave Analytics template bundle, which can be used to create Wave apps. A bundle contains a Wave template definition
and all its related resources.This type extends the Metadata metadata type and inherits its fullName field.
Note: We provide this feature to selected customers through a pilot program that requires agreement to specific terms and
conditions. To be nominated to participate in the program, contact Salesforce. Because pilot programs are subject to change, we
cant guarantee acceptance. This pilot feature isnt generally available, as referenced in this document or in press releases or public
statements. We cant guarantee that it will become generally available within any particular time frame or at all. Make your purchase
decisions only on the basis of generally available features. Services provided by the Wave REST API are subject to change. Support
is not provided.
616
Metadata Types
WaveTemplateBundle
represents a resource in a template, such as lenses, dashboards, dataflows, and comma-separated values. For example, this directory
structure shows the hierarchy of the folders and files for one Wave Template definition, template1.
waveTemplates
template1
template-info.json
variables.json
ui.json
extFiles
PostalCodes.csv
Wave template bundles must be under a top-level folder thats named waveTemplates. Each bundle must have its own subfolder
under the waveTemplates folder and be named with the template's fully qualified API name. The bundle folder must contain a
template-info.json file to specify the metadata about the template and the references to other definition files. An entire bundle doesnt
have a suffix and definition files can have one of the following suffixes.
Suffix
Component Type
.json
.csv
Comma-Separated Values
Version
WaveTemplateBundle components are available in API version 35.0 and later.
Fields
Field Name
Field Type
Description
assetIcon
string
The icon to use by default for new Wave apps based on this template.
Valid values are 1.png through 20.png.
description
string
label
string
templateType
string
617
Metadata Types
Workflow
Workflow
Represents the metadata associated with a workflow rule. A workflow rule sets workflow actions into motion when its designated
conditions are met. You can configure workflow actions to execute immediately when a record meets the conditions in your workflow
rule, or set time triggers that execute the workflow actions on a specific day. For more information, see Workflow in the Salesforce
Help. This type extends the Metadata metadata type and inherits its fullName field. Use this metadata type to create, update, or
delete workflow rule definitions.
When using a manifest file, retrieve all workflow components using the following code:
<types>
<members>*</members>
<name>Workflow</name>
</types>
Version
Workflow rules are available in API version 13.0 and later.
Workflow
This metadata type represents the valid types of workflow rules and actions associated with a standard or custom object.
Field Name
Field Type
Description
alerts
WorkflowAlert[]
An array of all alerts for the object associated with the workflow.
fieldUpdates
WorkflowFieldUpdate[]
An array of all field updates for the object associated with the
workflow.
flowActions
WorkflowFlowAction[]
fullName
string
618
Metadata Types
Workflow
Field Name
Field Type
Description
knowledgePublishes
WorkflowKnowledgePublish[]
outboundMessages
WorkflowOutboundMessage[]
rules
WorkflowRule[]
tasks
WorkflowTask[]
An array of all the tasks for the object associated with the
workflow.
WorkflowActionReference
WorkflowActionReference represents one of the workflow actions.
Field Name
Field Type
Description
name
string
type
WorkflowActionType
Required. Available types of workflow actions:
(enumeration of type string) Alert
FieldUpdate
FlowActionAvailable in API version 30.0 and later
OutboundMessage
Task
The Process Builder has superseded flow trigger workflow actions,
formerly available in a pilot program. Organizations that are using
flow trigger workflow actions can continue to create and edit them,
but flow trigger workflow actions arent available for new
organizations.
WorkflowAlert
WorkflowAlert represents an email alert associated with a workflow rule.
Field Name
Field Type
Description
ccEmails
string[]
description
string
619
Metadata Types
Workflow
Field Name
Field Type
Description
fullName
string
protected
boolean
recipients
WorkflowEmailRecipient[]
senderAddress
string
The address in the From field for the email alert. This allows
you to use a standard global email address for your
organization (such as [email protected]) instead
of the default From field, which is the email address of the
person who updates the record. You can only specify a value
in this field if the senderType is set to
OrgWideEmailAddress. See Organization-Wide
Addresses in the Salesforce Help.
senderType
ActionEmailSenderType
(enumeration of type string)
template
string
WorkflowEmailRecipient
WorkflowEmailRecipient represents a recipient for an email alert associated with a workflow rule.
620
Metadata Types
Workflow
Field Name
Field Type
Description
field
string
recipient
string
type
ActionEmailRecipientTypes
(enumeration of type string)
621
Metadata Types
Field Name
Workflow
Field Type
Description
roleSubordinates - The email is sent to all users in
a role subordinates. For this value, the recipient field must
reference a Role.
roleSubordinatesInternal - Like
roleSubordinates, but for internal portal roles only.
user - The email is sent to a specific user. For this value,
the recipient field must reference a User (by username).
userLookup - The email is sent to a user whose value
is looked up from a field on the record. For this value, the
field field must reference a user foreign key field.
WorkflowFieldUpdate
WorkflowFieldUpdate represents a workflow field update. Field updates allow you to automatically update a field value to one that you
specify when a workflow rule is triggered.
Field Name
Field Type
Description
description
string
field
string
Required. The field (on the object for the workflow) to be updated.
formula
string
fullName
string
literalValue
string
lookupValue
string
lookupValueType
LookupValueType
(enumeration of type string)
name
string
622
Metadata Types
Workflow
Field Name
Field Type
Description
notifyAssignee
boolean
operation
FieldUpdateOperation
(enumeration of type string)
protected
boolean
reevaluateOnChange
boolean
When set to true, if the field update changes the fields value, all
workflow rules on the associated object are re-evaluated. Any
workflow rules whose criteria are met as a result of the field value
change will be triggered.
If any of the triggered workflow rules result in another field update
thats also enabled for workflow rule re-evaluation, a domino effect
occurs, and more workflow rules can be re-evaluated as a result
of the newly-triggered field update. This cascade of workflow rule
re-evaluation and triggering can happen up to five times after the
initial field update that started it.
targetObject
string
623
Metadata Types
Workflow
WorkflowFlowAction
Represents a flow trigger, which is a workflow action that launches a flow. Available in API version 30.0 and later. For more information,
see the following topics in the Salesforce Help.
Define a Flow Trigger for Workflow (Pilot)
Flow Trigger Considerations (Pilot)
Note:
The Process Builder has superseded flow trigger workflow actions, formerly available in a pilot program. Organizations that
are using flow trigger workflow actions can continue to create and edit them, but flow trigger workflow actions arent available
for new organizations.
Test mode for flow triggers isnt supported in the Metadata API. If you want a flow trigger to run the latest flow version when
an administrator causes the workflow rule to fire, enable test mode via the user interface after deployment.
Field Name
Field Type
Description
description
string
flow
string
flowInputs
WorkflowFlowActionParameter[]
label
string
language
string
protected
boolean
WorkflowFlowActionParameter
Represents a value specified in the flow trigger that is passed into a flow variable or sObject variable when launching the flow.
Note: The Process Builder has superseded flow trigger workflow actions, formerly available in a pilot program. Organizations that
are using flow trigger workflow actions can continue to create and edit them, but flow trigger workflow actions arent available
for new organizations.
Field Name
name
string
value
string
Required. Value to assign to the flow variable or sObject variable when launching the flow.
Unlike an sObject variable, which represents an entire Salesforce record in the flow, a flow variable
represents a single field. Therefore, the allowed value depends on whether the name identifies a
flow variable or an sObject variable.
For an sObject variable, the value must be a merge field that identifies a recordor a lookup
relationship field that references a recordof the same object type as the sObject variable. For example:
624
Metadata Types
Field Name
Workflow
WorkflowKnowledgePublish
WorkflowKnowledgePublish represents Salesforce Knowledge article publishing actions and information. Available in API version 27.0
and later.
Field Name
Field Type
Description
action
KnowledgeWorkflowAction
(enumeration of type string)
description
string
label
string
language
string
protected
boolean
625
Metadata Types
Workflow
WorkflowOutboundMessage
WorkflowOutboundMessage represents an outbound message associated with a workflow rule. Outbound messages are workflow and
approval actions that send the information you specify to an endpoint you designate, such as an external service. An outbound message
sends the data in the specified fields in the form of a SOAP message to the endpoint. For more information, see Outbound Message
Actions in the Salesforce Help.
Field Name
Field Type
Description
apiVersion
double
description
string
endpointUrl
string
fields
string[]
fullName
string
Required. The developer name used as a unique identifier for API access.
The fullName can contain only underscores and alphanumeric
characters. It must be unique, begin with a letter, not include spaces, not
end with an underscore, and not contain two consecutive underscores.
This field is inherited from the Metadata component.
includeSessionId
boolean
integrationUser
string
Required. The named reference to the user under which this message is
sent.
name
string
Required. A name for the component. Available in version API 16.0 and
later.
protected
boolean
626
Metadata Types
Workflow
Field Name
Field Type
Description
useDeadLetterQueue
boolean
This field is only available for organizations with dead letter queue
permissions turned on. If set, this outbound message will use the dead
letter queue if normal delivery fails.
WorkflowRule
This metadata type represents a workflow rule. This type extends the Metadata metadata type and inherits its fullName field.
Field Name
Field Type
Description
actions
WorkflowActionReference[]
active
boolean
booleanFilter
string
criteriaItems
FilterItem[]
description
string
formula
string
fullName
string
triggerType
627
Metadata Types
Field Name
Workflow
Field Type
Description
workflowTimeTriggers WorkflowTimeTrigger
WorkflowTask
This metadata type references an assigned workflow task.
Field Name
Field Type
Description
assignedTo
string
assignedToType
ActionTaskAssignedToTypes
(enumeration of type string)
description
string
dueDateOffset
int
fullName
string
628
Metadata Types
Field Name
Workflow
Field Type
Description
unique, begin with a letter, not include spaces, not end
with an underscore, and not contain two consecutive
underscores. This field is inherited from the Metadata
component.
notifyAssignee
boolean
offsetFromField
string
priority
string
protected
boolean
status
string
subject
string
WorkflowTimeTrigger
Represents a set of Workflow actions (Field Updates, Email Alerts, Outbound Messages, and Tasks) that should execute before or after a
specified interval of time.
Field Name
Field Type
Description
actions
WorkflowActionReference[] An array of references for the actions that should happen when this
trigger fires.
offsetFromField
string
The date type field name that the time-based workflow triggers off
of, i.e. Created Date, Last Modified Date, Rule
Trigger Date or a custom date field on the object for which
the workflow rule is defined.
timeLength
string
workflowTimeTriggerUnit WorkflowTimeUnits
The unit of time before or after which the time-based workflow will
(enumeration of type string) trigger. Valid string values are:
Hours
Days
629
Metadata Types
Workflow
630
Metadata Types
Workflow
<lookupValue>[email protected]</lookupValue>
<name>Lookup On Contact</name>
<notifyAssignee>false</notifyAssignee>
<operation>LookupValue</operation>
<protected>false</protected>
</fieldUpdates>
<outboundMessages>
<fullName>Another_Outbound_message</fullName>
<description>Another Random outbound.</description>
<endpointUrl>http://www.test.com</endpointUrl>
<fields>Email__c</fields>
<fields>Id</fields>
<fields>Name</fields>
<includeSessionId>true</includeSessionId>
<integrationUser>[email protected]</integrationUser>
<name>Another Outbound message</name>
<protected>false</protected>
</outboundMessages>
<rules>
<fullName>BooleanFilter</fullName>
<active>false</active>
<booleanFilter>1 AND 2 OR 3</booleanFilter>
<criteriaItems>
<field>CustomObjectForWorkflow__c.CreatedById</field>
<operation>notEqual</operation>
</criteriaItems>
<criteriaItems>
<field>CustomObjectForWorkflow__c.CreatedById</field>
<operation>notEqual</operation>
<value>abc</value>
</criteriaItems>
<criteriaItems>
<field>CustomObjectForWorkflow__c.CreatedById</field>
<operation>equals</operation>
<value>xyz</value>
</criteriaItems>
<triggerType>onCreateOrTriggeringUpdate</triggerType>
</rules>
<rules>
<fullName>Custom Rule1</fullName>
<actions>
<name>Another_alert</name>
<type>Alert</type>
</actions>
<actions>
<name>Enum_Field_Update2</name>
<type>FieldUpdate</type>
</actions>
<actions>
<fullName>Field_Update</name>
<type>FieldUpdate</type>
</actions>
<actions>
<name>Another_Outbound_message</name>
631
Metadata Types
Workflow
<type>OutboundMessage</type>
</actions>
<actions>
<name>Role_task_was_completed</name>
<type>Task</type>
</actions>
<active>true</active>
<criteriaItems>
<field>CustomObjectForWorkflow__c.Name</field>
<operation>startsWith</operation>
<value>ABC</value>
</criteriaItems>
<description>Custom Rule1 desc</description>
<triggerType>onCreateOrTriggeringUpdate</triggerType>
</rules>
<rules>
<fullName>IsChangedFunctionRule</fullName>
<active>true</active>
<description>IsChangedDesc</description>
<formula>ISCHANGED(Name)</formula>
<triggerType>onAllChanges</triggerType>
</rules>
<tasks>
<fullName>Another_task_was_completed</fullName>
<assignedToType>owner</assignedToType>
<description>Random Comment</description>
<dueDateOffset>20</dueDateOffset>
<notifyAssignee>true</notifyAssignee>
<priority>High</priority>
<protected>false</protected>
<status>Completed</status>
<subject>Another task was completed</subject>
</tasks>
<tasks>
<fullName>Role_task_was_completed</fullName>
<assignedTo>R11</assignedTo>
<assignedToType>role</assignedToType>
<dueDateOffset>-2</dueDateOffset>
<notifyAssignee>true</notifyAssignee>
<offsetFromField>CustomObjectForWorkflow__c.CreatedDate</offsetFromField>
<priority>High</priority>
<protected>false</protected>
<status>Completed</status>
<subject>Role task was completed</subject>
</tasks>
<tasks>
<fullName>User_task_was_completed</fullName>
<assignedTo>[email protected]</assignedTo>
<assignedToType>user</assignedToType>
<dueDateOffset>-2</dueDateOffset>
<notifyAssignee>true</notifyAssignee>
<offsetFromField>User.CreatedDate</offsetFromField>
<priority>High</priority>
<protected>false</protected>
632
Metadata Types
Workflow
<status>Completed</status>
<subject>User task was completed</subject>
</tasks>
</Workflow>
633
CHAPTER 11 Headers
Use headers in Metadata API calls to set options for each call.
IN THIS SECTION:
AllOrNoneHeader
Indicates whether to roll back all metadata changes when some of the records in a call result in failures.
CallOptions
Specifies the API client identifier.
DebuggingHeader
Specifies that the deployment result will contain the debug log output, and specifies the level of detail included in the log. The
debug log contains the output of Apex tests that are executed as part of a deployment.
SessionHeader
Specifies the session ID that the login call returns. This session ID is used to authenticate all subsequent Metadata API calls.
AllOrNoneHeader
Indicates whether to roll back all metadata changes when some of the records in a call result in failures.
Version
This header is available in API version 34.0 and later.
Supported Calls
createMetadata(), updateMetadata(), upsertMetadata(), deleteMetadata()
Usage
If this header isnt used in API version 34.0 and later, by default a call can save a partial set of records (equivalent to
AllOrNoneHeader=false)the records that are processed successfully are saved and records that have failures arent saved.
634
Headers
AllOrNoneHeader
Fields
Field Name
Type
Description
allOrNone
boolean
Sample CodeJava
Add the AllOrNoneHeader to the metadata connection before you perform a call as follows:
metadataConnection.setAllOrNoneHeader(true);
This next example shows how to use the AllOrNoneHeader when creating two custom objects. Because the second custom object
doesnt have the required Name field, the create() call cant create this custom object and rolls back the first custom object. The
output is shown after this code sample.
import com.sforce.soap.metadata.*;
import com.sforce.soap.metadata.Error;
import com.sforce.ws.ConnectionException;
public class CallWithHeader {
MetadataConnection metadataConnection = null;
public static void main(String[] args) throws ConnectionException {
CallWithHeader samples = new CallWithHeader();
samples.createWithHeader();
}
public CallWithHeader() throws ConnectionException {
metadataConnection = MetadataLoginUtil.login();
}
public void createWithHeader() throws ConnectionException {
// Define two custom objects to be inserted.
CustomObject co1 = new CustomObject();
String name1 = "MyCustomObject1";
co1.setFullName(name1 + "__c");
co1.setDeploymentStatus(DeploymentStatus.Deployed);
co1.setDescription("Created by the Metadata API");
co1.setEnableActivities(true);
co1.setLabel(name1 + " Object");
co1.setPluralLabel(co1.getLabel() + "s");
co1.setSharingModel(SharingModel.ReadWrite);
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setLabel(co1.getFullName() + " Name");
co1.setNameField(nf);
635
Headers
CallOptions
This is the output that the sample returns. The first record is rolled back and the second has a failure.
Errors were encountered while creating MyCustomObject1__c
Error message: Record rolled back because not all records were valid and the request was
using AllOrNone header
Status code: ALL_OR_NONE_OPERATION_ROLLED_BACK
Errors were encountered while creating MyCustomObject2__c
Error message: Must specify a nameField of type Text or AutoNumber
Status code: FIELD_INTEGRITY_EXCEPTION
CallOptions
Specifies the API client identifier.
636
Headers
DebuggingHeader
Version
This call is available in all API versions.
Supported Calls
All Metadata API calls.
Fields
Field Name
Type
Description
client
string
Sample CodeJava
To change the API client ID, add the CallOptions header to the metadata connection before you perform a call as follows:
metadataConnection.setCallOptions("client ID");
DebuggingHeader
Specifies that the deployment result will contain the debug log output, and specifies the level of detail included in the log. The debug
log contains the output of Apex tests that are executed as part of a deployment.
Version
This header is available in all API versions.
Supported Calls
deploy()
Fields
Field Name
Type
Description
categories
LogInfo[]
debugLevel
This field has been deprecated and is only provided for backward
compatibility. This field specifies the type of information returned
in the debug log. The values are listed from the least amount of
information returned to the most information returned. Valid values
include:
None
637
Headers
Field Name
DebuggingHeader
Type
Description
Debugonly
Db
Profiling
Callout
Detail
LogInfo
Field Name
Type
Description
category
level
LogCategoryLevel (enumeration of type A log level that specifies how much information is logged for each
string)
category.
Valid log levels are (listed from lowest to highest):
NONE
ERROR
WARN
INFO
DEBUG
FINE
FINER
FINEST
638
Headers
SessionHeader
Sample CodeJava
Add the DebuggingHeader to the metadata connection before you perform the deploy() call as follows:
LogInfo[] logs = new LogInfo[1];
logs[0] = new LogInfo();
logs[0].setCategory(LogCategory.Apex_code);
logs[0].setLevel(LogCategoryLevel.Fine);
metadataConnection.setDebuggingHeader(logs, LogType.Detail);
The result of the deploy() call is obtained by calling checkDeployStatus(). After the deployment finishes, and if tests were run, the response
of checkDeployStatus() contains the debug log output in an output header, DebuggingInfo, in the debugLog field of
this header.
SessionHeader
Specifies the session ID that the login call returns. This session ID is used to authenticate all subsequent Metadata API calls.
Version
This header is available in all API versions.
Supported Calls
All Metadata API calls.
Fields
Field Name
Type
Description
sessionId
string
Sample CodeJava
Add the SessionHeader to the metadata connection before you perform a call as follows:
metadataConnection.setSessionHeader("<session_ID>");
639
APPENDICES
Chinese (Simplified)
plural
false
caseType
Nominative
possessive
None
startwith
Consonant
plural
false
Chinese (Traditional)
caseType
Nominative
possessive
None
startwith
Consonant
plural
false
640
Danish
caseType
Nominative
article
Zero
Definite
Indefinite
possessive
None
gender
Feminine
Neuter
startwith
Consonant
plural
true
Dutch
CaseType
Nominative
article
Definite
Indefinite
gender
Feminine
Neuter
possessive
None
plural
true
Finnish
caseType
Ablative
Adessive
Allative
Dative
641
French
article
Zero
Definite
Indefinite
gender
Masculine
Feminine
possessive
None
plural
true
startwith
Consonant
Vowel
German
article
Zero
Definite
642
Italian
article
Zero
Indefinite
Definite
CaseType
Nominative
gender
Masculine
Feminine
possessive
None
plural
true
startwith
Consonant
Vowel
Special
Japanese
CaseType
Nominative
643
Korean
CaseType
Nominative
possessive
None
startwith
Consonant
plural
false
Portuguese (Brazilian)
article
Zero
Definite
Indefinite
article
Zero
Indefinite
Definite
plural
true
Russian
caseType
Accusative
Dative
Genitive
Instrumental
Nominative
Prepositional
644
Spanish
article
Zero
Definite
Indefinite
CaseType
Nominative
gender
Masculine
Feminine
startwith
Consonant
plural
true
Thai
CaseType
Nominative
possessive
None
startwith
Consonant
plural
false
645
Arabic
article
Zero
Definite
CaseType
Nominative
Accusative
gender
Masculine
Feminine
plural
true
possessive
None
First
Second
startwith
Consonant
Bulgarian
article
Zero
Definite
646
Czech
CaseType
Accusative
Dative
Genitive
Instrumental
Locative
Vocative
Nominative
gender
Masculine
Feminine
Neuter
Animate_Masculine
plural
true
Greek
article
Zero
Definite
Indefinite
647
Hebrew
article
Zero
Definite
CaseType
Nominative
gender
Masculine
Feminine
possessive
None
plural
true
Hungarian
article
Zero
Definite
Indefinite
CaseType
Ablative
Accusative
Allative
Causalfinal
648
Indonesian
plural
true
CaseType
Nominative
Possessive
None
startwith
Consonant
Norwegian
article
Zero
Definite
Indefinite
649
Polish
CaseType
Nominative
Accusative
Dative
Genitive
Instrumental
Locative
Vocative
gender
Masculine
Feminine
Neuter
Animate_Masculine
plural
true
Romanian
article
Zero
Definite
Indefinite
CaseType
Nominative
Dative
650
Spanish (Mexico)
article
Zero
Definite
Indefinite
CaseType
Nominative
gender
Masculine
Feminine
possessive
None
plural
true
Turkish
article
Zero
Indefinite
CaseType
Ablative
Accusative
Dative
Genitive
Nominative
possessive
None
First
Second
651
Ukrainian
CaseType
Accusative
Dative
Genitive
Instrumental
Nominative
Locative
Vocative
gender
Masculine
Feminine
Neuter
Animate_Masculine
plural
true
Vietnamese
CaseType
Nominative
possessive
None
startwith
Consonant
plural
false
652
GLOSSARY
A |B |C |D |E |F |G |H |I |J |K |L |M |N |O |P |Q |R |S |T |U |V |W |X |Y |Z
A
Apex
Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control
statements on the Force.com platform server in conjunction with calls to the Force.com API. Using syntax that looks like Java and
acts like database stored procedures, Apex enables developers to add business logic to most system events, including button clicks,
related record updates, and Visualforce pages. Apex code can be initiated by Web service requests and from triggers on objects.
Apex-Managed Sharing
Enables developers to programmatically manipulate sharing to support their applications behavior. Apex-managed sharing is only
available for custom objects.
App
Short for application. A collection of components such as tabs, reports, dashboards, and Visualforce pages that address a specific
business need. Salesforce provides standard apps such as Sales and Call Center. You can customize the standard apps to match the
way you work. In addition, you can package an app and upload it to the AppExchange along with related components such as
custom fields, custom tabs, and custom objects. Then, you can make the app available to other Salesforce users from the AppExchange.
AppExchange
The AppExchange is a sharing interface from Salesforce that allows you to browse and share apps and services for the Force.com
platform.
AppExchange Upgrades
Upgrading an app is the process of installing a newer version.
Application Programming Interface (API)
The interface that a computer system, library, or application provides to allow other computer programs to request services from it
and exchange data.
Asynchronous Calls
A call that does not return results immediately because the operation may take a long time. Calls in the Metadata API and Bulk API
are asynchronous.
B
Boolean Operators
You can use Boolean operators in report filters to specify the logical relationship between two values. For example, the AND operator
between two values yields search results that include both values. Likewise, the OR operator between two values yields search results
that include either value.
Bulk API
The REST-based Bulk API is optimized for processing large sets of data. It allows you to query, insert, update, upsert, or delete a large
number of records asynchronously by submitting a number of batches which are processed in the background by Salesforce. See
also SOAP API.
653
Glossary
C
Class, Apex
A template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables,
exception types, and static initialization code. In most cases, Apex classes are modeled on their counterparts in Java.
Client App
An app that runs outside the Salesforce user interface and uses only the Force.com API or Bulk API. It typically runs on a desktop or
mobile device. These apps treat the platform as a data source, using the development model of whatever tool and platform for
which they are designed.
Component, Metadata
A component is an instance of a metadata type in the Metadata API. For example, CustomObject is a metadata type for custom
objects, and the MyCustomObject__c component is an instance of a custom object. A component is described in an XML file
and it can be deployed or retrieved using the Metadata API, or tools built on top of it, such as the Force.com IDE or the Force.com
Migration Tool.
Component, Visualforce
Something that can be added to a Visualforce page with a set of tags, for example, <apex:detail>. Visualforce includes a
number of standard components, or you can create your own custom components.
Component Reference, Visualforce
A description of the standard and custom Visualforce components that are available in your organization. You can access the
component library from the development footer of any Visualforce page or the Visualforce Developer's Guide.
Controller, Visualforce
An Apex class that provides a Visualforce page with the data and business logic it needs to run. Visualforce pages can use the standard
controllers that come by default with every standard or custom object, or they can use custom controllers.
Controlling Field
Any standard or custom picklist or checkbox field whose values control the available values in one or more corresponding dependent
fields.
Custom App
See App.
Custom Field
A field that can be added in addition to the standard fields to customize Salesforce for your organizations needs.
Custom Help
Custom text administrators create to provide users with on-screen information specific to a standard field, custom field, or custom
object.
Custom Links
Custom links are URLs defined by administrators to integrate your Salesforce data with external websites and back-office systems.
Formerly known as Web links.
Custom Object
Custom records that allow you to store information unique to your organization.
Custom S-Control
Note: S-controls have been superseded by Visualforce pages. After March 2010 organizations that have never created
s-controls, as well as new organizations, won't be allowed to create them. Existing s-controls will remain unaffected, and can
still be edited.
Custom Web content for use in custom links. Custom s-controls can contain any type of content that you can display in a browser,
for example a Java applet, an Active-X control, an Excel file, or a custom HTML Web form.
654
Glossary
D
Database
An organized collection of information. The underlying architecture of the Force.com platform includes a database where your data
is stored.
Database Table
A list of information, presented with rows and columns, about the person, thing, or concept you want to track. See also Object.
Data Manipulation Language (DML)
An Apex method or operation that inserts, updates, or deletes records.
Decimal Places
Parameter for number, currency, and percent custom fields that indicates the total number of digits you can enter to the right of a
decimal point, for example, 4.98 for an entry of 2. Note that the system rounds the decimal numbers you enter, if necessary. For
example, if you enter 4.986 in a field with Decimal Places of 2, the number rounds to 4.99. Salesforce uses the round half-up
rounding algorithm. Half-way values are always rounded up. For example, 1.45 is rounded to 1.5. 1.45 is rounded to 1.5.
Dependent Field
Any custom picklist or multi-select picklist field that displays available values based on the value selected in its corresponding
controlling field.
Developer Edition
A free, fully-functional Salesforce organization designed for developers to extend, integrate, and develop with the Force.com platform.
Developer Edition accounts are available on developer.salesforce.com.
Salesforce Developers
The Salesforce Developers website at developer.salesforce.com provides a full range of resources for platform developers, including
sample code, toolkits, an online developer community, and the ability to obtain limited Force.com platform environments.
Document Library
A place to store documents without attaching them to accounts, contacts, opportunities, or other records.
E
Email Alert
Email alerts are workflow and approval actions that are generated using an email template by a workflow rule or approval process
and sent to designated recipients, either Salesforce users or others.
Email Template
A form email that communicates a standard message, such as a welcome letter to new employees or an acknowledgement that a
customer service request has been received. Email templates can be personalized with merge fields, and can be written in text,
HTML, or custom format.
Enterprise Edition
A Salesforce edition designed for larger, more complex businesses.
Enterprise WSDL
A strongly-typed WSDL for customers who want to build an integration with their Salesforce organization only, or for partners who
are using tools like Tibco or webMethods to build integrations that require strong typecasting. The downside of the Enterprise WSDL
is that it only works with the schema of a single Salesforce organization because it is bound to all of the unique objects and fields
that exist in that organization's data model.
655
Glossary
F
Field
A part of an object that holds a specific piece of information, such as a text or currency value.
Field-Level Security
Settings that determine whether fields are hidden, visible, read only, or editable for users. Available in Enterprise, Unlimited,
Performance, and Developer Editions only.
Filter Condition/Criteria
Condition on particular fields that qualifies items to be included in a list view or report, such as State equals California.
Force.com
The Salesforce platform for building applications in the cloud. Force.com combines a powerful user interface, operating system, and
database to allow you to customize and deploy applications in the cloud for your entire enterprise.
Force.com IDE
An Eclipse plug-in that allows developers to manage, author, debug and deploy Force.com applications in the Eclipse development
environment.
Force.com Migration Tool
A toolkit that allows you to write an Apache Ant build script for migrating Force.com components between a local file system and
a Salesforce organization.
Foreign Key
A field whose value is the same as the primary key of another table. You can think of a foreign key as a copy of a primary key from
another table. A relationship is made between two tables by matching the values of the foreign key in one table with the values of
the primary key in another.
Formula Field
A type of custom field. Formula fields automatically calculate their values based on the values of merge fields, expressions, or other
values.
Function
Built-in formulas that you can customize with input parameters. For example, the DATE function creates a date field type from a
given year, month, and day.
G
Gregorian Year
A calendar based on a 12-month structure used throughout much of the world.
656
Glossary
H
HTTP Debugger
An application that can be used to identify and inspect SOAP requests that are sent from the AJAX Toolkit. They behave as proxy
servers running on your local machine and allow you to inspect and author individual requests.
I
ID
See Salesforce Record ID.
Inline S-Control
Note: S-controls have been superseded by Visualforce pages. After March 2010 organizations that have never created
s-controls, as well as new organizations, won't be allowed to create them. Existing s-controls will remain unaffected, and can
still be edited.
An s-control that displays within a record detail page or dashboard, rather than on its own page.
Instance
The cluster of software and hardware represented as a single logical server that hosts an organization's data and runs their applications.
The Force.com platform runs on multiple instances, but data for any single organization is always stored on a single instance.
Integration User
A Salesforce user defined solely for client apps or integrations. Also referred to as the logged-in user in a SOAP API context.
ISO Code
The International Organization for Standardization country code, which represents each country by two letters.
J
Junction Object
A custom object with two master-detail relationships. Using a custom junction object, you can model a many-to-many relationship
between two objects. For example, you may have a custom object called Bug that relates to the standard case object such that a
bug could be related to multiple cases and a case could also be related to multiple bugs.
K
No Glossary items for this entry.
L
License Management Application (LMA)
A free AppExchange app that allows you to track sales leads and accounts for every user who downloads your managed package
(app) from the AppExchange.
License Management Organization (LMO)
The Salesforce organization that you use to track all the Salesforce users who install your package. A license management organization
must have the License Management Application (LMA) installed. It automatically receives notification every time your package is
657
Glossary
installed or uninstalled so that you can easily notify users of upgrades. You can specify any Enterprise, Unlimited, Performance, or
Developer Edition organization as your license management organization. For more information, go to
http://www.salesforce.com/docs/en/lma/index.htm.
List View
A list display of items (for example, accounts or contacts) based on specific criteria. Salesforce provides some predefined views.
In the Agent console, the list view is the top frame that displays a list view of records based on specific criteria. The list views you
can select to display in the console are the same list views defined on the tabs of other objects. You cannot create a list view within
the console.
Local Project
A .zip file containing a project manifest (package.xml file) and one or more metadata components.
Locale
The country or geographic region in which the user is located. The setting affects the format of date and number fields, for example,
dates in the English (United States) locale display as 06/30/2000 and as 30/06/2000 in the English (United Kingdom) locale.
In Professional, Enterprise, Unlimited, Performance, and Developer Edition organizations, a users individual Locale setting overrides
the organizations Default Locale setting. In Personal and Group Editions, the organization-level locale field is called Locale,
not Default Locale.
Logged-in User
In a SOAP API context, the username used to log into Salesforce. Client applications run with the permissions and sharing of the
logged-in user. Also referred to as an integration user.
Lookup Field
A type of field that contains a linkable value to another record. You can display lookup fields on page layouts where the object has
a lookup or master-detail relationship with another object. For example, cases have a lookup relationship with assets that allows
users to select an asset using a lookup dialog from the case edit page and click the name of the asset from the case detail page.
M
Managed Package
A collection of application components that is posted as a unit on the AppExchange and associated with a namespace and possibly
a License Management Organization. To support upgrades, a package must be managed. An organization can create a single
managed package that can be downloaded and installed by many different organizations. Managed packages differ from unmanaged
packages by having some locked components, allowing the managed package to be upgraded later. Unmanaged packages do not
include locked components and cannot be upgraded. In addition, managed packages obfuscate certain components (like Apex) on
subscribing organizations to protect the intellectual property of the developer.
Manifest File
The project manifest file (package.xml) lists the XML components to retrieve or deploy when working with the Metadata API,
or clients built on top of the Metadata API, such as the Force.com IDE or the Force.com Migration Tool.
Manual Sharing
Record-level access rules that allow record owners to give read and edit permissions to other users who might not have access to
the record any other way.
Many-to-Many Relationship
A relationship where each side of the relationship can have many children on the other side. Many-to-many relationships are
implemented through the use of junction objects.
658
Glossary
Master-Detail Relationship
A relationship between two different types of records that associates the records with each other. For example, accounts have a
master-detail relationship with opportunities. This type of relationship affects record deletion, security, and makes the lookup
relationship field required on the page layout.
Metadata
Information about the structure, appearance, and functionality of an organization and any of its parts. Force.com uses XML to describe
metadata.
Metadata WSDL
A WSDL for users who want to use the Force.com Metadata API calls.
Multitenancy
An application model where all users and apps share a single, common infrastructure and code base.
N
Namespace
In a packaging context, a one- to 15-character alphanumeric identifier that distinguishes your package and its contents from packages
of other developers onAppExchange, similar to a domain name. Salesforce automatically prepends your namespace prefix, followed
by two underscores (__), to all unique component names in your Salesforce organization.
Native App
An app that is built exclusively with setup (metadata) configuration on Force.com. Native apps do not require any external services
or infrastructure.
O
Object
An object allows you to store information in your Salesforce organization. The object is the overall definition of the type of information
you are storing. For example, the case object allow you to store information regarding customer inquiries. For each object, your
organization will have multiple records that store the information about specific instances of that type of data. For example, you
might have a case record to store the information about Joe Smith's training inquiry and another case record to store the information
about Mary Johnson's configuration issue.
Object-Level Help
Custom help text that you can provide for any custom object. It displays on custom object record home (overview), detail, and edit
pages, as well as list views and related lists.
Object-Level Security
Settings that allow an administrator to hide whole objects from users so that they don't know that type of data exists. Object-level
security is specified with object permissions.
onClick JavaScript
JavaScript code that executes when a button or link is clicked.
One-to-Many Relationship
A relationship in which a single object is related to many other objects. For example, an account may have one or more related
contacts.
659
Glossary
Organization-Wide Defaults
Settings that allow you to specify the baseline level of data access that a user has in your organization. For example, you can set
organization-wide defaults so that any user can see any record of a particular object that is enabled via their object permissions, but
they need extra permissions to edit one.
Outbound Message
An outbound message is a workflow, approval, or milestone action that sends the information you specify to an endpoint you
designate, such as an external service. Outbound messaging is configured in the Salesforce setup menu. Then you must configure
the external endpoint. You can create a listener for the messages using the SOAP API.
Overlay
An overlay displays additional information when you hover your mouse over certain user interface elements. Depending on the
overlay, it will close when you move your mouse away, click outside of the overlay, or click a close button.
Owner
Individual user to which a record (for example, a contact or case) is assigned.
P
Package
A group of Force.com components and applications that are made available to other organizations through the AppExchange. You
use packages to bundle an app along with any related components so that you can upload them to AppExchange together.
Partner WSDL
A loosely-typed WSDL for customers, partners, and ISVs who want to build an integration or an AppExchange app that can work
across multiple Salesforce organizations. With this WSDL, the developer is responsible for marshaling data in the correct object
representation, which typically involves editing the XML. However, the developer is also freed from being dependent on any particular
data model or Salesforce organization. Contrast this with the Enterprise WSDL, which is strongly typed.
Picklist
Selection list of options available for specific fields in a Salesforce object, for example, the Industry field for accounts. Users can
choose a single value from a list of options rather than make an entry directly in the field. See also Master Picklist.
Picklist (Multi-Select)
Selection list of options available for specific fields in a Salesforce object. Multi-select picklists allow users to choose one or more
values. Users can choose a value by double clicking on it, or choose additional values from a scrolling list by holding down the CTRL
key while clicking a value and using the arrow icon to move them to the selected box.
Picklist Values
Selections displayed in drop-down lists for particular fields. Some values come predefined, and other values can be changed or
defined by an administrator.
Primary Key
A relational database concept. Each table in a relational database has a field in which the data value uniquely identifies the record.
This field is called the primary key. The relationship is made between two tables by matching the values of the foreign key in one
table with the values of the primary key in another.
Production Organization
A Salesforce organization that has live users accessing data.
Professional Edition
A Salesforce edition designed for businesses who need full-featured CRM functionality.
660
Glossary
Q
Queue
A holding area for items before they are processed. Salesforce uses queues in a number of different features and technologies.
Query String Parameter
A name-value pair that's included in a URL, typically after a '?' character. For example:
http://na1.salesforce.com/001/e?name=value
R
Record
A single instance of a Salesforce object. For example, John Jones might be the name of a contact record.
Record Name
A standard field on all Salesforce objects. Whenever a record name is displayed in a Force.com application, the value is represented
as a link to a detail view of the record. A record name can be either free-form text or an autonumber field. Record Name does
not have to be a unique value.
Record Type
A record type is a field available for certain records that can include some or all of the standard and custom picklist values for that
record. You can associate record types with profiles to make only the included picklist values available to users with that profile.
Record-Level Security
A method of controlling data in which you can allow a particular user to view and edit an object, but then restrict the records that
the user is allowed to see.
Recycle Bin
A page that lets you view and restore deleted information. Access the Recycle Bin by using the link in the sidebar.
Related Object
Objects chosen by an administrator to display in the Agent console's mini view when records of a particular type are shown in the
console's detail view. For example, when a case is in the detail view, an administrator can choose to display an associated account,
contact, or asset in the mini view.
Relationship
A connection between two objects, used to create related lists in page layouts and detail levels in reports. Matching values in a
specified field in both objects are used to link related data; for example, if one object stores data about companies and another
object stores data about people, a relationship allows you to find out which people work at the company.
Relationship Query
In a SOQL context, a query that traverses the relationships between objects to identify and return results. Parent-to-child and
child-to-parent syntax differs in SOQL queries.
Report Type
A report type defines the set of records and fields available to a report based on the relationships between a primary object and its
related objects. Reports display only records that meet the criteria defined in the report type. Salesforce provides a set of pre-defined
standard report types; administrators can create custom report types as well.
Role Hierarchy
A record-level security setting that defines different levels of users such that users at higher levels can view and edit information
owned by or shared with users beneath them in the role hierarchy, regardless of the organization-wide sharing model settings.
661
Glossary
S
SaaS
See Software as a Service (SaaS).
S-Control
Note: S-controls have been superseded by Visualforce pages. After March 2010 organizations that have never created
s-controls, as well as new organizations, won't be allowed to create them. Existing s-controls will remain unaffected, and can
still be edited.
Custom Web content for use in custom links. Custom s-controls can contain any type of content that you can display in a browser,
for example a Java applet, an Active-X control, an Excel file, or a custom HTML Web form.
Salesforce Record ID
A unique 15- or 18-character alphanumeric string that identifies a single record in Salesforce.
Salesforce SOA (Service-Oriented Architecture)
A powerful capability of Force.com that allows you to make calls to external Web services from within Apex.
Sandbox
A nearly identical copy of a Salesforce production organization for development, testing, and training. The content and size of a
sandbox varies depending on the type of sandbox and the editioin of the production organization associated with the sandbox.
Search Layout
The organization of fields included in search results, in lookup dialogs, and in the key lists on tab home pages.
Session ID
An authentication token that is returned when a user successfully logs in to Salesforce. The Session ID prevents a user from having
to log in again every time he or she wants to perform another action in Salesforce. Different from a record ID or Salesforce ID, which
are terms for the unique ID of a Salesforce record.
Session Timeout
The period of time after login before a user is automatically logged out. Sessions expire automatically after a predetermined length
of inactivity, which can be configured in Salesforce from Setup by clicking Security Controls. The default is 120 minutes (two hours).
The inactivity timer is reset to zero if a user takes an action in the Web interface or makes an API call.
Setup
A menu where administrators can customize and define organization settings and Force.com apps. Depending on your organizations
user interface settings, Setup may be a link in the user interface header or in the drop-down list under your name.
Sharing
Allowing other users to view or edit information you own. There are different ways to share data:
Sharing Modeldefines the default organization-wide access levels that users have to each others information and whether
to use the hierarchies when determining access to data.
Role Hierarchydefines different levels of users such that users at higher levels can view and edit information owned by or
shared with users beneath them in the role hierarchy, regardless of the organization-wide sharing model settings.
Sharing Rulesallow an administrator to specify that all information created by users within a given group or role is automatically
shared to the members of another group or role.
Manual Sharingallows individual users to share records with other users or groups.
662
Glossary
Apex-Managed Sharingenables developers to programmatically manipulate sharing to support their applications behavior.
See Apex-Managed Sharing.
Sharing Model
Behavior defined by your administrator that determines default access by users to different types of records.
Sharing Rule
Type of default sharing created by administrators. Allows users in a specified group or role to have access to all information created
by users within a given group or role.
Sites
Force.com Sites enables you to create public websites and applications that are directly integrated with your Salesforce
organizationwithout requiring users to log in with a username and password.
Snippet
Note: S-controls have been superseded by Visualforce pages. After March 2010 organizations that have never created
s-controls, as well as new organizations, won't be allowed to create them. Existing s-controls will remain unaffected, and can
still be edited.
A type of s-control that is designed to be included in other s-controls. Similar to a helper method that is used by other methods in
a piece of code, a snippet allows you to maintain a single copy of HTML or JavaScript that you can reuse in multiple s-controls.
SOAP (Simple Object Access Protocol)
A protocol that defines a uniform way of passing XML-encoded data.
Software as a Service (SaaS)
A delivery model where a software application is hosted as a service and provided to customers via the Internet. The SaaS vendor
takes responsibility for the daily maintenance, operation, and support of the application and each customer's data. The service
alleviates the need for customers to install, configure, and maintain applications with their own hardware, software, and related IT
resources. Services can be delivered using the SaaS model to any market segment.
SOQL (Salesforce Object Query Language)
A query language that allows you to construct simple but powerful query strings and to specify the criteria that should be used to
select data from the Force.com database.
SOSL (Salesforce Object Search Language)
A query language that allows you to perform text-based searches using the Force.com API.
Standard Object
A built-in object included with the Force.com platform. You can also build custom objects to store information that is unique to
your app.
System Log
Part of the Developer Console, a separate window console that can be used for debugging code snippets. Enter the code you want
to test at the bottom of the window and click Execute. The body of the System Log displays system resource information, such as
how long a line took to execute or how many database calls were made. If the code did not run to completion, the console also
displays debugging information.
T
Test Method
An Apex class method that verifies whether a particular piece of code is working properly. Test methods take no arguments, commit
no data to the database, and can be executed by the runTests() system method either through the command line or in an
Apex IDE, such as the Force.com IDE.
663
Glossary
Translation Workbench
The Translation Workbench lets you specify languages you want to translate, assign translators to languages, create translations for
customizations youve made to your Salesforce organization, and override labels and translations from managed packages. Everything
from custom picklist values to custom fields can be translated so your global users can use all of Salesforce in their language.
Trigger
A piece of Apex that executes before or after records of a particular type are inserted, updated, or deleted from the database. Every
trigger runs with a set of context variables that provide access to the records that caused the trigger to fire, and all triggers run in
bulk modethat is, they process several records at once, rather than just one record at a time.
Trigger Context Variable
Default variables that provide access to information about the trigger and the records that caused it to fire.
U
Unit Test
A unit is the smallest testable part of an application, usually a method. A unit test operates on that piece of code to make sure it
works correctly. See also Test Method.
Unlimited Edition
Unlimited Edition is Salesforces solution for maximizing your success and extending that success across the entire enterprise through
the Force.com platform.
Unmanaged Package
A package that cannot be upgraded or controlled by its developer.
URL (Uniform Resource Locator)
The global address of a website, document, or other resource on the Internet. For example, http://www.salesforce.com.
URL S-Control
Note: S-controls have been superseded by Visualforce pages. After March 2010 organizations that have never created
s-controls, as well as new organizations, won't be allowed to create them. Existing s-controls will remain unaffected, and can
still be edited.
An s-control that contains an external URL that hosts the HTML that should be rendered on a page. When saved this way, the HTML
is hosted and run by an external website. URL s-controls are also called Web controls.
V
Validation Rule
A rule that prevents a record from being saved if it does not meet the standards that are specified.
Visualforce
A simple, tag-based markup language that allows developers to easily define custom pages and components for apps built on the
platform. Each tag corresponds to a coarse or fine-grained component, such as a section of a page, a related list, or a field. The
components can either be controlled by the same logic that is used in standard Salesforce pages, or developers can associate their
own logic with a controller written in Apex.
664
Glossary
W
Web Control
See URL S-Control.
Web Links
See Custom Links.
Web Service
A mechanism by which two applications can easily exchange data over the Internet, even if they run on different platforms, are
written in different languages, or are geographically remote from each other.
WebService Method
An Apex class method or variable that can be used by external systems, like a mash-up with a third-party application. Web service
methods must be defined in a global class.
Web Services API
A Web services application programming interface that provides access to your Salesforce organization's information. See also SOAP
API and Bulk API.
Web Tab
A custom tab that allows your users to use external websites from within the application.
Workflow Action
A workflow action, such as an email alert, field update, outbound message, or task, fires when the conditions of a workflow rule are
met.
Workflow Email Alert
A workflow action that sends an email when a workflow rule is triggered. Unlike workflow tasks, which can only be assigned to
application users, workflow alerts can be sent to any user or contact, as long as they have a valid email address.
Workflow Field Update
A workflow action that changes the value of a particular field on a record when a workflow rule is triggered.
Workflow Outbound Message
A workflow action that sends data to an external Web service, such as another cloud computing application. Outbound messages
are used primarily with composite apps.
Workflow Queue
A list of workflow actions that are scheduled to fire based on workflow rules that have one or more time-dependent workflow actions.
Workflow Rule
A workflow rule sets workflow actions into motion when its designated conditions are met. You can configure workflow actions to
execute immediately when a record meets the conditions in your workflow rule, or set time triggers that execute the workflow
actions on a specific day.
Workflow Task
A workflow action that assigns a task to an application user when a workflow rule is triggered.
WSDL (Web Services Description Language) File
An XML file that describes the format of messages you send and receive from a Web service. Your development environment's SOAP
client uses the Salesforce Enterprise WSDL or Partner WSDL to communicate with Salesforce using the SOAP API.
665
Glossary
X
XML (Extensible Markup Language)
A markup language that enables the sharing and transportation of structured data. All Force.com components that are retrieved or
deployed through the Metadata API are represented by XML definitions.
Y
No Glossary items for this entry.
Z
Zip File
A data compression and archive format.
A collection of files retrieved or deployed by the Metadata API. See also Local Project.
666
INDEX
A
Account Team Roles 16
AccountSettings components 505
ActionLinkGroupTemplate component 116
ActionOverride component 219
ActivitiesSettings component 506
AddressSettings component 509
AllOrNoneHeader header 634
Analytics 366
AnalyticSnapshot component 120
ApexClass component 130
ApexComponent component 133
ApexPage component 134
ApexTrigger component 136
API support policy 3
AppMenu component 137
ApprovalProcess components 140
ArticleType component
Layout 125
AssignmentRules component 152
AuraDefinitionBundle component 155
AuthProvider object 157
AutoResponseRules component 162
B
Backward compatibilty 3
BaseSharingRule component 571
BusinessHoursSettings component 513
BusinessProcess component 221
C
call deprecation 3
CallCenter component 164
CallOptions header 636
Calls
cancelDeploy 41
checkDeployStatus 40
checkRetrieveStatus 54
checkStatus 77
create (asynchronous) 69
createMetadata (synchronous) 57
delete (asynchronous) 71
deleteMetadata (synchronous) 66
deploy 31
deployRecentValidation 43
Calls (continued)
describeMetadata 78
describeValueType 79
listMetadata 82, 84
readMetadata (synchronous) 60
renameMetadata (synchronous) 68
retrieve 48
update (asynchronous) 73
updateMetadata (synchronous) 61
upsertMetadata (synchronous) 64
cancel deploy call 41
CaseSettings components 517
Certificate component 166
ChatterAnswersSettings component 524
checkDeployStatus metadata call 40
checkRetrieveStatus metadata call 54
checkStatus metadata call 77
Community (Zone)component 167
CompactLayout component 223
CompanySettings component 526
component 197
Components
AccountSettings 505
ActionLinkGroupTempalte 116
ActionOverride 219
ActivitiesSettings 506
Activity Settings 506
AddressSettings 509
AnalyticSnapshot 120
ApexClass 130
ApexComponent 133
ApexPage 134
ApexTrigger 136
AppMenu 137
ApprovalProcess 140
Article Type 127
ArticleType 122
AssignmentRules 152
AuraDefinitionBundle 155
AutoResponseRules 162
BaseSharingRule 571
BusinessHoursSettings 513
BusinessProcess 221
CallCenter 164
CaseSettings 517
Certificate 166
667
Index
Components (continued)
ChatterAnswersSettings 524
Community (Zone) 167
CompactLayout 223
CompanySettings 526
ConnectedApp 170
ContractSettings 527
CorsWhitelistOrigin 178
CriteriaBasedSharingRule 572
custom metadata type 201
CustomApplication 179
CustomApplicationComponent 196
CustomFeedFilter 197
CustomField 225
CustomLabels 199
CustomMetadata 204
CustomObject 209
CustomObjectTranslation 264
CustomPageWebLink 273
CustomPermission 276
CustomSite 278
CustomTab 283
Dashboard 286
DataCategoryGroup 305
DelegateGroup 310
Dependent Picklist (see Picklist) 243
Document 312
EmailTemplate 314
EntitlementProcess 318
EntitlementSettings 528
EntitlementTemplate 322
EscalationRules 323
ExternalDataSource 326
FieldSet 235
FlexiPage 329
Flow 335
Folder 364
FolderShare 366
ForecastingSettings 530
Group 368
HistoryRetentionPolicy 236
HomePageComponent 369
HomePageLayout 370
IdeasSettings 539
InstalledPackage 371
KeywordList 372
KnowledgeSettings 540
Layout 374
Layout (for article types) 125
Components (continued)
Letterhead 394
list of types 103
ListView 237
LiveAgentSettings 544
LiveChatAgentConfig 397
LiveChatButton 401
LiveChatDeployment 404
LiveChatSensitiveDataRule 406
ManagedTopics 408
MatchingRule 410
Metadata 413
MetadataWithContent 414
MilestoneType 414
MobileSettings 545
ModerationRule 415
NamedCredential 418
NamedFilter 241
NameSettings 548
network 420
OpportunitySettings 549
OrderSettings 550
OwnerSharingRule 578
PathAssistant 431
PathAssistantSettings 551
PermissionSet 433
Picklist 243
PlatformCachePartition 440
Portal 442
PostTemplate 445
ProductSettings 552
Profile 446
Queue 458
QuickAction 459
QuoteSettings 553
RecordType 249
RemoteSiteSetting 464
Report 465
ReportType 492
Role 495
RoleOrTerritory 496
SamlSsoConfig 498
Scontrol 501
SearchLayouts 252
SecuritySettings 554
Settings 503
SharedTo 562
SharingBaseRule 564
SharingReason 254
668
Index
Components (continued)
SharingRecalculation 255
SharingRules 565
SharingSet 584
SiteDotCom 587
Skill 588
StaticResource 590
SynonymDictionary 591
Territory 593
Territory2 594
Territory2Model 598
Territory2Rule 600
Territory2Settings 560
Territory2Type 603
TransactionSecurityPolicy 604
Translations 606
unsupported 113
ValidationRule 256
WaveApplication 614
WaveDataset 615
WaveTemplateBundle 616
WebLink 257
Workflow 618
Components in deployments 115
ConnectedApp component 170
ContractSettings component 527
CorsWhitelistOrigin component 178
create call (asynchronous) 69
createMetadata call (synchronous) 57
CriteriaBasedSharingRule component 572
Custom metadada type component 201
CustomApplication component 179
CustomApplicationComponent component 196
CustomField component 225
CustomLabels component 199
CustomMetadata component 204
CustomObject
WebLink component 257
CustomObject component 209
CustomObjectTranslation
language support 640, 646
CustomObjectTranslation component 264
CustomPageWebLink component 273
CustomPermission component 276
CustomSite component 278
CustomTab component 283
D
Dashboard component 286
E
Editions 1
EmailTemplate component 314
EntitlementProcess components 318
EntitlementSettings components 528
EntitlementTemplate component 322
Error handling 30
EscalationRules component 323
Expiration of session ID 30
ExternalDataSource component 326
F
Field types 261
FieldSet component 235
File-based metadata 14
FlexiPage component 329
Flow component 335
FlowDefinition 363
Folder component 364
ForecastingSettings component 530
G
Group component 368
H
Headers
AllOrNoneHeader 634
669
Index
Headers (continued)
CallOptions 636
DebuggingHeader 637
SessionHeader 639
HistoryRetentionPolicy component 236
HomePageComponent component 369
HomePageLayout component 370
I
IdeasSettings component 539
InstalledPackage component 371
K
KeywordList component 372
KnowledgeSettings component 540
L
Layout component 374
Layout component (for article types) 125
Letterhead component 394
listMetadata call 82
ListMetadataQuery 84
ListView component 237
LiveAgentSettings components 544
LiveChatAgentConfig components 397
LiveChatButton components 401
LiveChatDeployment components 404
LiveChatSensitiveDataRule component 406
M
ManagedTopics component 408
Manifest file 14, 16
MatchingRule component 410
Metadata calls 1
Metadata component 413
Metadata components 112
Metadata types 103, 112113
MetadataWithContent component 414
MilestoneType component 414
MobileSettings component 545
ModerationRule component 415
N
NamedCredential component 418
NamedFilter component 241
NameSettings component 548
Network component 420
O
Object relationship 492
Objects
AuthProvider 157
Opportunity Team Roles 16
OpportunitySettings component 549
OrderSettings component 550
Outer join 492
OwnerSharingRule component 578
P
Package 430
Package versions 130
package.xml
samples 16
PackageVersion 130
PathAssistant component 431
PathAssistantSettings component 551
PermissionSet component 433
Picklist component 243
PlatformCachePartition component 440
Portal component 442
PostTemplate component 445
Prerequisites 4
ProductSettings component 552
Profile component 446
Q
Queue component 458
Quick start
Generate WSDLs 4
Import WSDLs 5
Java sample 6
Prerequisites 4
QuickAction component 459
QuoteSettings component 553
R
readMetadata call (synchronous) 60
RecordType component 249
Recycle Bin 312
RemoteSiteSetting component 464
renameMetadata call (synchronous) 68
Report component 465
ReportType component 492
Retrieve 14
retrieve call 48
RetrieveRequest 53
Role component 495
670
Index
S
SamlSsoConfig component 498
Sample code 6
Sandbox 1
Scontrol component 501
SearchLayouts component 252
SecuritySettings component 554
Session ID expiration 30
SessionHeader header 639
Settings 503
SharedTo component 562
SharingBaseRule component 564
SharingReason component 254
SharingRecalculation component 255
SharingRules 565
SharingSet component 584
SiteDotCom component 587
Skill component 588
Standards compliance 2
StaticResource component 590
Support policy 3
Supported calls 112
SynonymDictionary component 591
T
Territory component 593
Territory2 component 594
Territory2Model component 598
Territory2Rule component 600
U
Understanding metadata calls and components 1
update call (asynchronous) 73
updateMetadata call (synchronous) 61
upsertMetadata call (synchronous) 64
Usernames 24
V
ValidationRule component 256
Versions 130
Visualforce component, see ApexComponent 133
Visualforce page, see ApexPage 134
W
WaveApplication component 614
WaveDataset component 615
WaveTemplateBundle component 616
WebLink component 257
Workflow component 618
WSC 5
WSDL integration 45
Z
Zip file 14
671