You need to sign in to do that
Don't have an account?
Satish Singh 14
Opportunity in the account reated list
I want to show my all Opportunity in the account reated list with following condition with it -
1. Stage Name should be Closed won and Close Date in future .
2. List shows the Opportunity Name, Closed Date , Stage Name and Amount.
Thaks in aadvance.
1. Stage Name should be Closed won and Close Date in future .
2. List shows the Opportunity Name, Closed Date , Stage Name and Amount.
Thaks in aadvance.
Hi Satish,
you can use this code and procedure.
Controller :
public class getOppertunityClosedWon {
public List <Opportunity> CloseWonOppList {get;set;}
public getOppertunityClosedWon(ApexPages.StandardController controller) {
Date todayDate =Date.today();
String AccId = ApexPages.currentPage().getParameters().get('id');
CloseWonOppList = [select id , Name,Type,Amount,StageName,CloseDate from Opportunity where AccountId =:AccId and StageName ='Closed Won' AND CloseDate >:todayDate limit 50];
}
}
Visualforce page -
<apex:page extensions="getOppertunityClosedWon" standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="All Prospecting Opportunity" collapsible="true" columns="1">
<apex:pageBlockTable value="{!CloseWonOppList}" var="op">
<apex:column value="{!op.Name}" />
<apex:column value="{!op.CloseDate}"/>
<apex:column value="{!op.StageName}"/>
<apex:column value="{!op.Type}" />
<apex:column value="{!op.Amount}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
After writing above code do the following :
1 Go to edit layout on account detail page
2. Select a section and drag down where you want to place it.
3. Goto visualforce page and drag within the section you just added.
4.Now Save the layout and your related list of opportunity will shown just below of the account details page.
Hope This this will help you .
If this answers your query please mark this question as a solved so that it can be filtered out from unsolved questions.
Regards
Akshay
All Answers
- To populate account related list on the opportunity May I suggest you please refer the below link for reference.
- https://success.salesforce.com/answers?id=90630000000grL4AAI
Hope it will be helpful.Thanks
Rahul Kumar
Follow these steps:
Create lookup relationship from Opp relate object to Account like below.
Create new process builder with following the same. ( its helps to move update the record with stage equal to "closed Won").
Process Builder :
Criteria Section:
ImmediateAction:
Finally activate your process builder. and do the testing.
Hope this will help to achive your goal.
Thanks
karthik
Hi Satish,
you can use this code and procedure.
Controller :
public class getOppertunityClosedWon {
public List <Opportunity> CloseWonOppList {get;set;}
public getOppertunityClosedWon(ApexPages.StandardController controller) {
Date todayDate =Date.today();
String AccId = ApexPages.currentPage().getParameters().get('id');
CloseWonOppList = [select id , Name,Type,Amount,StageName,CloseDate from Opportunity where AccountId =:AccId and StageName ='Closed Won' AND CloseDate >:todayDate limit 50];
}
}
Visualforce page -
<apex:page extensions="getOppertunityClosedWon" standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="All Prospecting Opportunity" collapsible="true" columns="1">
<apex:pageBlockTable value="{!CloseWonOppList}" var="op">
<apex:column value="{!op.Name}" />
<apex:column value="{!op.CloseDate}"/>
<apex:column value="{!op.StageName}"/>
<apex:column value="{!op.Type}" />
<apex:column value="{!op.Amount}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
After writing above code do the following :
1 Go to edit layout on account detail page
2. Select a section and drag down where you want to place it.
3. Goto visualforce page and drag within the section you just added.
4.Now Save the layout and your related list of opportunity will shown just below of the account details page.
Hope This this will help you .
If this answers your query please mark this question as a solved so that it can be filtered out from unsolved questions.
Regards
Akshay
Hey Thank you Akshay.
Thanks for selecting my answer as a best. It's my pleasure to help you!
Regards,
Akshay