Salesforce Asked on October 4, 2021
I have a requirement to show dynamic picklist values based on recordType. I did my research but looks like nothing native from Apex can handle this.
I went the route of calling Describelayout method via AjaxToolkit but always returns an empty array. Not sure if that’s supported anymore?
You can get the values using describeLayout
method available in Ajax Toolkit. I tried with below code and I am able to get the picklist values based on the record type. There are two RecordTypes "Author" and "Publisher" and have different values in picklist Country__c. You can find the result in the screenshot.
var result = sforce.connection.describeLayout('sarojkbera__Book__c');
console.log(result);
Browser console screenshot:
Answered by Saroj Bera on October 4, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP