HI Vamshi, Based on your formula field {! } it will execute the corresponding extension. If both the extension having same method name then it will execute first extension. Below is the example
If both extension having same method, whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list will execute first.
Apex Code : public class ExtOne { public ExtOne(ApexPages.StandardController acon) { } public String getFoo() { return 'foo-One'; } }
public class ExtTwo { public ExtTwo(ApexPages.StandardController acon) { } public String getFoo() { return 'foo-Two'; } }
VF Code: <apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false"> <apex:outputText value="{!foo}"/> //This formula field will call first foo() i.e ExtOne </apex:page>
If both having different method then it will execute based on formula {! } which method you are calling
Apex Code : public class OneExt { public OneExt(ApexPages.StandardController controller) { }
public String getFood() { return 'OneExt'; } }
public class TwoExt {
public TwoExt(ApexPages.StandardController controller) {}
public String getFoo() { return 'TwoExt'; }
}
VF Code : <apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false"> <apex:outputText value="{!foo}"/> //This formula field will call second foo() i.e TwoExt </apex:page>
HI Vamshi, Based on your formula field {! } it will execute the corresponding extension. If both the extension having same method name then it will execute first extension. Below is the example
If both extension having same method, whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list will execute first.
Apex Code : public class ExtOne { public ExtOne(ApexPages.StandardController acon) { } public String getFoo() { return 'foo-One'; } }
public class ExtTwo { public ExtTwo(ApexPages.StandardController acon) { } public String getFoo() { return 'foo-Two'; } }
VF Code: <apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false"> <apex:outputText value="{!foo}"/> //This formula field will call first foo() i.e ExtOne </apex:page>
If both having different method then it will execute based on formula {! } which method you are calling
Apex Code : public class OneExt { public OneExt(ApexPages.StandardController controller) { }
public String getFood() { return 'OneExt'; } }
public class TwoExt {
public TwoExt(ApexPages.StandardController controller) {}
public String getFoo() { return 'TwoExt'; }
}
VF Code : <apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false"> <apex:outputText value="{!foo}"/> //This formula field will call second foo() i.e TwoExt </apex:page>
Based on your formula field {! } it will execute the corresponding extension. If both the extension having same method name then it will execute first extension. Below is the example
If both extension having same method, whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list will execute first.
Apex Code :
public class ExtOne {
public ExtOne(ApexPages.StandardController acon) { }
public String getFoo() {
return 'foo-One';
}
}
public class ExtTwo {
public ExtTwo(ApexPages.StandardController acon) { }
public String getFoo() {
return 'foo-Two';
}
}
VF Code:
<apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false">
<apex:outputText value="{!foo}"/> //This formula field will call first foo() i.e ExtOne
</apex:page>
If both having different method then it will execute based on formula {! } which method you are calling
Apex Code :
public class OneExt {
public OneExt(ApexPages.StandardController controller) { }
public String getFood() {
return 'OneExt';
}
}
public class TwoExt {
public TwoExt(ApexPages.StandardController controller) {}
public String getFoo() {
return 'TwoExt';
}
}
VF Code :
<apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false">
<apex:outputText value="{!foo}"/> //This formula field will call second foo() i.e TwoExt
</apex:page>
All Answers
Based on your formula field {! } it will execute the corresponding extension. If both the extension having same method name then it will execute first extension. Below is the example
If both extension having same method, whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list will execute first.
Apex Code :
public class ExtOne {
public ExtOne(ApexPages.StandardController acon) { }
public String getFoo() {
return 'foo-One';
}
}
public class ExtTwo {
public ExtTwo(ApexPages.StandardController acon) { }
public String getFoo() {
return 'foo-Two';
}
}
VF Code:
<apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false">
<apex:outputText value="{!foo}"/> //This formula field will call first foo() i.e ExtOne
</apex:page>
If both having different method then it will execute based on formula {! } which method you are calling
Apex Code :
public class OneExt {
public OneExt(ApexPages.StandardController controller) { }
public String getFood() {
return 'OneExt';
}
}
public class TwoExt {
public TwoExt(ApexPages.StandardController controller) {}
public String getFoo() {
return 'TwoExt';
}
}
VF Code :
<apex:page standardController="Account" extensions="ExtOne,ExtTwo" showHeader="false">
<apex:outputText value="{!foo}"/> //This formula field will call second foo() i.e TwoExt
</apex:page>