• aveforstudy1.3196212890020557E
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 9
    Replies

Hi,

I have 2 objects witha a parent child relationship. I have a after delete trigger on the child object.

Now i delete the parent object, all its related child records also gets deleted but after delete trigger on the child object does not get called.

I am not understanding why this is happening.

Any information on this would be very useful.

 

Thanks!

Hi,

i need to create the list view for the account object having the Accounts of the logged in users subordinates and these subordinates should be in the Account Team.

Eg Suppose there are 3 Accounts:A ,B & C. and users X,Y,Z are the users.

User X is in the Account Team of Account A & B and

User Y is in the Account Team of Account C only

User Z on the other hand is not on any accounts Account Team.

My sub ordinates is X user. So in this case the list view should show me only Account A and B. Account C should not be shown as none of the users present in the Account Team for account C are my sub ordinate.

 

Can i create a list view that will redirect me to an custom VF page having the Apex logic in place.

 

 

Hi,

I need an urgent help.

I am trying to write a query with a where clause on a formula field.

But in the debug logs the query is printed with out the where clause.

Because of this, the no of records are going beyon i Lakh.

Any help will he highly appreciated.

 

Thanks.

Hi,

I am facing a apostrophe issue in my Visual force page.

I have a custom page which has a Account field which is a lookup, when the user clicks on the magnifying glass my custom Visual force page is opened. Everything works fine, except the time when a particular account has a name with an apostrophe.

I have written a javascript function that closes the popup as soon as the account is selected, the selected accounts name gets added in the text field on my main page.But when an apostrope is found the javascript function does not get callled at all.I have tried many approaches but did not get to a solution.

If anyone has come accross this issue then please let me know what needs to be done.

Thanks in advance!

 

Hi,

I have a question regarding the Test coverage in Salesforce.

If i run a test class individually the code coverage of the class and its related Triggers is different for the code coverage that i do by clicking on the "run all test" button in Salesforce.

Can anyone tell me what percentage should i actually consider???

 

Thanks in advance.

 

Hi,

I am in need of some urgent help. I am using a Visual force Email template and i need to get some values in it by using a query therefore i have created a custom component and adding it in the email template. But i am getting an error "Error occurred trying to load the template for preview: Attempt to de-reference a null object. "  i Dont know what i am missing. Any help will be of great use here.

Follwing is the email template,custom component and its controller

 

Email Template

<messaging:emailTemplate subject="Account Budget Approval Request for {!relatedTo.Account__r.Name} - {!relatedTo.Year__c}" recipientType="User" relatedToType="Budget__c" >
<messaging:htmlEmailBody >
 <style>
        body{
            font-size: 12px;
            font-family: Arial;
        }
        div{
            font-family: arial;
            font-size: 12px;
            color: #000000;
        }
        .label{
            font-size: 12px;
            font-weight: bold;
            direction: rtl;
            padding-right: 10px;
            width: 120px;
            font-family: Arial;
        }
        .data{
            font-size: 12px;
            font-family: Arial;
        }
        
        .detailsheader{
            background-color: #E5ECF9;
            font-weight: bold;
            width: 90%;
            height: 20px;
            margin-top: 10px;
            margin-bottom: 10px;
            padding-top: 5px;
            padding-left: 5px;
            vertical-align: middle;
            font-family: Arial;
        }
            
    </style>

    <apex:outputPanel layout="block" style="font-family: Arial; margin-bottom: 20px;">
     Hi {!relatedTo.OwnerManagerName__r.Name} ,  
    </apex:outputPanel>
    <apex:outputPanel layout="block" style="font-family: Arial; margin-bottom: 20px;">
      Please review the following account budget and take necessary action.
    </apex:outputPanel>
    <apex:outputPanel layout="block" styleClass="detailsheader">
            Account Budget
    </apex:outputPanel>
    
    <apex:panelGrid columns="4" columnClasses="label,data" >
       <apex:outputLabel value="Budget Id"/>
        <c:SalesforceURL relativeurl="{!relatedTo.id}" displayname="{!relatedTo.Name}"/>
        <apex:outputLabel value="Total Budget"/>
        <apex:outputText value="{!relatedTo.Total_Budget__c}"/>
        <apex:outputLabel value="Account Name"/>
        <apex:outputText value="{!relatedTo.Account__r.Name}"/>
        <apex:outputLabel value="Account Manager"/>
        <apex:outputText value="{!relatedTo.Owner.Name}"/>
        <apex:outputLabel value="Year"/>
        <apex:outputText value="{!relatedTo.Year__c}"/>
         <apex:outputLabel value="Created Date"/>
        <apex:outputText value="{!relatedTo.CreatedDate}"/>
        <apex:outputLabel value="Sales Region"/>
        <apex:outputText value="{!relatedTo.SalesRegion__c}"/>
        <apex:outputLabel value="Last Action By"/>
        <apex:outputText value="{!relatedTo.LastModifiedBy.Name}"/>
        
    </apex:panelGrid>
    <apex:outputPanel layout="block" styleClass="detailsheader">
            Monthly Budget Information
    </apex:outputPanel>
    <c:MonthlyBudgetValues Budget_Id="{!relatedTo.id}"></c:MonthlyBudgetValues>
    <apex:outputPanel layout="block" style="font-style:italic; color: gray; margin-top: 20px; font-size:10px">
            This is a system generated email.
    </apex:outputPanel>
   
     
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

