+ Start a Discussion
mukesh guptamukesh gupta 

Remote Objects in lightning component instead of VF page

Hi Expert,

I want to use Remote Objects in lightning component , below code is working in visualforce  pages, but now i need to implement this code in lightning component.

for example:- 
  <!-- Remote Objects definition to set accessible sObjects and fields -->
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Warehouse__c" jsShorthand="Warehouse" 
            <apex:remoteObjectField name="Phone__c" jsShorthand="Phone"/>

Raj VakatiRaj Vakati
You can use the lightning data service which iwill be similar 

refer this link 

    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="record" type="Object" />
    <aura:attribute name="simpleRecord" type="Object" />
     <force:recordData recordId="{!v.recordId}"
          targetRecord ="{!v.record}"
          targetFields ="{!v.simpleRecord}"
          fields="Id, Name" />
    <div class="recordName">
        <p class="slds-text-heading--medium">
            <lightning:formattedtext title="Record Name" value="{!v.simpleRecord.Name}" /></p>