• vishwa attikeri
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 16
    Replies


I am using JSON.deserialize() to parsing the json string of chatter API.


It's given error only for "cs7" server. I tested "cs8" and "ap1" it's working fine.

 

Is there any issue with "cs7". I am not understand what's going wrong with "cs7" server.

 

Thanks 

 

Hi,

i have a 4 apex:tab and in 3 apex:tab i have inputfield to insert the data and in last tab i need to display what data i have selected without insert,
i think it is possible only by onclick function, can any one help me how can i achiev this

<apex:tabpanel >
<apex:tab name="tab1">
<apex:inputfield value="{!object.field1}">
<apex:inputfield value="{!object.field2}">
</apex:tab>

<apex:tab name="tab2">
<apex:inputfield value="{!object.field3}">
<apex:inputfield value="{!object.field4}">
</apex:tab>

<apex:tab name="tab3">
<apex:inputfield value="{!object.field5}">
<apex:inputfield value="{!object.field6}">
</apex:tab>

<apex:tab name="tab4">
<apex:outputfield value="{!object.field1}">
<apex:outputfield value="{!object.field2}">
<apex:outputfield value="{!object.field3}">
<apex:outputfield value="{!object.field4}">
<apex:outputfield value="{!object.field5}">
<apex:outputfield value="{!object.field6}">

</apex:tab>
</apex:tabpanel >

 

 Thank you

In apex:tab i have next button to move to next tab but it workds only when disabled="true" how can i use this for disabled="false"

 

here is my code:

<apex:tabPanel id="tabPanel" selectedTab="{!selectedTab}" tabClass="tabClass" immediate="true">
<apex:tab label="First tab" id="tab1" style="font-size:13px;">
<apex:commandButton value="Next Step" action="{!enabletab2}" rerender="tabPanel" styleclass="button"  immediate="true"/>
</apex:tab>
<apex:tab label="First tab" id="tab2 style="font-size:13px;">
<apex:commandButton value="Next Step" action="{!enabletab2}" rerender="tabPanel" styleclass="button" immediate="true"/>
</apex:tab>
<apex:tab label="First tab" id="tab3" style="font-size:13px;">
<apex:commandButton value="Next Step" action="{!enabletab2}" rerender="tabPanel" styleclass="button" immediate="true"/>
</apex:tab>
</apex:tabpanel>
 

 

 public void enabletab2() {  selectedtab = 'tab2';}
    public void enabletab3() {  selectedtab = 'tab3'; }
    public void enabletab4() {  selectedtab = 'tab4'; }
     public void enabletab5() {  selectedtab = 'tab5';}

 

how can i solve this 

 

 

 

 

Hi, i have a formula field as " IMAGE( Recipient_Image_URL__c , 'Recipient Image') " which i am using to display the Image and " Recipient_Image_URL__c" field is contains user fullphotoURL 

here i need to display the image in Email temple, it works fine for SFDC user but it will not display on out side SFDC user

 

how can i solve this issue 

 

 

Thanks 

 

 

Hi,

I need help on Rendered functions, may be i am wrong with below code.

can any one please help me on this 

 

i have a variable 'total' that contains some integer value this total will change depending on picklist by 'apex:actionsupport'.

here i have one button which will disable and enable with condition for

Ex: if total=50  enable the button 

if total!=50 disable button

here is my code

<apex:form >
<table class="list" >
<tr>
	<td><b>field one</b></td>
	
    <td><apex:selectList value="{!licens}"  size="1">
				<apex:selectOptions value="{!Licenses}"/>
				<apex:actionSupport event="onchange" action="{!test}" reRender="lcnc,totl,counter" />
		</apex:selectList></td>
	
	<td><apex:outputtext id="lcnc" value="{!licenses_Customer_have_Value}"/></td>
</tr>

<tr>
	<td><b>other Reason</b> </td>
	
	<td> <apex:selectList value="{!Reason}"  size="1">
			<apex:selectOptions value="{!Reasons}"/>
			<apex:actionSupport event="onchange" action="{!test}" reRender="Add,totl,counter" />
		</apex:selectList></td>
	
	<td> <apex:outputtext id="Add" value="{!other_Reason_Value}"/></td>
</tr>
                        
<tr>
	<td align="right"><b>Total</b> </td>
	
	<td > &nbsp;</td>
	
	<td > <apex:Outputtext id="totl" value="{!Total}"/>	</td>
</tr>
</table>

<apex:outputpanel id="counter" rendered="{!Total > 85}">
	<apex:commandbutton action="{!Updatecase}" value="Update"  />
</apex:outputpanel>
 </apex:form>

 

 

 

Hi,

 

i want to update some case fields when Event 'start date' equals to today() 

 

how can i achieve this, please any one can help on this 

Hi,

 

any one can help on the below  issue,

 

i want to update the case field using work flow when  email is sent 

 

my condition is it should check if 

1) Toaddress does not contains @gmail.com (if the To address will have one email address Ex:   test@gmail.com)

Update case field

 

OR

 

2) Toaddress contains @gmail.com and doesnot contains @gmail.com(if To addres contain more than one email address  Ex: test@gmail.com ,test@yahoo.com)

update case field

 

 

Hi,

 

How to compare new value and old value in apex controller 

Hi, 

 

Need help on below Issue,

 

How to display multiselect picklist value one by one instead of semicomma (;)

 

for example;

 

Item1;item2;item3;item4;item5  instead of this i need 

 

Item1

item2

item3

item4

item5  

 

is it poosible...?,

and i am using standard controller in visualforce page

Hi,

 

i have .txt file and images files can we download the file in our system  instead of open in new window ?

 

Thanks

 

 

Hi,

 

How to display Controller Error message in standard page layout 

for ex :

if(mapdata.get(cc.id) == Null || mapdata.get(cc.id) == 0)
{
 cc.field__c.addError('Error message here');
}

 

i know it can be possible by trigger but i want it from controller please any one can help 

 

Thanks

Hi 

please help me to solve this below issue

 

 i have some atachments that i have to download, its working fine but i am not able to download .txt files and Images, instead of downloading it displaying only, please help 

 

controller 

 public List<String> GetSelectedAttachments()
    {   
        attLinks.clear();
        if(selectedAttachments.size()>0)
        {
            integer j = selectedAttachments.size();
            String strURL;
            for(integer i=0; i<j; i++)
            {            
                     strURL= 'https://' + ApexPages.currentPage().getHeaders().get('Host') 
                + '/servlet/servlet.FileDownload?file='  + selectedAttachments[i].Id;
                
                 //strURL  = '/servlet/servlet.FileDownload?file='+selectedAttachments[i].Id; 
                attLinks.add(strURL);
                 System.debug('$$$$$$$$$'+attLinks);
            }
            System.debug('&&&&&&&&&&'+attLinks.size());
            return attLinks;
        }
        else
        {
            return null;
        }
    } 

 Visualforce page

<apex:outputPanel id="testin" rendered="{!b}">
<script>
var s='{!SelectedAttachments}';

var myCars=new Array();

var ss=s.substr(1, s.length-2); 

myCars=ss.split(",");

for(var i=0; i< myCars.length; i++)
{

window.open(myCars[i]);
}


</script>
</apex:outputpanel>

 

Thank you

 

Hi,

Can we use PageReference inside for loop,

 

i am trying to pass the id using for loop but it gives error  as Too many script statments 200001

This is my code

public pageReference downloaddata()
	{
	 Pagereference pp;
			
	 integer j = selectedAttachments.size();
	
	 for(Integer i=0; i<=j; j++)
	{
	  pp=new Pagereference('/servlet/servlet.FileDownload?file='+selectedAttachments[i].id);
	 pp.setRedirect(true);
	 //return pp;
	 }
	 return pp;
	}

 

<apex:commandbutton action="{!downloaddata}" value="Download" />

 

Here im trying to download the attachment files that is more than one file

 

please help me how to solve this issue

how i can achieve this

 

 

 

Hi,

Please help me out from this issue,

 

I have to download more then one attachment by single button click .

 

Please any on can share some code sample

 

This is my code :

public List<String> GetSelectedAttachments()
    {
        if(selectedAttachments.size()>0)
		{
			integer j = selectedAttachments.size();
			String strURL;
			for(integer i=0; i<j; i++)
			{                      
				 strURL  = '/servlet/servlet.FileDownload?file='  + selectedAttachments[i].Id; 
				attLinks.add(strURL);
			}
			System.debug('&&&&&&&&&&'+attLinks.size());
			return attLinks;
        }
        else
			{
				return null;
			}
    }
<apex:repeat value="{!SelectedAttachments}" var="s">


<a href="somedoc.html" target="newWindow" onclick="window.open('{!s}', this.target); return false">click here</a>

</apex:repeat>

 

 

Thanks 

 

Please any one help me on this issue,

how to cover the code inside the if condition in test class

public class Pocinsert
{

public List<Plan_of_Care__c> mplan {get; set;}  
 public Pocinsert(){
 mplan = new List<Plan_of_Care__c>();
 makeAvailabilityWindow();
}
  
public String Employee='';

public String getEmployee()
{
return Employee;
}
public void setEmployee(String Employee)
{
this.Employee=Employee;
}

public List<SelectOption> getEmployees()
{
List<SelectOption> option=new List<SelectOption>();
option.add(new SelectOption('', '- None -')); 
for(Employee__c e:[select id,name,lastname__c from Employee__c order by name ASC])
{

option.add(new SelectOption(e.id,e.lastname__c+'-'+e.name));
}
return option;
}

String Client ='';
public String getclient()
{
return client;
}
public void setclient(String Client)
{
this.client=client;
}

public List<SelectOption> getClients()
{
List<SelectOption> option= new List<SelectOption>();
option.add(new SelectOption('', '- None -')); 
for(Client__c c:[select id,name,lastname__c from Client__c where Employee__c =: Employee order by name ASC])
{
option.add(new selectoption(c.id,c.lastname__c+'-'+c.name));
}
return option;
}
  
public void makeAvailabilityWindow()
{
 numberDays = date.daysInMonth(Integer.valueof(selectedYears), Integer.valueof(selectedMonths));
 for(Integer i=1; i<=numberDays; i++){
 day_L.add(String.valueof(i));
 }
   
   for(Integer j=1; j<=numberDays; j++){
    mplan.add(new Plan_of_Care__c());
                 }
     }
                
  public PageReference savem(){ 
  Integer count = mplan.size();
  Integer i = 0; 
  if(Client!=null && Employee!=null)
   {          
      do {
             Integer d = i+1;
            if(mplan[i].Tub_Bath_Shower__c <> 'XX' && mplan[i].Tub_Bath_Shower__c <> null)
             {               
                  mplan[i].Tub_Bath_Shower__c.addError('Input Field value must be XX');
                  PageReference opptyPage = new PageReference('/apex/InsertPOC');
                  return opptyPage; 
              }

          if(mplan[i].Tub_Showertransfer_Position__c <> 'XX' && mplan[i].Tub_Showertransfer_Position__c <> null)
            {
                mplan[i].Tub_Showertransfer_Position__c.addError('Input Field value must be XX');
                PageReference opptyPage = new PageReference('/apex/InsertPOC');
                return opptyPage;
             }      
          if(mplan[i].Bed_Bath__c <> 'XX' && mplan[i].Bed_Bath__c <> null)
             {               
                  mplan[i].Bed_Bath__c.addError('Input Field value must be XX');
                  PageReference opptyPage = new PageReference('/apex/InsertPOC');
                  return opptyPage; 
              }

           
        mplan[i].Client__c=client;
        mplan[i].Employee__c=Employee;      
        mplan[i].date__c=date.newInstance(Integer.valueof(selectedYears),Integer.valueof(selectedMonths),d);
              
               
                i++;
                d=0;
                } while (i < count);
           }              
           upsert mplan;                          
                                
            PageReference home = new PageReference('/apex/InsertPOC');        
            home.setRedirect(true);        
            return home;                    
            }
			}

 

 

Hi 

 

Please can anybody  tell, is it possible to take wrapper class method in main class, if yes please tel how it will do

 

and please see this code it is used to display the total for perticular date, 

how can i calculate total of toal for a month

public with sharing class Finalpaymonth {

Public  String amount{get;set;}
public PageReference searchAction(){
            prepareMap();   
        return null;
    }
 List<Wrappertimecard> wraptimelist = new List<Wrappertimecard>();
 public void prepareMap(){
 Integer t1=0;Integer t2=0;Integer t3=0    
 Integer total=0;
 
 wraptimelist = new List<Wrappertimecard>();

 List<Time_Card__c> empList = [select 
Ambulation_walk_room_to_room__c,Assist_getting_returning_equipment__c,Assist_with_binders__c 
from Time_Card__c where Month__c=:month order by date__c ASC];
        
        for(Time_Card__c emp: empList){
                   
if(emp.Ambulation_walk_room_to_room__c!=null && emp.Ambulation_walk_room_to_room__c!='XX' && emp.Ambulation_walk_room_to_room__c!='X')
{t1=Integer.valueof(emp.Ambulation_walk_room_to_room__c);}  else{t1=0;}
        
if(emp.Assist_getting_returning_equipment__c!=null && emp.Assist_getting_returning_equipment__c!='XX' &&  emp.Assist_getting_returning_equipment__c!='X')
{t2=Integer.valueof(emp.Assist_getting_returning_equipment__c);} else{t2=0;}
        
if(emp.Assist_with_binders__c!=null && emp.Assist_with_binders__c!='XX' && emp.Assist_with_binders__c!='X')
{t3=Integer.valueof(emp.Assist_with_binders__c);}   else{t3=0;}
        
        total=t1+t2+t3;
     
 wraptimelist.add(new Wrappertimecard(emp.Days__c,emp.day__c,amount,total));
          
		 
        }
              
    } 
 
    public List<Wrappertimecard> getWrapSummaryList(){
        return wraptimelist;
    }
  
//wrapper class    
    public class Wrappertimecard{
    public String perunitamount{get;set;}   
    public String tdate{get;set;}
    Public String days{get;set;}
    public Integer total1 {get;set;}
              
     public Integer getTotal(){
      return total1;
     }     
     public Wrappertimecard(String dat,String day,String prunitamt,Integer t1){
     tdate = dat;
     Days=day;
     perunitamount=prunitamt;
     total1 = t1;
     }
  }
}

 

 

Thanks

 

hi,

I am using wrapper class to display the date in vf but here it works fine but i need to display in ascending order 

can any one please help 

here is my code sample

Public lass finalpay()
{
   public void prepareMap()
   {
        salesPerformanceData = new Map<Date, FRSummaryWrap>();
        List<Time_Card__c> empList = [select name,day__c,date__c,days__c from Time_Card__c where Month__c=:month and Employee__r.name=:emp and Year__c=:year order by date__c ASC];
        for(Time_Card__c emp: empList){
               
            salesPerformanceData.put(emp.Date__c,new FRSummaryWrap(emp.Date__c,amount));
        }
		}
		
		 public List<FRSummaryWrap> getWrapSummaryList(){
        return salesPerformanceData.values();
    }
	
	   
    public class FRSummaryWrap{
    
       public Date tdate{get;set;}
	   
	    public FRSummaryWrap(Date dat,String prunitamt){
             
            tdate = dat;
           }
                    
        }
        }

 Here is my VF page

 <apex:repeat value="{!wrapSummaryList}" var="Wrp">
 
 <tr border="1"> 
 <td  Style="font-family: Arial; font-size: 10pt; font-weight: bold;">{!Wrp.tdate}</td>
</tr>  
 </apex:repeat> 

 

hi,

 

Please any one help me on this issue

I have a wrapper class and passing the values from main class and i am not able to write a test class for Wrapper class  please any one help me 

 

Main class Code sample

 

   public  List<CustForecastWrapper> custForecasts = null;
    public List<CustForecastWrapper> getCustForecasts(){
  
        New_Forecast__c CustFCst=new New_Forecast__c();
        
        CustFCst=[select id,name from new_forecast__c where Region__r.sales_Rep__c=:usr.id limit 1];
        
        List<Product2> ProdLst=new List<Product2>();
        Map<Id,List<Forecast_sku__c>> CustForcstMap = new Map<Id,List<Forecast_sku__c>>();
        Map<Id,List<Forecast_sku__c>> CustForcstMap1 = new Map<Id,List<Forecast_sku__c>>();
        Map<Id,List<Forecast_sku__c>> CustForcstMapLastYear = new Map<Id,List<Forecast_sku__c>>();
        Map<Id,List<Forecast_sku__c>> CustForcstMapLtLastYear = new Map<Id,List<Forecast_sku__c>>();
        Map<Id,Product2> ProdMap = new Map<Id,Product2>();
        List<Forecast_sku__c> ForcastSKULst = new List<Forecast_sku__c>();
          List<Forecast_sku__c> ForcastSKULst1 = new List<Forecast_sku__c>();
        
        Map<Id,new_forecast__c> CustForcstRecMap = new Map<Id,new_forecast__c>();
        
        ProdLst=[SELECT Id, Name FROM Product2 WHERE IsActive = true order by name];
        for(Product2 Prod : ProdLst){
         List<Forecast_sku__c> TempForcst11 = new List<Forecast_sku__c>();
            CustForcstMap1.put(Prod.Id,TempForcst11);
            
            List<Forecast_sku__c> TempForcst = new List<Forecast_sku__c>();
            CustForcstMap.put(Prod.Id,TempForcst);
            
            List<Forecast_sku__c> TempForcst1 = new List<Forecast_sku__c>();
            CustForcstMapLastYear.put(Prod.Id,TempForcst1);         
            
            List<Forecast_sku__c> TempForcst2 = new List<Forecast_sku__c>();
            CustForcstMapLtLastYear.put(Prod.Id,TempForcst2);  
            ProdMap.put(Prod.Id,Prod);
        }
        integer lyear = integer.valueOf(year)-1;
        Integer LtLYear = Integer.valueOf(year)-2;
        string LastYear = string.valueOf(lyear);
        string LtLastYear = string.valueOf(LtLYear);
        
        
        ForcastSKULst = [SELECT Year__c ,sku__c,New_Forecast__r.product__c,Actual_Amount__c,Budget_Amount__c,Plan_Amount__c,Sample_Amount__c,Month__c,Unit_Price__c,Net_price__c,Sample_Quantity__c,Discount__c,Actual_Quantity__c,Budget_Quantity__c, Plan_Quantity__c FROM Forecast_sku__c WHERE  new_forecast__r.Region__r.sales_Rep__c=:usr.id AND sku__c IN:ProdLst AND (Year__c =:year OR Year__c =:LastYear OR Year__c=:LtLastYear)];
        
        ForcastSKULst1 = [SELECT Year__c ,sku__c,New_Forecast__r.product__c,Actual_Amount__c,Budget_Amount__c,Plan_Amount__c,Sample_Amount__c,Month__c,Unit_Price__c,Net_price__c,Sample_Quantity__c,Discount__c,Actual_Quantity__c,Budget_Quantity__c, Plan_Quantity__c FROM Forecast_sku__c WHERE  new_forecast__r.Customer__r.Region1__r.sales_Rep__c=:usr.id AND sku__c IN:ProdLst AND (Year__c =:year OR Year__c =:LastYear OR Year__c=:LtLastYear)];
            
            
         for(Forecast_sku__c oForcst : ForcastSKULst1){
if(CustForcstMap1.containsKey(oForcst.sku__c) && oForcst.Year__c==year){
                CustForcstMap1.get(oForcst.sku__c).add(oForcst);
            }           
        } 
        
        
        for(Forecast_sku__c oForcst : ForcastSKULst){
            if(CustForcstMap.containsKey(oForcst.sku__c) && oForcst.Year__c==year){
                CustForcstMap.get(oForcst.sku__c).add(oForcst);
            }           
        }        
        for(Forecast_sku__c oForcst : ForcastSKULst){
            if(CustForcstMapLastYear.containsKey(oForcst.sku__c) && oForcst.Year__c==LastYear){             
                CustForcstMapLastYear.get(oForcst.sku__c).add(oForcst);
            }
        }
        for(Forecast_sku__c oForcst : ForcastSKULst){
            if(CustForcstMapLtLastYear.containsKey(oForcst.sku__c) && oForcst.Year__c==LtLastYear){             
                CustForcstMapLtLastYear.get(oForcst.sku__c).add(oForcst);
            }
        }
        
        Map<Id,double> PriceMap = new Map<Id,double>();
        PricebookEntry[] PricEntry = [Select UnitPrice,Product2Id From PricebookEntry where Product2Id IN:ProdMap.KeySet()];
        for(PricebookEntry oPB : PricEntry){
            PriceMap.put(oPB.Product2Id,oPB.UnitPrice);
        }
        
        for(Id oId : CustForcstMap.KeySet()){
            CustForecastWrapper oProdFrcstWrap = new CustForecastWrapper(ProdMap.get(oId), Year ,CustFCst,CustForcstMap1.get(oId),CustForcstMap.get(oId),CustForcstMapLastYear.get(oId), CustForcstMapLtLastYear.get(oId));
            if(PriceMap.containsKey(oID)){
                oProdFrcstWrap.skprc = String.ValueOF(PriceMap.get(oID));
                if(oProdFrcstWrap.skprc=='')
                    oProdFrcstWrap.skprc = 'Please add Standard Price to SKU';
            }           
            custForecasts.add(oProdFrcstWrap);            
        }
        
        return custForecasts;
    }

 

and This is my wrapper class

 

public class CustForecastWrapper{

   
    
    public CustForecastWrapper(Product2 prod, String year,new_forecast__c nfc1,List<Forecast_sku__c> LFSKU11,List<Forecast_sku__c> LFSKU,List<Forecast_sku__c> LFSKULstYear,List<Forecast_sku__c> LFSKUSecLstYear ){
        
        
    
}

 

Thanks....

Hi,

Any one please solve this issue 

 

when i am going to run the test class it will show an error System.QueryException: List has no rows for assignment to SObject 

and Class.SalesrepForecastUpdatetest.testsearch: line 66, column 9 External entry point

 

This is my  Apex class code sample  

 

 

User usr = [Select id,Alias,lastname,firstname,ContactId,Profile.name from User where id=:UserInfo.getUserId() Limit 1];

