• vamsivanga
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello all,

I have custom visual force page for our case page.

We have two custom checkbox felds called Followup_required and call_back_needed. So when ever one of those fields are checked, I wanted my due date to be a required field.

I wrote this code but it doesnt work

<apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.ActivityDate__c.label}"/>
                              <apex:outputPanel id="DueDate">
                             <apex:inputField value="{!NewCase.ActivityDate__c}" required="{{!Newcase.Are_you_going_to_call_back__c}||{!Newcase.Follow_up_required__c}}"/>
                              </apex:outputPanel>
                         </apex:pageblockSectionItem>






This is my visual force page. I highlighted the area of code im having trouble with. Please help


<apex:page tabStyle="case" standardController="contact" extensions="NewCaseController" recordSetVar="Cases">
    <apex:sectionHeader title="{!$ObjectType.Case.label}" subtitle="New {!$ObjectType.Case.label}" id="header"/>
    <apex:pagemessages id="pgmsgs"/>
    <apex:form >
        <apex:pageblock title="New Case">
            <apex:pageblockButtons >
                <apex:commandButton value="Save" action="{!SaveandRedirect}" />
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageblockButtons>
            <apex:pageblockSection columns="2" title="Case Information" collapsible="false">
                 <apex:inputfield value="{!NewCase.ContactId}"/>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="{!$ObjectType.Case.label} Owner"/>
                     <apex:outputText value="{!$User.FirstName} {!$User.LastName}"/>
                 </apex:pageblockSectionItem>
                 <apex:inputfield value="{!NewCase.Origin}" required="true"/>
                 <apex:inputfield value="{!NewCase.AccountId}"/>
                 <apex:inputField value="{!NewCase.Type}" required="true"/>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="ContactPhone" for="contactphone"/>
                     <apex:outputText value="{!contactphone}" id="contactphone"/>
                 </apex:pageblockSectionItem>   
                 <apex:inputfield value="{!NewCase.SubType__c}" required="true"/>
                 <apex:inputfield value="{!NewCase.Subject}" required="true"/>
                 <apex:inputfield value="{!NewCase.Priority}"/>             
                 <apex:inputfield id="description" value="{!NewCase.Description}" required="true" style="width:400px;height:120px;"/>                  
                 <apex:pageblockSectionItem >
                     <apex:outputlabel value="{!$ObjectType.Case.fields.status.label}"/>
                     <apex:actionRegion >
                         <apex:inputfield value="{!NewCase.Status}" required="true">
                            <apex:actionsupport event="onchange" rerender="pgmsgs, followupfield, callbackfield" action="{!statuschange}"/>
                         </apex:inputfield>
                     </apex:actionRegion>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="Internal Comments" for="internalcomments"/>
                     <apex:inputTextarea value="{!Internalcomments}" id="internalcomments" style="width:400px;height:120px;"/>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputlabel value="{!$ObjectType.Case.fields.Supervisor_Call_Back_Required__c.label}"/>
                     <apex:inputCheckbox value="{!NewCase.Supervisor_Call_Back_Required__c}"/>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="This is past 48 hours requirement. Would you still like to proceed?"/>
                     <apex:inputCheckbox value="{!OverrideActivityValidation}"/>
                 </apex:pageblockSectionItem>
             
           </apex:pageblockSection>
           <apex:pageblockSection columns="1">    
                 <apex:pageblockSectionItem >
                     <apex:pageblockSection columns="4">
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Follow_up_required__c.label}"/>
                             <apex:actionRegion >
                                 <apex:outputPanel id="followupfield">
                                     <apex:inputcheckbox value="{!NewCase.Follow_up_required__c}" disabled="{!Newcase.status == 'Closed'}">
                                         <apex:actionSupport action="{!mutualexclusionrule_followup}"  reRender="callbackfield,callbacknumber" event="onchange"/>
                                     </apex:inputcheckbox>
                                 </apex:outputPanel>   
                             </apex:actionRegion>   
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Are_you_going_to_call_back__c.label}"/>
                             <apex:actionRegion >
                                 <apex:outputPanel id="callbackfield">
                                     <apex:inputcheckbox value="{!NewCase.Are_you_going_to_call_back__c}" disabled="{!Newcase.status == 'Closed'}">
                                         <apex:actionSupport action="{!mutualexclusionrule_cb}" reRender="followupfield,callbacknumber" event="onchange"/>
                                     </apex:inputcheckbox>
                                 </apex:outputPanel>
                             </apex:actionRegion>
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Callback_Number__c.label}" />
                             <apex:outputPanel id="callbacknumber">
                                 <apex:inputField value="{!NewCase.Callback_Number__c}" required="{!Newcase.Are_you_going_to_call_back__c}"/>
                             </apex:outputPanel>
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.ActivityDate__c.label}"/>
                              <apex:outputPanel id="DueDate">
                             <apex:inputField value="{!NewCase.ActivityDate__c}" required="{{!Newcase.Are_you_going_to_call_back__c}||{!Newcase.Follow_up_required__c}}"/>
                              </apex:outputPanel>
                         </apex:pageblockSectionItem>

                    </apex:pageblockSection>
                 </apex:pageblockSectionItem>
             </apex:pageblockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>


