Is there any way to fetch picklist values based on a record type. I am wondering how salesforce does it. I am fetching list of record types via ForceTK, next i want to fetch picklist values based on a record type. ForceTK gives all information about an object metadata but i could not find any filtering based on record type.
I'm using the code below to fetch the metadata for my custom object.
var client = new forcetk.Client(); // Get the token from Visualforce client.setSessionToken('{!$Api.Session_ID}'); client.describe('File__c', function(response){ console.log(response); }, function(request, status, response){ console.log(status); } );
Regards,
Sangram
Best Answer
Not sure about ForceTK ,may be this is not implemented by library yet or safe harbour and I am not sure .
But normally through standard REST API we can implement this using below REST Service
/services/data/v33.0/sobjects/Account/describe/layouts/
For different object you can change Object name and versions
/vXX.X/sobjects/Object/describe/layouts/
I just checked my dev console and it does return values as expected .There is a recordtype mappings that can give you various picklists needed