Skip to main content

SLAM_sObject_fields

Overview

Downloads detailed field definitions for a single Salesforce object. The results will be stored in a table sobject_fields_<sObjectName>. The user must have access to the Salesforce object.

tip

When bulk retrieval of all fields for all objects from Salesforce org is not needed, this is the preferred method because the list of fields returned is not limited by Salesforce field permissions (every field will be returned). However, certain attributes may not be available due to Salesforce permissions:

  • Field attributes named part.* are not subject to permissions and contain
  • Field attributes named desc.* are subject to permissions and may be null as a result

While many field attributes exist under both the part.* and desc.* prefixes, some are exclusive to one or the other.

Parameters

NameTypeDefaultDescription
@sObjectVARCHAR(120)RequiredSalesforce object name to retrieve fields for
@exists_actionVARCHAR(20)NULLControls the behavior when the destination object sobject_fields_<sObjectName> already exists. If NULL, uses the value from SLAM_Settings.default_exists_action (defaulted to 'drop' during initial setup).

Valid options:

  • 'drop' - Drop the existing object and create a new one (default)
  • 'rename' - Rename the existing object by appending a timestamp suffix (format: _YYYYMMDDTHHMMSS_MMM)
  • 'fail' - Throws a SQL exception if the destination object already exists

Usage Examples

EXEC dbo.SLAM_sObject_fields 'Account'

SELECT * FROM sobject_fields_Account