13

We are creating OutboundMessages programmatically using the SOAP Metadata API.

We've discovered that not all returned sObjects are supported and some supported sObjects have fields which are not supported.

The SFDC New Outbound Message pages appears to automatically filter out the sObjects and fields that are not valid.

How can we programmatically filter out both sObjects themselves and the fields that are not compatible and match what is shown to the users in the site? We are unable to find any field attributes to differentiate them. Is there a known black-list that cannot be used?

For example, you cannot just use datatype. The "Fiscal" field on Opportunity is a String but isn't valid. Also, "BillingAddress" on Account is type Address is isn't valid.


Here are the two dropdowns that we're trying to match programmatically.

enter image description here

enter image description here

5
+125

The diagram in Understanding Outbound Messaging is helpful here.

It shows Outbound messages starting from a workflow trigger. So the question becomes, which objects and associated fields can be used in a workflow?

The ToolingAPI exposes WorkflowRule. The object that the workflow rule applies to is stored in the TableEnumOrId field.

The enum (for example, Account) or ID of the object for this workflow rule.

Note that this is a picklist field, so we can use the Tooling API to do a describeSObject call and get the DescribeSObjectResult back. This will include a fields collection with the metadata for the TableEnumOrId picklist field.

Here is an example dump for the PicklistEntry.Value, er, values for TableEnumOrId in Summer '15 (Note that there is a beta version to support User in Winter '16).

Account
Asset
Campaign
CampaignMember
Case
CaseComment
Contact
Contract
DuplicateRecordItem
DuplicateRecordSet
Event
FeedItem
Lead
Macro
MacroAction
MacroInstruction
Opportunity
OpportunityLineItem
OpportunityTeamMember
Organization
Product2
Site
SocialPersona
Solution
StreamingChannel
Task
User
UserProvisioningRequest

As per Selecting the Object for Your Workflow Rule, you can also specify custom objects using the 01I keyprefix Id for CustomEntityDefinition.

I'm still not sure on how to then identify the available fields.

From Simon Fell's comment:

For fields you should be able to use all non-compound fields returned from a describe for the relevant API version.

  • 1
    For fields you should be able to use all non-compound fields returned from a describe for the relevant API version. – superfell Oct 7 '15 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.