The question is in the code comments. Thank you!

<apex:remoteObjects >
<apex:remoteObjectModel jsShortHand="js" name="myCustomObject__c" fields="Id">
<apex:remoteObjectField name="custom_Field__c">
<div id="dynamicSelectionContainer">
This page is intentionally not record-specific.
How would I create a html select list where 
each select option is labeled after the RecordType.Name of Schema.SObjectType.myCustomObject__c? 
i also need RecordType.Id to be jquery-accessible, i think as an attribute.
In other words how would I dynamically create 
the html <Select> <Option> markup to give me all Record Types
of  Schema.SObjectType.myCustomObject__c.  
Example: SELECT Id,Name FROM RecordType where sobjectType='myCustomObject__c'

1 Answer 1


You can use remoting for this purpose. Here's a generic page that loads the record types for Account (replace with your desired object):

<apex:page >
    <apex:remoteObjects jsNamespace="remoteNS">
        <apex:remoteObjectModel name="RecordType" fields="SObjectType,Name,DeveloperName,Id" />
    var rt = new remoteNS.RecordType();
    rt.retrieve({ where: { SObjectType: { eq: "Account" } } }, function(error, result) {
            var options = document.getElementById("recordTypeOptions");
            var option = document.createElement("option");
            option.text = value.get('Name');
            option.value = value.get('Id');
    <select id="recordTypeOptions">


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .