• SkyWalker
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 8
    Replies
I am not sure how to write test cases for the controller, could anyone please help?  Here is my controller
Code:
public class PageEntityAccountEdit 
{
 
 public PageEntityAccountEdit(ApexPages.StandardController controller) 
 {
      Entity_Account__c ent = (Entity_Account__c) controller.getRecord();
      ent = [select record_type_id__c, entity_name__c from Entity_Account__c 
                 where id = :System.currentPageReference().getParameters().get('id')];
        
        if(ent.record_type_id__c == '012700000009R7G' && ent.entity_name__c == 'VRP')
        {
         isFac = true;
         
        }  
              
    }
    
    public Boolean isFac
    {         
     get 
     {            
      if(isFac == null) 
      isFac = false;            
      return isFac;        
      }        
       set;     
    }
}

 
And here is the visualforce code
Code:
<apex:page standardController="Entity_Account__c" extensions="PageEntityAccountEdit" >
<apex:form >
<apex:pageBlock title="Entity Account">
<apex:pageBlockButtons >     
    <apex:commandButton action="{!save}" value="Save"/>   
      <apex:commandButton action="{!cancel}" value="Cancel"/>   
      </apex:pageBlockButtons>

    <apex:pageBlockSection title="Entity Account Edit">    
       <apex:outputfield value="{!Entity_Account__c.Entity__c}"/>    
       <apex:inputfield value="{!Entity_Account__c.Active__c}"/>          
       <apex:outputfield value="{!Entity_Account__c.Account__c}"/>       
       <apex:inputfield value="{!Entity_Account__c.Priority__c}" rendered="{!isFac}" />
       <apex:inputfield value="{!Entity_Account__c.Record_Type__c}" rendered="{!isFac}" />    
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 
Could you please tell me how to write the test case for the rendered portion (isFac)?
 
Thanks much for your help
Hello,
 
My visualforce page has two multi-picklist fields.  The page has two standard buttons: Save and Cancel.  I am able to save the values I selected in the multi-picklist when there are more than 1 selection but when I clear out my selections from the picklist, it does not save the values.  Could you please help me figure out how to fix this?  Please see code below for the Visualforce page.  The Entity_Account__c is a custom object which we have created.  Thank you in advance
Code:
<apex:page standardController="Entity_Account__c">
<apex:form >
<apex:pageBlock title="Entity Account">
<apex:pageBlockButtons >     
    <apex:commandButton action="{!save}" value="Save"/>   
      <apex:commandButton action="{!cancel}" value="Cancel"/>   
      </apex:pageBlockButtons>

    <apex:pageBlockSection title="Entity Account Edit">    
       <apex:inputfield value="{!Entity_Account__c.Entity__c}"/>    
       <apex:inputfield value="{!Entity_Account__c.Active__c}"/>          
       <apex:inputfield value="{!Entity_Account__c.Account__c}"/>       
       <apex:inputfield value="{!Entity_Account__c.Priority__c}" />
       <apex:inputfield value="{!Entity_Account__c.Record_Type__c}" />    
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 
Hello All,
I am a newbie with VisualForce.  I was wondering if anybody could provide sample code on what I would like to do.  There are two recordtypes in my account.  So depending on the recordtypeid for the account, I would like to direct them to the appropriate custom object create page layout when they click on the new button from the account custom object related list.
 
Thank you in advance.
Could anyone please help me with the following?  Since I am not able to include multi-select picklist on a field validation, I was going to write an apex trigger.  Could anyone tell me how I would test to see if a multi-select picklist is blank?  The priority field is of a multi-select picklist -- I would like the trigger to fire if the user did not populate the priority field but the trigger is not firing.  Any ideas?  Thanks
 
if (Trigger.new.Operational_Status__c == 'Test' && Trigger.new.Record_Type__c == '' && Trigger.new.Priority__c == '')
I am not sure how to write test cases for the controller, could anyone please help?  Here is my controller
Code:
public class PageEntityAccountEdit 
{
 
 public PageEntityAccountEdit(ApexPages.StandardController controller) 
 {
      Entity_Account__c ent = (Entity_Account__c) controller.getRecord();
      ent = [select record_type_id__c, entity_name__c from Entity_Account__c 
                 where id = :System.currentPageReference().getParameters().get('id')];
        
        if(ent.record_type_id__c == '012700000009R7G' && ent.entity_name__c == 'VRP')
        {
         isFac = true;
         
        }  
              
    }
    
    public Boolean isFac
    {         
     get 
     {            
      if(isFac == null) 
      isFac = false;            
      return isFac;        
      }        
       set;     
    }
}

 
And here is the visualforce code
Code:
<apex:page standardController="Entity_Account__c" extensions="PageEntityAccountEdit" >
<apex:form >
<apex:pageBlock title="Entity Account">
<apex:pageBlockButtons >     
    <apex:commandButton action="{!save}" value="Save"/>   
      <apex:commandButton action="{!cancel}" value="Cancel"/>   
      </apex:pageBlockButtons>

    <apex:pageBlockSection title="Entity Account Edit">    
       <apex:outputfield value="{!Entity_Account__c.Entity__c}"/>    
       <apex:inputfield value="{!Entity_Account__c.Active__c}"/>          
       <apex:outputfield value="{!Entity_Account__c.Account__c}"/>       
       <apex:inputfield value="{!Entity_Account__c.Priority__c}" rendered="{!isFac}" />
       <apex:inputfield value="{!Entity_Account__c.Record_Type__c}" rendered="{!isFac}" />    
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 
Could you please tell me how to write the test case for the rendered portion (isFac)?
 
Thanks much for your help
Hello,
 
My visualforce page has two multi-picklist fields.  The page has two standard buttons: Save and Cancel.  I am able to save the values I selected in the multi-picklist when there are more than 1 selection but when I clear out my selections from the picklist, it does not save the values.  Could you please help me figure out how to fix this?  Please see code below for the Visualforce page.  The Entity_Account__c is a custom object which we have created.  Thank you in advance
Code:
<apex:page standardController="Entity_Account__c">
<apex:form >
<apex:pageBlock title="Entity Account">
<apex:pageBlockButtons >     
    <apex:commandButton action="{!save}" value="Save"/>   
      <apex:commandButton action="{!cancel}" value="Cancel"/>   
      </apex:pageBlockButtons>

    <apex:pageBlockSection title="Entity Account Edit">    
       <apex:inputfield value="{!Entity_Account__c.Entity__c}"/>    
       <apex:inputfield value="{!Entity_Account__c.Active__c}"/>          
       <apex:inputfield value="{!Entity_Account__c.Account__c}"/>       
       <apex:inputfield value="{!Entity_Account__c.Priority__c}" />
       <apex:inputfield value="{!Entity_Account__c.Record_Type__c}" />    
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 
Hello All,
I am a newbie with VisualForce.  I was wondering if anybody could provide sample code on what I would like to do.  There are two recordtypes in my account.  So depending on the recordtypeid for the account, I would like to direct them to the appropriate custom object create page layout when they click on the new button from the account custom object related list.
 
Thank you in advance.
Hello,

I am trying to disply values in a table. When one of the value is empty, it removes the line below it. Exactly the same problem we would get , when you are coding in HTML and the value returned from the backend is null.

I tried

<apex:outputText value="{!IF(aBilldetail.Proration_Phone__c==null,' &nbsp',aBilldetail.Proration_Phone__c)}"
style="display: block;" />

but this doesnt work becuase SF coverts &nbsp to &amp,nbsp and treats it as a string.

Thanks,
GirishS