You need to sign in to do that
Don't have an account?
A Me
How to get picklist values for a field by record type , using apex only , no VF pages?
Hi,
I am writing a web service which will validate the incoming request and create a custom object record based on the parameters in the request. The custom object has 2 record types (say 'A' and 'B') . The web service creates records of record type 'A' only .
One of the fields of the object is a picklist , type__c , and the web service must validate the value of this field in the request. So it must check that the incoming value is one of the picklist values permissible for record type 'A' of the custom object.
I have checked several posts, but all of them involve visualforce pages and their controllers. How can this be achieved in apex, without VF pages?
I am writing a web service which will validate the incoming request and create a custom object record based on the parameters in the request. The custom object has 2 record types (say 'A' and 'B') . The web service creates records of record type 'A' only .
One of the fields of the object is a picklist , type__c , and the web service must validate the value of this field in the request. So it must check that the incoming value is one of the picklist values permissible for record type 'A' of the custom object.
I have checked several posts, but all of them involve visualforce pages and their controllers. How can this be achieved in apex, without VF pages?
You may be able to do this via the metadata API, and you can access this in an unsupported library from Financial Force at:
https://github.com/financialforcedev/apex-mdapi
This isn't endorsed or supported by Salesforce, so there is potential for it to stop working if Salesforce change the way that the metadata API works.
All Answers
You may be able to do this via the metadata API, and you can access this in an unsupported library from Financial Force at:
https://github.com/financialforcedev/apex-mdapi
This isn't endorsed or supported by Salesforce, so there is potential for it to stop working if Salesforce change the way that the metadata API works.