You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is sometimes useful to call from the Rails console during development time to get the metadata for an sObject (e.g., required fields, relationship names, etc.). However, you have to call it by getting a reference to the sfdc_client, something like this:
Seems like it would be really easy to add as a class method on SObject, since sfdc_client and table_name are already available on that class. So it would instead look like this:
Af::Campaign.describe
Then we could add some convenience methods for filtering through that response for common cases, like checking if a field is nillable or getting a relationship name, etc.
Long-term, this might be useful to have for building more optimized queries that deal with relationships (e.g., "joins"). If we could cache this response on the class and then re-use that to build queries. Although I haven't really thought this through very much.
The text was updated successfully, but these errors were encountered:
This is sometimes useful to call from the Rails console during development time to get the metadata for an sObject (e.g., required fields, relationship names, etc.). However, you have to call it by getting a reference to the
sfdc_client
, something like this:Seems like it would be really easy to add as a class method on
SObject
, sincesfdc_client
andtable_name
are already available on that class. So it would instead look like this:Then we could add some convenience methods for filtering through that response for common cases, like checking if a field is nillable or getting a relationship name, etc.
Long-term, this might be useful to have for building more optimized queries that deal with relationships (e.g., "joins"). If we could cache this response on the class and then re-use that to build queries. Although I haven't really thought this through very much.
The text was updated successfully, but these errors were encountered: