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
SObject.describe is a nice convenience method when I want to investigate the SF metadata behind an object.
However, I'm often only looking for a particular field and the object that's returned from this endpoint is rather large and unruly. For example, to get the metadata for a particular field, I run something like this:
Which is kind of verbose and requires having to look up the name of the SF field that maps to the object attribute.
It would be nice if ActiveForce exposed a method that did this for me, including mapping a symbol for the attribute name to the correct SF field name. Something like:
MyObject.describe_field(:my_field)
It should also take a string for the actual SF field as well, which should be pretty easy to implement.
MyObject.describe_field('My_Field__c')
Or, possibly it should be variadic and take one or many field names, returning an array of field metadata:
I'm happy to write up a PR for this--should be straightforward. But wanted to open for discussion before moving forward. Would anyone else actually use this or is this just a very niche nice-to-have? What should the API be if it is actually useful?
SObject.describe
is a nice convenience method when I want to investigate the SF metadata behind an object.However, I'm often only looking for a particular field and the object that's returned from this endpoint is rather large and unruly. For example, to get the metadata for a particular field, I run something like this:
Which is kind of verbose and requires having to look up the name of the SF field that maps to the object attribute.
It would be nice if ActiveForce exposed a method that did this for me, including mapping a symbol for the attribute name to the correct SF field name. Something like:
It should also take a string for the actual SF field as well, which should be pretty easy to implement.
Or, possibly it should be variadic and take one or many field names, returning an array of field metadata:
The text was updated successfully, but these errors were encountered: