• Naveen saini 10
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies
Hi,

I am using two apex pie chart and I am rerendering the output panel using action polar. After a single refresh, the pie chart automatically vanish away.
I am getting this error in console - SfdcCore.js:386 Visualforce Chart: Error loading configuration for chart 'xjid0jid23': TypeError: Cannot read property 'dom' of null.
<apex:outputPanel id = "main">
	<apex:outputPanel rendered="{!IF(Type2 == 'test' && Type1 =='test2',true,false)}">
			<div style="text-align:center; height:115px;float:left;position: relative;top: 10px;}">
				<apex:chart height="115" width="115" data="{!pieData}" animate="false" colorSet="{!IF((widthInterval >= 90 && widthInterval < 100) ,'Yellow,#F8F8F8',if(widthInterval < 90, '#009933,#F8F8F8', 'Red,#F8F8F8'))}" > 
					<apex:pieSeries dataField="data" highlight="false" showInLegend="false" tips="false" donut="85" /> 
				</apex:chart>
				<div> 
					<div style="font-size: 20px;left: 5px;"><b style="position:relative;bottom: 68px;left: 5px;"> {!widthInterval}% </b></div>
					<apex:outputPanel rendered="{!widthInterval < 100}">
					 <div style="position: relative;top: -26px;">
						<div style="position: relative;bottom: 135px;font-size: 15px;"><b> {!test}</b></div>
						<div style="text-align:center;margin-top: -12px;"><b>Target-{!test2} </b></div>
					  </div>
					</apex:outputPanel>        
		<apex:outputPanel
		
		<apex:outputPanel rendered="{!IF(Type2 == 'test' && Type1 =='test2',true,false)}">
			<div style="text-align:center; height:115px;float:left;position: relative;top: 10px;}">
				<apex:chart height="115" width="115" data="{!pieData2}" animate="false" colorSet="{!IF((widthInterval >= 90 && widthInterval < 100) ,'Yellow,#F8F8F8',if(widthInterval < 90, '#009933,#F8F8F8', 'Red,#F8F8F8'))}" > 
					<apex:pieSeries dataField="data" highlight="false" showInLegend="false" tips="false" donut="85" /> 
				</apex:chart>
				<div> 
					<div style="font-size: 20px;left: 5px;"><b style="position:relative;bottom: 68px;left: 5px;"> {!widthInterval2}% </b></div>
					<apex:outputPanel rendered="{!widthInterval2 < 100}">
					 <div style="position: relative;top: -26px;">
						<div style="position: relative;bottom: 135px;font-size: 15px;"><b> {!test}</b></div>
						<div style="text-align:center;margin-top: -12px;"><b>Target-{!test2} </b></div>
					  </div>
					</apex:outputPanel>        
		<apex:outputPanel
		
		 <apex:outputPanel>
            <apex:actionPoller action="{!CallMethod}" reRender="main" interval="5"/>
         </apex:outputPanel>
	
</apex:outputPanel>

 
Hi guys.. I am unable to add case team member in my VF page.

Actually i don't any apex related list to display case teams so i made a custom case team. The problem is when I select a predefined case team then it will add that team and display all the team member of that selected predefined team instead of just team name.

Please help me out.
 
<apex:pageblock title="Case Team">
                <apex:pageBlockButtons >
                        <apex:commandButton value="Update Case Team Members" onclick="updateTeamMember() ; return false ;"/>
                    </apex:pageBlockButtons>
                    <apex:pageBlockTable value="{!caseTeamMap}" var="csTeam" >
                        <apex:column headerValue="Action">
                        <apex:actionRegion >
                        <apex:commandLink action="{!removeMember}"  onclick="if(!confirm('Are you sure?')) return false;" value="Remove" reRender="theForm1">
                            <apex:param name="MemberToRemove" value="{!caseTeamMap[csTeam].Id}" assignTo="{!memberId}"/>
                        </apex:commandLink>
                        </apex:actionRegion>
                        </apex:column>
                        <apex:column headerValue="Team Member" value="{!caseTeamMap[csTeam].MemberId}"/>
                        <apex:column headerValue="Role" value="{!caseTeamMap[csTeam].TeamRoleId}"/>
                        <apex:column headerValue="Case Access" value="{!caseTeamMap[csTeam].TeamRole.AccessLevel}"/>
                        <apex:column headerValue="Visible In Customer Portal" value="{!caseTeamMap[csTeam].TeamRole.PreferencesVisibleInCSP}"/>
                        <apex:column headerValue="Modified By" value="{!caseTeamMap[csTeam].LastmodifiedbyId}"/>
                    </apex:pageBlockTable>
               </apex:pageblock>

 
This is my code on custom button
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';


caseObj.OwnerId = '{!$User.Id}';

var result = sforce.connection.update([caseObj]);

if(!result[0].getBoolean("success")){
alert('Case owner can NOT be changed');
}
window.location.reload();

How can i show standard validation error instead of alert??
Hi guys.. I want to integrate facebook on salesforce.i want to know the process regarding this.
I want to fetch some data regaring the user..
pls tell me what things are required as i am using REST api.
 
i want to populate count field in opportunity.such that if account has 5 oppoptunites then all 5 opportunities has 5(integer) value on them..
below is my code.
trigger OpportunityCountTrigger on Opportunity (after insert,after update) {
    
     List<Opportunity> opptyList= new List<Opportunity>(); 
     Map<id,Account> acctlist= new Map<id,Account>([select id,(select id ,Opp_Count__c from opportunities) from account]);
     List<AggregateResult> count = [SELECT count(account.id),accountid FROM Opportunity WHERE accountid != null group by accountid];     
     if(Trigger.isinsert)
     {
        for(Opportunity op : Trigger.New)
       {
           Opportunity o = new Opportunity(id=op.Id);
           o.Opp_Count__c = acctlist.get(op.accountid).opportunities.size();
           opptyList.add(o);
           
           system.debug('isinsert running');
        }
        List<Opportunity> oppList = [select Opp_Count__c from Opportunity where accountid in : acctlist.id ];
        for(Opportunity optyy : oppList)
        {
            optyy.Opp_Count__c = acctlist.get(optyy.accountid).opportunities.size();
        }
         
     }
     if(Trigger.isupdate)
    {
        for(Opportunity opp: Trigger.Old)
        {
                   opp.Opp_Count__c = acctlist.get(opp.accountid).opportunities.size();
                   opptyList.add(opp);
                   system.debug('isupdate running');
        }
    }
       
    if(!opptyList.isEmpty())
    {
        upsert opptyList; 
    }
    
}

 
Hi,
I am newbie in salesforce and wnt to know about  warpper class..
I am making lightning component and i want to wrap my three functions into one wrapper class.

Here is my Code
public with sharing class TestCategoryClass {

    @AuraEnabled
    public static List<String> getIdeaCategories(){
        
        List<String> categorySelectOptionList = new List<String>();
        categorySelectOptionList.add('All');
            for (Schema.PicklistEntry f : Idea.Categories.getDescribe().getPicklistValues()) {
                categorySelectOptionList.add(f.getvalue());
            }
        return categorySelectOptionList;
    }
    
     @AuraEnabled
     public static List<idea> getData(String item)
    {
        if(item!='All')
        {
        	return[select Body,Title,Status,VoteTotal,NumComments,Categories from idea where Categories=:item ];
        }
        
       else
        {
              return[select Body,Title,Status,VoteTotal,NumComments,Categories from idea ];        
        }
    }
     
	  @AuraEnabled
     public static List<idea> getStatus(String Status)
    {
        if(item!='None')
        {
        	return[select Body,Title,Status,VoteTotal,NumComments,Categories from idea where status=:status ];
        }
        
       else
        {
              return[select Body,Title,Status,VoteTotal,NumComments,Categories from idea ];        
        }
    }
}
I want this to include in wrapper and finally return that wrapper from this class
 