Not sure how to overcome this.. Works pretty good in sandbox but when deployed , few users get this message while others are doing pretty well..

All I'm trying to do is, I created a visual force page for an object CLAIM and had a button to it called "Get More Claims" when ever the user clicks it, they get 10 extra claims in the order of oldest first... Please guide me here

This is my controller..


public class DemoClaimManagerController {

    public DemoClaimManagerController() {
      displayerrormessage=NoOpenClaimsNotification= false; 
    }

    private string returnurlstr;
    public boolean NoOpenClaimsNotification {get;set;}
    public boolean displayerrormessage{get;set;}
    public List<claim__c> selectedClaims{get;set;}
    public List<claim__c> myclaims{get{
        return [select Id,OwnerId,Name,Account__c,Type__c,Sub_Type__c,Status__c,Owner.alias
                            from Claim__c
                            where OwnerId = :UserInfo.getUserId()
                            and status__c != 'Processed'];//Change made from received to Processed
    }}
    public DemoClaimManagerController(ApexPages.StandardController controller){
        /*if(ApexPages.currentpage().getparameters().containskey('retURL'))
            this.returnurlstr = ApexPages.currentpage().getparameters().get('retURL');
        else
             this.returnurlstr = '/apex/DemoClaimManager';*/
        displayerrormessage = false;
        NoOpenClaimsNotification= false;
    }

    /*public List<ClaimData> getChartData() {
        List<ClaimData> data = new List<ClaimData>();
        Map<String,Integer> DatevsRecCount = new Map<String,Integer>();
        for(Claim__c singleclaim : [Select Id, CreatedDate
                                   from Claim__c
                                   where CreatedDate = LAST_N_DAYS: 7])
        {
            //DatevsRecCount.put(String.valueof(agr.get('CreatedDate')), Integer.valueof(agr.get('reccount')));
            if(DatevsRecCount.containsKey(String.valueof(singleclaim.CreatedDate.date())))
                DatevsRecCount.put(String.valueof(singleclaim.createdDate.date()),DatevsRecCount.get(String.valueof(singleclaim.createdDate.date()))+1);
            else
                DatevsRecCount.put(String.valueof(singleclaim.CreatedDate.date()),1); 
        }
        for(String Day: DatevsRecCount.keyset())
            data.add(new claimData(String.valueof(Day),DatevsRecCount.get(Day)));   
        return data;
    }*/

   /*public class ChartData {
      public String name {get; set;}
      public Integer data {get; set;}
    
     
      public ChartData (String name, Integer data) {
         this.name = name;
         this.data = data;
      }

   }*/

   public List<ClaimData> getClaimDataPersonalqueue() {
      List<ClaimData> data = new List<ClaimData>();
      Map<String,Integer> OwnervsRecCount = new Map<String,Integer>();
      for(claim__c singleclaim : [Select Id, Owner.name
                                    from Claim__c
                                    where (Status__c !='Processed' AND CreatedDate = LAST_N_DAYS: 7)])// Change made from received to Processed
           {
               //ownervsRecCount.put(String.valueof(agr.get('Owner.name')), Integer.valueof(agr.get('reccount')));
               if(OwnervsRecCount.containsKey(singleclaim.owner.Name))
                  OwnervsRecCount.put(singleclaim.Owner.name,OwnervsRecCount.get(singleclaim.Owner.Name)+1);
               else
                  OwnervsRecCount.put(singleclaim.Owner.name,1);
           }
       for(String Owner: OwnervsRecCount.keyset())
           data.add(new claimData(Owner,OwnervsRecCount.get(Owner)));   
    
      return data;
   }

   // wrapper class to hold data
   public class ClaimData {
      public String name {get; set;}
      public Integer data {get; set;}
      public ClaimData (String name, Integer data) {
         this.name = name;
         this.data = data;
      }
   }
  
   /*public Integer GetNextClaims() {
     return 0;
   }*/
   Private boolean ValidateUser(){
       List<claim__c> OwnedClaims = [select Id,OwnerId
                                        from Claim__c
                                        where OwnerId = :UserInfo.getUserId()
                                            AND Status__c != 'Processed'];
       if(!OwnedClaims.isEmpty())
       {
           return false;
       }
       return true;
   } 
   
   
    public PageReference GetMoreClaims(){  
        //PageReference retunurl= new Pagereference(returnurlstr);
        if(!validateUser())
        {
            displayerrormessage = true; 
            return null;
        }
        selectedClaims= new List<claim__c>();
        QueueSobject claimprocessor = [select queueid
                                                        from QueueSobject
                                                        where SobjectType = 'Claim__c'
                                                            AND Queue.DeveloperName = 'ClaimProcessors' limit 1];
        Id claimprocessorId = claimprocessor.queueid;
        for(claim__c claim: [Select Id,OwnerId,Name,Account__c,Type__c,Sub_Type__c,Status__c,Owner.alias
                                                        from Claim__c
                                                            where ownerId = :claimprocessorId
                                                            ORDER BY CreatedDate ASC LIMIT 20])
        {
            claim.ownerId = UserInfo.getUserId();
            selectedClaims.add(claim);
        }
        try{
            if(!selectedClaims.isEmpty())
            {
                update selectedClaims;
            }
            else
            {
                NoOpenClaimsNotification = TRUE; return null;
            }
        }
        catch(Exception e){
            System.debug('Error Updating Records'+e.getMessage());
        }
        return null;
    }
   
    public PageReference GoTOPreviousScreen(){
       displayerrormessage = false;
       NoOpenClaimsNotification  = false;  
       selectedclaims = null;
       return null;  
   }

}
Hello all,

I have custom visual force page for our case page.

We have two custom checkbox felds called Followup_required and call_back_needed. So when ever one of those fields are checked, I wanted my due date to be a required field.

I wrote this code but it doesnt work

<apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.ActivityDate__c.label}"/>
                              <apex:outputPanel id="DueDate">
                             <apex:inputField value="{!NewCase.ActivityDate__c}" required="{{!Newcase.Are_you_going_to_call_back__c}||{!Newcase.Follow_up_required__c}}"/>
                              </apex:outputPanel>
                         </apex:pageblockSectionItem>






This is my visual force page. I highlighted the area of code im having trouble with. Please help