    public List<CustForecastWrapper> getCustForecasts(){ 

      if(custForecasts != null){

            return custForecasts;        } 

      custForecasts = new List<CustForecastWrapper>();

        if(usr.id == null){

            return custForecasts;   

    } 

      New_Forecast__c CustFCst=new New_Forecast__c(); 

              CustFCst=[select id,name from new_forecast__c where Region__r.sales_Rep__c=:usr.id limit 1];

           '''''''''''''''''''''

''''''''''''''''''

'''''''''''''

}

 

    public void SearchForecast(){    

   custForecasts = null;

   prodForecasts = null;             

  if(ObjectType == 'Product'){            

  ForeCastTitle = Year + ' Product Forecast';            

    getProdForecasts();   

    }        

      if(ObjectType=='Region'){                  

    if(usr.firstname == null)         

      ForeCastTitle = '';   

        else        

        ForeCastTitle = Year + ' Region Forecast for ' + usr.firstname;                  

  getCustForecasts();   

    }

        }

 

Test Method:

 

    static testMethod void testsearch(){ 

    User usr = [Select id from User where firstname=:'test' Limit 1];     

     SalesrepForecastUpdate con=new  SalesrepForecastUpdate (); 

      con.ObjectType = 'Region';    con.Year = String.ValueOf(Date.today().year()); 

         con.searchforecast();              

 List<CustForecastWrapper> forecasts = con.getCustForecasts();                                        }

 

 

 

Thanks 

Hi,

I need help on Rendered functions, may be i am wrong with below code.

can any one please help me on this 

 

i have a variable 'total' that contains some integer value this total will change depending on picklist by 'apex:actionsupport'.

here i have one button which will disable and enable with condition for

Ex: if total=50  enable the button 

if total!=50 disable button

here is my code

<apex:form >
<table class="list" >
<tr>
	<td><b>field one</b></td>
	
    <td><apex:selectList value="{!licens}"  size="1">
				<apex:selectOptions value="{!Licenses}"/>
				<apex:actionSupport event="onchange" action="{!test}" reRender="lcnc,totl,counter" />
		</apex:selectList></td>
	
	<td><apex:outputtext id="lcnc" value="{!licenses_Customer_have_Value}"/></td>
</tr>

<tr>
	<td><b>other Reason</b> </td>
	
	<td> <apex:selectList value="{!Reason}"  size="1">
			<apex:selectOptions value="{!Reasons}"/>
			<apex:actionSupport event="onchange" action="{!test}" reRender="Add,totl,counter" />
		</apex:selectList></td>
	
	<td> <apex:outputtext id="Add" value="{!other_Reason_Value}"/></td>
</tr>
                        
<tr>
	<td align="right"><b>Total</b> </td>
	
	<td > &nbsp;</td>
	
	<td > <apex:Outputtext id="totl" value="{!Total}"/>	</td>
</tr>
</table>

<apex:outputpanel id="counter" rendered="{!Total > 85}">
	<apex:commandbutton action="{!Updatecase}" value="Update"  />
</apex:outputpanel>
 </apex:form>

 

 

 

Hi,

 

i want to update some case fields when Event 'start date' equals to today() 

 

how can i achieve this, please any one can help on this 

Hi,

 

any one can help on the below  issue,

 

i want to update the case field using work flow when  email is sent 

 

my condition is it should check if 

1) Toaddress does not contains @gmail.com (if the To address will have one email address Ex:   test@gmail.com)

Update case field

 

OR

 

2) Toaddress contains @gmail.com and doesnot contains @gmail.com(if To addres contain more than one email address  Ex: test@gmail.com ,test@yahoo.com)

update case field

 

 

Hi, 

 

Need help on below Issue,

 

How to display multiselect picklist value one by one instead of semicomma (;)

 

for example;

 

Item1;item2;item3;item4;item5  instead of this i need 

 

Item1

item2

item3

item4

item5  

 

is it poosible...?,

and i am using standard controller in visualforce page

Hai,

I have one inputField in visualforce page.In that inputField I want to enter only Numbers of size four.

 

How to write validation in controller.please can anyone tell me...

Hi,

Can we use PageReference inside for loop,

 

i am trying to pass the id using for loop but it gives error  as Too many script statments 200001

This is my code

public pageReference downloaddata()
	{
	 Pagereference pp;
			
	 integer j = selectedAttachments.size();
	
	 for(Integer i=0; i<=j; j++)
	{
	  pp=new Pagereference('/servlet/servlet.FileDownload?file='+selectedAttachments[i].id);
	 pp.setRedirect(true);
	 //return pp;
	 }
	 return pp;
	}

 

<apex:commandbutton action="{!downloaddata}" value="Download" />

 

Here im trying to download the attachment files that is more than one file

 

please help me how to solve this issue

how i can achieve this

 

 

 

Please any one help me on this issue,

how to cover the code inside the if condition in test class

public class Pocinsert
{

public List<Plan_of_Care__c> mplan {get; set;}  
 public Pocinsert(){
 mplan = new List<Plan_of_Care__c>();
 makeAvailabilityWindow();
}
  
public String Employee='';

public String getEmployee()
{
return Employee;
}
public void setEmployee(String Employee)
{
this.Employee=Employee;
}

public List<SelectOption> getEmployees()
{
List<SelectOption> option=new List<SelectOption>();
option.add(new SelectOption('', '- None -')); 
for(Employee__c e:[select id,name,lastname__c from Employee__c order by name ASC])
{

option.add(new SelectOption(e.id,e.lastname__c+'-'+e.name));
}
return option;
}

String Client ='';
public String getclient()
{
return client;
}
public void setclient(String Client)
{
this.client=client;
}

public List<SelectOption> getClients()
{
List<SelectOption> option= new List<SelectOption>();
option.add(new SelectOption('', '- None -')); 
for(Client__c c:[select id,name,lastname__c from Client__c where Employee__c =: Employee order by name ASC])
{
option.add(new selectoption(c.id,c.lastname__c+'-'+c.name));
}
return option;
}
  
public void makeAvailabilityWindow()
{
 numberDays = date.daysInMonth(Integer.valueof(selectedYears), Integer.valueof(selectedMonths));
 for(Integer i=1; i<=numberDays; i++){
 day_L.add(String.valueof(i));
 }
   
   for(Integer j=1; j<=numberDays; j++){
    mplan.add(new Plan_of_Care__c());
                 }
     }
                
  public PageReference savem(){ 
  Integer count = mplan.size();
  Integer i = 0; 
  if(Client!=null && Employee!=null)
   {          
      do {
             Integer d = i+1;
            if(mplan[i].Tub_Bath_Shower__c <> 'XX' && mplan[i].Tub_Bath_Shower__c <> null)
             {               
                  mplan[i].Tub_Bath_Shower__c.addError('Input Field value must be XX');
                  PageReference opptyPage = new PageReference('/apex/InsertPOC');
                  return opptyPage; 
              }

          if(mplan[i].Tub_Showertransfer_Position__c <> 'XX' && mplan[i].Tub_Showertransfer_Position__c <> null)
            {
                mplan[i].Tub_Showertransfer_Position__c.addError('Input Field value must be XX');
                PageReference opptyPage = new PageReference('/apex/InsertPOC');
                return opptyPage;
             }      
          if(mplan[i].Bed_Bath__c <> 'XX' && mplan[i].Bed_Bath__c <> null)
             {               
                  mplan[i].Bed_Bath__c.addError('Input Field value must be XX');
                  PageReference opptyPage = new PageReference('/apex/InsertPOC');
                  return opptyPage; 
              }

           
        mplan[i].Client__c=client;
        mplan[i].Employee__c=Employee;      
        mplan[i].date__c=date.newInstance(Integer.valueof(selectedYears),Integer.valueof(selectedMonths),d);
              
               
                i++;
                d=0;
                } while (i < count);
           }              
           upsert mplan;                          
                                
            PageReference home = new PageReference('/apex/InsertPOC');        
            home.setRedirect(true);        
            return home;                    
            }
			}

 

 

Hi 

 

Please can anybody  tell, is it possible to take wrapper class method in main class, if yes please tel how it will do

 

and please see this code it is used to display the total for perticular date, 

how can i calculate total of toal for a month

public with sharing class Finalpaymonth {

Public  String amount{get;set;}
public PageReference searchAction(){
            prepareMap();   
        return null;
    }
 List<Wrappertimecard> wraptimelist = new List<Wrappertimecard>();
 public void prepareMap(){
 Integer t1=0;Integer t2=0;Integer t3=0    
 Integer total=0;
 
 wraptimelist = new List<Wrappertimecard>();

 List<Time_Card__c> empList = [select 
Ambulation_walk_room_to_room__c,Assist_getting_returning_equipment__c,Assist_with_binders__c 
from Time_Card__c where Month__c=:month order by date__c ASC];
        
        for(Time_Card__c emp: empList){
                   
if(emp.Ambulation_walk_room_to_room__c!=null && emp.Ambulation_walk_room_to_room__c!='XX' && emp.Ambulation_walk_room_to_room__c!='X')
{t1=Integer.valueof(emp.Ambulation_walk_room_to_room__c);}  else{t1=0;}
        
if(emp.Assist_getting_returning_equipment__c!=null && emp.Assist_getting_returning_equipment__c!='XX' &&  emp.Assist_getting_returning_equipment__c!='X')
{t2=Integer.valueof(emp.Assist_getting_returning_equipment__c);} else{t2=0;}
        
if(emp.Assist_with_binders__c!=null && emp.Assist_with_binders__c!='XX' && emp.Assist_with_binders__c!='X')
{t3=Integer.valueof(emp.Assist_with_binders__c);}   else{t3=0;}
        
        total=t1+t2+t3;
     
 wraptimelist.add(new Wrappertimecard(emp.Days__c,emp.day__c,amount,total));
          
		 
        }
              
    } 
 
    public List<Wrappertimecard> getWrapSummaryList(){
        return wraptimelist;
    }
  
//wrapper class    
    public class Wrappertimecard{
    public String perunitamount{get;set;}   
    public String tdate{get;set;}
    Public String days{get;set;}
    public Integer total1 {get;set;}
              
     public Integer getTotal(){
      return total1;
     }     
     public Wrappertimecard(String dat,String day,String prunitamt,Integer t1){
     tdate = dat;
     Days=day;
     perunitamount=prunitamt;
     total1 = t1;
     }
  }
}

 

 

Thanks

 

hi,

I am using wrapper class to display the date in vf but here it works fine but i need to display in ascending order 

can any one please help 

here is my code sample

Public lass finalpay()
{
   public void prepareMap()
   {
        salesPerformanceData = new Map<Date, FRSummaryWrap>();
        List<Time_Card__c> empList = [select name,day__c,date__c,days__c from Time_Card__c where Month__c=:month and Employee__r.name=:emp and Year__c=:year order by date__c ASC];
        for(Time_Card__c emp: empList){
               
            salesPerformanceData.put(emp.Date__c,new FRSummaryWrap(emp.Date__c,amount));
        }
		}
		
		 public List<FRSummaryWrap> getWrapSummaryList(){
        return salesPerformanceData.values();
    }
	
	   
    public class FRSummaryWrap{
    
       public Date tdate{get;set;}
	   
	    public FRSummaryWrap(Date dat,String prunitamt){
             
            tdate = dat;
           }
                    
        }
        }

 Here is my VF page

 <apex:repeat value="{!wrapSummaryList}" var="Wrp">
 
 <tr border="1"> 
 <td  Style="font-family: Arial; font-size: 10pt; font-weight: bold;">{!Wrp.tdate}</td>
</tr>  
 </apex:repeat> 

 

Hi,

Any one please solve this issue 

 

when i am going to run the test class it will show an error System.QueryException: List has no rows for assignment to SObject 

and Class.SalesrepForecastUpdatetest.testsearch: line 66, column 9 External entry point

 

This is my  Apex class code sample  

 

 

User usr = [Select id,Alias,lastname,firstname,ContactId,Profile.name from User where id=:UserInfo.getUserId() Limit 1];

    public List<CustForecastWrapper> getCustForecasts(){ 

      if(custForecasts != null){

            return custForecasts;        } 

      custForecasts = new List<CustForecastWrapper>();

        if(usr.id == null){

            return custForecasts;   

    } 

      New_Forecast__c CustFCst=new New_Forecast__c(); 

              CustFCst=[select id,name from new_forecast__c where Region__r.sales_Rep__c=:usr.id limit 1];

           '''''''''''''''''''''

''''''''''''''''''

'''''''''''''

}

 

    public void SearchForecast(){    

   custForecasts = null;

   prodForecasts = null;             

  if(ObjectType == 'Product'){            

  ForeCastTitle = Year + ' Product Forecast';            

    getProdForecasts();   

    }        

      if(ObjectType=='Region'){                  

    if(usr.firstname == null)         

      ForeCastTitle = '';   

        else        

        ForeCastTitle = Year + ' Region Forecast for ' + usr.firstname;                  

  getCustForecasts();   

    }

        }

 

Test Method:

 

    static testMethod void testsearch(){ 

    User usr = [Select id from User where firstname=:'test' Limit 1];     

     SalesrepForecastUpdate con=new  SalesrepForecastUpdate (); 

      con.ObjectType = 'Region';    con.Year = String.ValueOf(Date.today().year()); 

         con.searchforecast();              

 List<CustForecastWrapper> forecasts = con.getCustForecasts();                                        }

 

 

 

Thanks