component

<apex:component controller="BudgetControllerForEmail" access="global">
<apex:attribute name="Budget_Id" type="String" description="Budget Id" assignTo="{!Budget}" access="global"/>
<apex:dataTable value="{!MonthlyBudgetValues}" var="MB">
             <apex:column headerValue="Station">
                        <apex:outputText value="{!MB.selectedStn}"/>
             </apex:column>
                    <apex:column headerValue="Jan">
                        <apex:outputText value="{!MB.Jan}"/>
                    </apex:column>
                    <apex:column headerValue="Feb">
                        <apex:outputText value="{!MB.Feb}"/>
                    </apex:column>
                    <apex:column headerValue="Mar">
                        <apex:outputText value="{!MB.Mar}"/>
                    </apex:column>
                    <apex:column headerValue="Apr">
                        <apex:outputText value="{!MB.Apr}"/>
                    </apex:column>
                    <apex:column headerValue="May">
                        <apex:outputText value="{!MB.May}" />
                    </apex:column>
                    <apex:column headerValue="Jun">
                        <apex:outputText value="{!MB.Jun}"/>
                    </apex:column>
                    <apex:column headerValue="Jul">
                        <apex:outputText value="{!MB.Jul}"/>
                    </apex:column>
                    <apex:column headerValue="Aug">
                        <apex:outputText value="{!MB.Aug}"/>
                    </apex:column>
                    <apex:column headerValue="Sept">
                        <apex:outputText value="{!MB.Sept}"/>
                    </apex:column>
                    <apex:column headerValue="Oct">
                        <apex:outputText value="{!MB.Oct}"/>
                    </apex:column>
                    <apex:column headerValue="Nov">
                        <apex:outputText value="{!MB.Nov}"/>
                    </apex:column>
                    <apex:column headerValue="Dec">
                        <apex:outputText value="{!MB.Dec}"/>
                    </apex:column>
                    </apex:dataTable>

                    
</apex:component>

 

controller