<apex:page tabStyle="case" standardController="contact" extensions="NewCaseController" recordSetVar="Cases">
    <apex:sectionHeader title="{!$ObjectType.Case.label}" subtitle="New {!$ObjectType.Case.label}" id="header"/>
    <apex:pagemessages id="pgmsgs"/>
    <apex:form >
        <apex:pageblock title="New Case">
            <apex:pageblockButtons >
                <apex:commandButton value="Save" action="{!SaveandRedirect}" />
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageblockButtons>
            <apex:pageblockSection columns="2" title="Case Information" collapsible="false">
                 <apex:inputfield value="{!NewCase.ContactId}"/>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="{!$ObjectType.Case.label} Owner"/>
                     <apex:outputText value="{!$User.FirstName} {!$User.LastName}"/>
                 </apex:pageblockSectionItem>
                 <apex:inputfield value="{!NewCase.Origin}" required="true"/>
                 <apex:inputfield value="{!NewCase.AccountId}"/>
                 <apex:inputField value="{!NewCase.Type}" required="true"/>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="ContactPhone" for="contactphone"/>
                     <apex:outputText value="{!contactphone}" id="contactphone"/>
                 </apex:pageblockSectionItem>   
                 <apex:inputfield value="{!NewCase.SubType__c}" required="true"/>
                 <apex:inputfield value="{!NewCase.Subject}" required="true"/>
                 <apex:inputfield value="{!NewCase.Priority}"/>             
                 <apex:inputfield id="description" value="{!NewCase.Description}" required="true" style="width:400px;height:120px;"/>                  
                 <apex:pageblockSectionItem >
                     <apex:outputlabel value="{!$ObjectType.Case.fields.status.label}"/>
                     <apex:actionRegion >
                         <apex:inputfield value="{!NewCase.Status}" required="true">
                            <apex:actionsupport event="onchange" rerender="pgmsgs, followupfield, callbackfield" action="{!statuschange}"/>
                         </apex:inputfield>
                     </apex:actionRegion>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="Internal Comments" for="internalcomments"/>
                     <apex:inputTextarea value="{!Internalcomments}" id="internalcomments" style="width:400px;height:120px;"/>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputlabel value="{!$ObjectType.Case.fields.Supervisor_Call_Back_Required__c.label}"/>
                     <apex:inputCheckbox value="{!NewCase.Supervisor_Call_Back_Required__c}"/>
                 </apex:pageblockSectionItem>
                 <apex:pageblockSectionItem >
                     <apex:outputLabel value="This is past 48 hours requirement. Would you still like to proceed?"/>
                     <apex:inputCheckbox value="{!OverrideActivityValidation}"/>
                 </apex:pageblockSectionItem>
             
           </apex:pageblockSection>
           <apex:pageblockSection columns="1">    
                 <apex:pageblockSectionItem >
                     <apex:pageblockSection columns="4">
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Follow_up_required__c.label}"/>
                             <apex:actionRegion >
                                 <apex:outputPanel id="followupfield">
                                     <apex:inputcheckbox value="{!NewCase.Follow_up_required__c}" disabled="{!Newcase.status == 'Closed'}">
                                         <apex:actionSupport action="{!mutualexclusionrule_followup}"  reRender="callbackfield,callbacknumber" event="onchange"/>
                                     </apex:inputcheckbox>
                                 </apex:outputPanel>   
                             </apex:actionRegion>   
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Are_you_going_to_call_back__c.label}"/>
                             <apex:actionRegion >
                                 <apex:outputPanel id="callbackfield">
                                     <apex:inputcheckbox value="{!NewCase.Are_you_going_to_call_back__c}" disabled="{!Newcase.status == 'Closed'}">
                                         <apex:actionSupport action="{!mutualexclusionrule_cb}" reRender="followupfield,callbacknumber" event="onchange"/>
                                     </apex:inputcheckbox>
                                 </apex:outputPanel>
                             </apex:actionRegion>
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.Callback_Number__c.label}" />
                             <apex:outputPanel id="callbacknumber">
                                 <apex:inputField value="{!NewCase.Callback_Number__c}" required="{!Newcase.Are_you_going_to_call_back__c}"/>
                             </apex:outputPanel>
                         </apex:pageblockSectionItem>
                         <apex:pageblockSectionItem >
                             <apex:outputlabel value="{!$ObjectType.Case.fields.ActivityDate__c.label}"/>
                              <apex:outputPanel id="DueDate">
                             <apex:inputField value="{!NewCase.ActivityDate__c}" required="{{!Newcase.Are_you_going_to_call_back__c}||{!Newcase.Follow_up_required__c}}"/>
                              </apex:outputPanel>
                         </apex:pageblockSectionItem>

                    </apex:pageblockSection>
                 </apex:pageblockSectionItem>
             </apex:pageblockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>


Not sure how to overcome this.. Works pretty good in sandbox but when deployed , few users get this message while others are doing pretty well..

All I'm trying to do is, I created a visual force page for an object CLAIM and had a button to it called "Get More Claims" when ever the user clicks it, they get 10 extra claims in the order of oldest first... Please guide me here

This is my controller..


public class DemoClaimManagerController {

    public DemoClaimManagerController() {
      displayerrormessage=NoOpenClaimsNotification= false; 
    }

    private string returnurlstr;
    public boolean NoOpenClaimsNotification {get;set;}
    public boolean displayerrormessage{get;set;}
    public List<claim__c> selectedClaims{get;set;}
    public List<claim__c> myclaims{get{
        return [select Id,OwnerId,Name,Account__c,Type__c,Sub_Type__c,Status__c,Owner.alias
                            from Claim__c
                            where OwnerId = :UserInfo.getUserId()
                            and status__c != 'Processed'];//Change made from received to Processed
    }}
    public DemoClaimManagerController(ApexPages.StandardController controller){
        /*if(ApexPages.currentpage().getparameters().containskey('retURL'))
            this.returnurlstr = ApexPages.currentpage().getparameters().get('retURL');
        else
             this.returnurlstr = '/apex/DemoClaimManager';*/
        displayerrormessage = false;
        NoOpenClaimsNotification= false;
    }

