Tuesday, May 19, 2015

Displaying record based on id value




<apex:page standardController="Bottle__c" >
  <apex:form >
  <apex:pageBlock >
  <apex:pageBlockButtons >
  <apex:commandButton value="Cancel" action="{!Cancel}" />
  </apex:pageBlockButtons>
 
  <apex:pageBlockSection >
   
  <apex:pageBlockSectionItem >
  <apex:outputText >Bottle Name</apex:outputText>
  <apex:outputField value="{!Bottle__c.Name}" />
  </apex:pageBlockSectionItem>
 
  <apex:pageBlockSectionItem >
  <apex:outputText >Bottle Price</apex:outputText>
  <apex:outputField value="{!Bottle__c.Price__c}" />
  </apex:pageBlockSectionItem>
 
  <apex:pageBlockSectionItem >
  <apex:outputText >Bottle Quantity</apex:outputText>
  <apex:outputField value="{!Bottle__c.Quantity__c}" />
  </apex:pageBlockSectionItem>
 
  <apex:pageBlockSectionItem >
  </apex:pageBlockSectionItem>
  <apex:pageBlockSectionItem >
  </apex:pageBlockSectionItem>
  <apex:pageBlockSectionItem >
  </apex:pageBlockSectionItem>
  <p> To display 1 record after the pageName?id=value<br/>
  <b>Note</b>: id value of the record ex: stdSet_Ctrl?id=value</p>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>

Monday, April 20, 2015


In any technology/gie's we will have some or the other way to save data / retrieve data.

Generally we create Tables to store user data and we need to connect that table with other tables for in-depth information about the users. For that we have relations to access data from the other Tables.

In Salesforce we call tables as sObject/sObjects

sObject is similar of kind Table in other Technologies (Salesforce Objects)

Relation Ships in Sales force

1. Look Up
2. Master-Detail

With these two relations we can achieve other relationships.

3. Many-to-Many (with the Master-Detail)
4. Hierarchical 


Saturday, March 21, 2015


Salesforce.com is no.1 PAAS (Platform As A Service)  Provider.

It Provides SAAS (Software As A Service) which is CRM with Call Center & Chatter App and IAAS (Infrastructure As A Service) as well.

People generally get Register/SignUp at salesforce.com with valid Email_id and Password. Which is valid for only 30 days.

If your an Developer / Want to learn how to Develop and Test Apps in Salesforce Then,

you should go to
> URL: http://developerforce.com  which indeed takes you to the http://developer.salesforce.com .

Which is valid for 90 days but you can change validity in  My Settings > Advance User Settings.

After Registering/Signing-up you will get a mail to activate the account. Just Click on A big link in the mail which came from salesforce.com

From Next Time

Just goto Web Browser

> http://login.salesforce.com

> Login with your Credentials


Friday, March 20, 2015

Standard Controller

Which is similar to that of Salesforce's standard controller. when insert a record into sObject then the page will be redirect to he Detail Page of that record. Which renders the record with the standard controller


Here is the sample code which display record values based on the Record ID using Standard Controller

standardController is an attribute in the page tag which uses to call the sObject for values


<apex:page standardController="Bottle__c" >
  <apex:form >
  <apex:pageBlock >
  <apex:pageBlockButtons >
  <apex:commandButton value="Cancel" action="{!Cancel}" />
  </apex:pageBlockButtons>
 
  <apex:pageBlockSection >
   
  <apex:pageBlockSectionItem >
  <apex:outputText >Bottle Name</apex:outputText>
  <apex:outputField value="{!Bottle__c.Name}" />
  </apex:pageBlockSectionItem>
 
  <apex:pageBlockSectionItem >
  <apex:outputText >Bottle Price</apex:outputText>
  <apex:outputField value="{!Bottle__c.Price__c}" />
  </apex:pageBlockSectionItem>
 
  <apex:pageBlockSectionItem >
  <apex:outputText >Bottle Quantity</apex:outputText>
  <apex:outputField value="{!Bottle__c.Quantity__c}" />
  </apex:pageBlockSectionItem>
 
  <apex:pageBlockSectionItem >
  </apex:pageBlockSectionItem>
  <apex:pageBlockSectionItem >
  </apex:pageBlockSectionItem>
  <apex:pageBlockSectionItem >
  </apex:pageBlockSectionItem>
  <p> To display 1 record after the pageName?id=value<br/>
  <b>Note</b>: id value of the record ex: stdSet_Ctrl?id=value</p>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>



Note : Bottle__c is an Custom sObject, You can use Standard SObject's like Account,Contact,Lead,Opportunity.. etc

To display records, In Salesforce we have 6-controllers

Standard Controller

Custom Controller

Standard List Controller

Custom List Controller

Standard Set Controller

Extension Controller

To achieve standard functionalities we use standard controller's. To have our own custom business logic then we go for custom controllers.

Here we will See the Standard Controller

In visual force we have basic and important tags and every tag must be closed with its closing tag.

<apex:page> 

all other tags will be inside of this root tag 

</apex:page>

and we have tags like <apex:pageblock> and this tag have child <apex:pageblocksection> page block tag has child <apex:pageblocksectionitem> 

Sample code

<apex:pages>                ---> Root Tag

<apex:pageblock>         ---> It is like Container

<apex:pageblocksection>       
<apex:pageblocksectionitem>     ---> Groups Components can place two components in it
<h1> Welcome to the visual force coding <h1>    
</apex:pageblocksectionitem> 
</apex:pageblocksection>

</apex:pageblock>

</apex:pages>







Before start of any Visualforce development  in Salesforce make sure --> goto Profile --> Advanced User Details --> check Developer Mode is checked.

To create visual force -> go to Setup -> go to Develop -> Look for Pages Tab

You will get default Visualforce Page --> Save --> Preview

<apex:page>
  <!-- Begin Default Content REMOVE THIS -->
  <h1 class="heading">Hi Vishwa Congratulations</h1>
  This is your First Page in Visualforce
  <!-- End Default Content REMOVE THIS -->
</apex:page>

Promotions

Ads

Popular Posts