public without sharing class BudgetControllerForEmail {
    public String Budget{get;set;}
    
    private final List<budgetMonth> toDisplay;
    List<Monthly_Budget__c> ExistingMonthlyBudget = new List<Monthly_Budget__c>();
    public BudgetControllerForEmail() {
    System.debug('inside constructor');
    }
    public List<budgetMonth> getMonthlyBudgetValues(){
        //if(budget.Id!=null){
                System.debug('Budget @123'+Budget);
                ExistingMonthlyBudget =[Select m.Id,m.Name, m.Month__c, m.Budget__c, m.Budget_Amount__c,m.Budget__r.Account__c,m.Budget__r.Year__c,m.Budget__r.Name,m.Station__c,m.YMSA__c From Monthly_Budget__c m where m.Budget__c='a05K0000000b0Aj'];
                Set<String> uniqueBudgetName = new Set<String>();
                for(Monthly_Budget__c b:ExistingMonthlyBudget){
                budgetMonth mBudget = new budgetMonth();
                if(!uniqueBudgetName.contains(b.Station__c)){
                                uniqueBudgetName.add(b.Station__c);
                                mBudget.selectedStn = b.Station__c;
                                        for(Monthly_Budget__c budget:ExistingMonthlyBudget){
                                        if(budget.Station__c == mBudget.selectedStn){
                                        if(budget.Month__c=='Jan'){
                                                        mBudget.Jan = (Integer)budget.Budget_Amount__c;
                                                mBudget.YMSAJan = budget.YMSA__c;
                                        }
                                                if(budget.Month__c=='Feb'){
                                                        mBudget.Feb = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAFeb = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Mar'){
                                                        mBudget.Mar = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAMar = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Apr'){
                                                        mBudget.Apr = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAApr = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='May'){
                                                        mBudget.May = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAMay = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Jun'){
                                                        mBudget.Jun = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAJun = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Jul'){
                                                        mBudget.Jul = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAJul = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Aug'){
                                                        mBudget.Aug = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAAug = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Sept'){
                                                        mBudget.Sept = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSASept = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Oct'){
                                                        mBudget.Oct = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSAOct = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Nov'){
                                                        mBudget.Nov = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSANov = budget.YMSA__c;
                                                }
                                                if(budget.Month__c=='Dec'){
                                                        mBudget.Dec = (Integer)budget.Budget_Amount__c;
                                                        mBudget.YMSADec = budget.YMSA__c;
                                                }       
                                }       
                        }
                        toDisplay.add(mBudget);
                }
            }       
       // }
        return toDisplay;
    }
public class budgetMonth{
    Public String budgetId{get;set;}
    Public String monthlyBudgetId{get;set;}
    Public String YMSAJan{get;set;}
    Public String YMSAFeb{get;set;}
    Public String YMSAMar{get;set;}
    Public String YMSAApr{get;set;}
    Public String YMSAMay{get;set;}
    Public String YMSAJun{get;set;}
    Public String YMSAJul{get;set;}
    Public String YMSAAug{get;set;}
    Public String YMSASept{get;set;}
    Public String YMSAOct{get;set;}
    Public String YMSANov{get;set;}
    Public String YMSADec{get;set;}
    Public String Year{get;set;}
    Public Integer Jan{get;set;}
    Public Integer Feb{get;set;}
    Public Integer Mar{get;set;}
    Public Integer Apr{get;set;}
    Public Integer May{get;set;}
    Public Integer Jun{get;set;}
    Public Integer Jul{get;set;}
    Public Integer Aug{get;set;}
    Public Integer Sept{get;set;}
    Public Integer Oct{get;set;}
    Public Integer Nov{get;set;}
    Public Integer Dec{get;set;}
    Public String selectedStn{get;set;}
    Public String disabledField{get;set;}
}
}

 

 

Thanks

Hi,

I am in need of an urgent help. I want to disable a input text based on the selcted value from a drop down.

I am able to achieve it by using actionSupport on the change event of the dropdown, but it does not work when i want to make the disabled field back to enabled. Surprisingly the actionSupport's action does not get called.

Any help would be appreciated.

 

hi,

i have a pageBlocktable which contains some of the custom fields of  my standard controller, it also contains a pick list which calculates the current year, pervious year and next year.

I need to have a link called "add row" once the user clicks on this link a new row gets added in the table. Everything works fine but the value in the select list (having the year values)  gets refreshed and does not show the selected value.

Has anyone come across this issue.

Any help will be appreciated.

Hi,

I am in need of an urgent help. I want to disable a input text based on the selcted value from a drop down.

I am able to achieve it by using actionSupport on the change event of the dropdown, but it does not work when i want to make the disabled field back to enabled. Surprisingly the actionSupport's action does not get called.

Any help would be appreciated.

 

Hi,

I have 2 objects witha a parent child relationship. I have a after delete trigger on the child object.

Now i delete the parent object, all its related child records also gets deleted but after delete trigger on the child object does not get called.

I am not understanding why this is happening.

Any information on this would be very useful.

 

Thanks!

Hi,

I need an urgent help.

I am trying to write a query with a where clause on a formula field.

But in the debug logs the query is printed with out the where clause.

Because of this, the no of records are going beyon i Lakh.

Any help will he highly appreciated.

 

Thanks.

Hi,

I am facing a apostrophe issue in my Visual force page.

I have a custom page which has a Account field which is a lookup, when the user clicks on the magnifying glass my custom Visual force page is opened. Everything works fine, except the time when a particular account has a name with an apostrophe.

I have written a javascript function that closes the popup as soon as the account is selected, the selected accounts name gets added in the text field on my main page.But when an apostrope is found the javascript function does not get callled at all.I have tried many approaches but did not get to a solution.

If anyone has come accross this issue then please let me know what needs to be done.

Thanks in advance!

 

Hi,

I am in need of an urgent help. I want to disable a input text based on the selcted value from a drop down.

I am able to achieve it by using actionSupport on the change event of the dropdown, but it does not work when i want to make the disabled field back to enabled. Surprisingly the actionSupport's action does not get called.

Any help would be appreciated.

 

hi,

i have a pageBlocktable which contains some of the custom fields of  my standard controller, it also contains a pick list which calculates the current year, pervious year and next year.

I need to have a link called "add row" once the user clicks on this link a new row gets added in the table. Everything works fine but the value in the select list (having the year values)  gets refreshed and does not show the selected value.

Has anyone come across this issue.

Any help will be appreciated.