You need to sign in to do that
Don't have an account?
dke01
Get a custom setting dynamically
Hi,
I want to return value of a custom setting as a string.
For example
MyCustomSettingInstance.getValueForField('foo');
Is this achievable?
Or can I do via dynamic SOQL somehow?
Like
query = 'SELECT '+ foo +' from MySetting__C where .......'
Then return just the String value for foo and not an sObject?
I just noticed the sObject api has a GET method. This solved my issue calling MyInstance.get(string) returns the Object that I want.
so my code is now