@isTest(seeAllData = true)
public class OpportunityAddOnTest 
{
    public static TestMethod void MyTest()
    {
        List<Opportunity> OpportunityList = new List<Opportunity>();
        
        Opportunity Opp1 = new Opportunity();
        opp1.Name = 'opportnity_one';
        opp1.CloseDate = date.today()-15;
        opp1.StageName= 'closed won';
        insert opp1;
 
        Opportunity Opp = new Opportunity();
        opp.Name = 'opportnity_one';
        opp.CloseDate = date.today()-15;
        opp.StageName= 'closed won';
        opp.Opportunity__c = opp1.id;
        insert opp;
      
        OpportunityList.add(opp);
        
    }

}
this is my test class

 
trigger OpportunityAddOn on Opportunity (after insert,after update)
{
    if(!test1.IsOpptyUpdate)
    {
        test1.IsOpptyUpdate = true;
    
        List<Opportunity> updateList = new List<Opportunity>();
     
            set<id> oppId=new set<id>();
         
            for(Opportunity opp:trigger.new)
            {
                if(opp.Opportunity__c !=null)
                {
                    oppId.add(opp.Opportunity__c);
                    System.debug('parent id is-->' +opp.Opportunity__c);
                }
                
            }
         
     for(Opportunity partopp : [select id,Add_On_ARR__c,(select id,Opportunity_ARR__c from opportunities__r) from Opportunity where id in:oppId]){
      Double countval = 0;
      if(partopp.opportunities__r.Size() > 0)
      { 
      
       for(Opportunity child_op : partopp.opportunities__r)
       {
           
           if(child_op.Opportunity_ARR__c != NULL ) {
         
            countval = child_op.Opportunity_ARR__c + countval ;
           
           }
          
       } 
         if(countval > 0)
          {
            partopp.Add_On_ARR__c =countval ;
            updateList.add(partopp);
            
          }
       }
     
     }
     if(!updateList.isEmpty())
     {
         update updateList;
     }
    }
}

this is my trigger..
 
Hi guys.. I want to integrate facebook on salesforce.i want to know the process regarding this.
I want to fetch some data regaring the user..
pls tell me what things are required as i am using REST api.
 
This is my code on custom button
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';


caseObj.OwnerId = '{!$User.Id}';

var result = sforce.connection.update([caseObj]);

if(!result[0].getBoolean("success")){
alert('Case owner can NOT be changed');
}
window.location.reload();

How can i show standard validation error instead of alert??
Hi guys.. I want to integrate facebook on salesforce.i want to know the process regarding this.
I want to fetch some data regaring the user..
pls tell me what things are required as i am using REST api.
 
@isTest(seeAllData = true)
public class OpportunityAddOnTest 
{
    public static TestMethod void MyTest()
    {
        List<Opportunity> OpportunityList = new List<Opportunity>();
        
        Opportunity Opp1 = new Opportunity();
        opp1.Name = 'opportnity_one';
        opp1.CloseDate = date.today()-15;
        opp1.StageName= 'closed won';
        insert opp1;
 
        Opportunity Opp = new Opportunity();
        opp.Name = 'opportnity_one';
        opp.CloseDate = date.today()-15;
        opp.StageName= 'closed won';
        opp.Opportunity__c = opp1.id;
        insert opp;
      
        OpportunityList.add(opp);
        
    }

}
this is my test class

 
trigger OpportunityAddOn on Opportunity (after insert,after update)
{
    if(!test1.IsOpptyUpdate)
    {
        test1.IsOpptyUpdate = true;
    
        List<Opportunity> updateList = new List<Opportunity>();
     
            set<id> oppId=new set<id>();
         
            for(Opportunity opp:trigger.new)
            {
                if(opp.Opportunity__c !=null)
                {
                    oppId.add(opp.Opportunity__c);
                    System.debug('parent id is-->' +opp.Opportunity__c);
                }
                
            }
         
     for(Opportunity partopp : [select id,Add_On_ARR__c,(select id,Opportunity_ARR__c from opportunities__r) from Opportunity where id in:oppId]){
      Double countval = 0;
      if(partopp.opportunities__r.Size() > 0)
      { 
      
       for(Opportunity child_op : partopp.opportunities__r)
       {
           
           if(child_op.Opportunity_ARR__c != NULL ) {
         
            countval = child_op.Opportunity_ARR__c + countval ;
           
           }
          
       } 
         if(countval > 0)
          {
            partopp.Add_On_ARR__c =countval ;
            updateList.add(partopp);
            
          }
       }
     
     }
     if(!updateList.isEmpty())
     {
         update updateList;
     }
    }
}

this is my trigger..