Wednesday 22 June 2016

external code

<apex:page controller="Regionext">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >

<apex:inputText value="{!Searched}"/>
<apex:commandButton value="Submit" Action="{!Submit}"/>
<apex:pageBlockTable value="{!Regs}" var="a">
<apex:column Value="{!a.RegionDescription__c}"></apex:column>
<apex:column Value="{!a.RegionID__c}"></apex:column>


</apex:pageBlockTable>

</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
                
------------------------------------------------------------------------------
public class Regionext{
    public List<Regions__x> Regs{set;get;}
    Public String Searched{set;get;}
    public Void Submit(){
        Regs=[select id,RegionDescription__c,RegionID__c from Regions__x where RegionID__c=:1];
    }
}
--------------------------------------------


http://services.odata.org/v3/Northwind/Northwind.svc/
https://help.salesforce.com/HTViewHelpDoc?id=platform_connect_setup.htm&language=en_US


http://services.odata.org/v3/Northwind/Northwind.svc/

extenal links

https://help.salesforce.com/HTViewHelpDoc?id=external_object_define.htm


https://help.salesforce.com/htviewhelpdoc?err=1&id=external_object_define.htm&siteLang=en_US


In SFDC org oData is used .... There are couple of external tables are connected in SFDC as __x external objects ... now I need to create one VF page and to display some of the records from one such external objects....

Reg Search with External controller

<apex:page controller="Registrations">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >

<apex:inputText value="{!Searched}"/>
<apex:commandButton value="Submit" Action="{!Submit}"/>
<apex:pageBlockTable value="{!Regs}" var="a">
<apex:column Value="{!a.Name__c}"></apex:column>
<apex:column Value="{!a.Email__c}"></apex:column>
<apex:column Value="{!a.Pancard__c}"></apex:column>
<apex:column Value="{!a.Phone__c}"></apex:column>

</apex:pageBlockTable>

</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
___________________________________________________
public class Registrations{
    public List<Registrations_c> Regs{set;get;}
    Public String Searched{set;get;}
    public Void Submit(){
        Regs=[select id,Name__c,Email__c,Pancard__c,Phone__c from Registrations__c where name=:Searched];
    }
}


http://developerforce.github.io/lightning-connect-tutorial/configure-data-source-objects.html
________________________________________________