    /*public List<ClaimData> getChartData() {
        List<ClaimData> data = new List<ClaimData>();
        Map<String,Integer> DatevsRecCount = new Map<String,Integer>();
        for(Claim__c singleclaim : [Select Id, CreatedDate
                                   from Claim__c
                                   where CreatedDate = LAST_N_DAYS: 7])
        {
            //DatevsRecCount.put(String.valueof(agr.get('CreatedDate')), Integer.valueof(agr.get('reccount')));
            if(DatevsRecCount.containsKey(String.valueof(singleclaim.CreatedDate.date())))
                DatevsRecCount.put(String.valueof(singleclaim.createdDate.date()),DatevsRecCount.get(String.valueof(singleclaim.createdDate.date()))+1);
            else
                DatevsRecCount.put(String.valueof(singleclaim.CreatedDate.date()),1); 
        }
        for(String Day: DatevsRecCount.keyset())
            data.add(new claimData(String.valueof(Day),DatevsRecCount.get(Day)));   
        return data;
    }*/

   /*public class ChartData {
      public String name {get; set;}
      public Integer data {get; set;}
    
     
      public ChartData (String name, Integer data) {
         this.name = name;
         this.data = data;
      }

   }*/

   public List<ClaimData> getClaimDataPersonalqueue() {
      List<ClaimData> data = new List<ClaimData>();
      Map<String,Integer> OwnervsRecCount = new Map<String,Integer>();
      for(claim__c singleclaim : [Select Id, Owner.name
                                    from Claim__c
                                    where (Status__c !='Processed' AND CreatedDate = LAST_N_DAYS: 7)])// Change made from received to Processed
           {
               //ownervsRecCount.put(String.valueof(agr.get('Owner.name')), Integer.valueof(agr.get('reccount')));
               if(OwnervsRecCount.containsKey(singleclaim.owner.Name))
                  OwnervsRecCount.put(singleclaim.Owner.name,OwnervsRecCount.get(singleclaim.Owner.Name)+1);
               else
                  OwnervsRecCount.put(singleclaim.Owner.name,1);
           }
       for(String Owner: OwnervsRecCount.keyset())
           data.add(new claimData(Owner,OwnervsRecCount.get(Owner)));   
    
      return data;
   }

   // wrapper class to hold data
   public class ClaimData {
      public String name {get; set;}
      public Integer data {get; set;}
      public ClaimData (String name, Integer data) {
         this.name = name;
         this.data = data;
      }
   }
  
   /*public Integer GetNextClaims() {
     return 0;
   }*/
   Private boolean ValidateUser(){
       List<claim__c> OwnedClaims = [select Id,OwnerId
                                        from Claim__c
                                        where OwnerId = :UserInfo.getUserId()
                                            AND Status__c != 'Processed'];
       if(!OwnedClaims.isEmpty())
       {
           return false;
       }
       return true;
   } 
   
   
    public PageReference GetMoreClaims(){  
        //PageReference retunurl= new Pagereference(returnurlstr);
        if(!validateUser())
        {
            displayerrormessage = true; 
            return null;
        }
        selectedClaims= new List<claim__c>();
        QueueSobject claimprocessor = [select queueid
                                                        from QueueSobject
                                                        where SobjectType = 'Claim__c'
                                                            AND Queue.DeveloperName = 'ClaimProcessors' limit 1];
        Id claimprocessorId = claimprocessor.queueid;
        for(claim__c claim: [Select Id,OwnerId,Name,Account__c,Type__c,Sub_Type__c,Status__c,Owner.alias
                                                        from Claim__c
                                                            where ownerId = :claimprocessorId
                                                            ORDER BY CreatedDate ASC LIMIT 20])
        {
            claim.ownerId = UserInfo.getUserId();
            selectedClaims.add(claim);
        }
        try{
            if(!selectedClaims.isEmpty())
            {
                update selectedClaims;
            }
            else
            {
                NoOpenClaimsNotification = TRUE; return null;
            }
        }
        catch(Exception e){
            System.debug('Error Updating Records'+e.getMessage());
        }
        return null;
    }
   
    public PageReference GoTOPreviousScreen(){
       displayerrormessage = false;
       NoOpenClaimsNotification  = false;  
       selectedclaims = null;
       return null;  
   }

}