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'

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">

  • Thank you. I am testing the answer, I will write-back with the findings. Nov 5 '17 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.