This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page standardController="Account" extensions="AccountRedirectionController" action="{!redirectToStandardpage}"> | |
<apex:pageBlock > | |
<apex:pageBlockSection title="Account Detail" columns="2"> | |
<apex:outputField value="{!account.Name}"/> | |
<apex:outputField value="{!account.Type}"/> | |
<apex:outputField value="{!account.Industry}" /> | |
<apex:outputField value="{!account.AnnualRevenue}" /> | |
<apex:outputField value="{!account.Rating}" /> | |
<apex:outputField value="{!account.Phone}" /> | |
<apex:outputField value="{!account.Fax}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountRedirectionController { | |
public string accId; | |
public string recName; | |
public AccountRedirectionController(ApexPages.StandardController stdcontroller) { | |
if(ApexPages.currentPage().getparameters().get('id')!=null) { | |
accId = ApexPages.currentPage().getparameters().get('id'); | |
recName = [SELECT Id, RecordtypeId, RecordType.name FROM Account where Id =: accId ].RecordType.Name; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" > | |
<div class="demo-only slds-grid" style="height: 150px; width: 300px; padding: 2rem;"> | |
<div class="slds-is-fixed"> | |
<div style="position: absolute;"> | |
<ui:inputSelect multiple="true" aura:id="levels" change="{!c.onSelectChange}"> | |
<ui:inputSelectOption text="" label="" value="true"/> | |
<ui:inputSelectOption text="Pune" label="Pune"/> | |
<ui:inputSelectOption text="Mumbai" label="Mumbai"/> | |
<ui:inputSelectOption text="Delhi" label="Delhi"/> | |
<ui:inputSelectOption text="Bangalore" label="Bangalore"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Abstract Controller, contains instance variable, constructor. | |
* Abstract class cannot be instantiated and contains one abstract method. | |
*/ | |
public abstract class AbstractController { | |
public Integer result; | |
public Integer getresult() { | |
if(result != null) { | |
return result; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* this class extends AbstractController and implements abstract method | |
*/ | |
public class Calculator extends AbstractController { | |
public Calculator() { | |
System.debug(' Calculator class extends AbstractController'); | |
} | |
public override Integer calculate(Integer val1, Integer val2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Virtual Class with virtual methods | |
* | |
*/ | |
public virtual class Marker { | |
public virtual void write() { | |
system.debug(' MARKER: writing some text'); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Child class extending Virtual Class | |
*/ | |
public class BlueMarker extends Marker{ | |
// overriding write method | |
public override void write() { | |
System.debug('BLUEMARKER: writing some text using BlueMarker'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Declaring and defining Abstract class extending Virtual class | |
*/ | |
public abstract class AbstractMarker extends Marker { | |
public override void write(){ | |
system.debug(' ABSTRACTMARKER: writing text with permanent Marker.'); | |
} | |
// Declaring abstract method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Child class extending Abstract class which extended Virtual class | |
*/ | |
public class ExtendController extends AbstractMarker{ | |
public override decimal discount(Integer markerCount) { | |
if(markerCount > 10) { | |
return 1.5; | |
} else { | |
return 0.5; |
OlderNewer