• HCrousePDX
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
I'm trying to deploy some code.  I have a deployment set with my triggers and my test code, both are covered at near 90% and my overall coverage for my org is 80%.  When I validate the code, the deployment status screen only shows it running the 9 tests that are included in my deployment set.  Then it fails with a code coverage error that my overall % is 53?  Every other time I've deployed the test widget on the status page shows the number for all tests in my org.  

Has anyone else experienced this?


I have this code on my visualforce page:

<apex:outputPanel rendered="{!item.qns.ResponseFormat__c='P'}" >
                        <apex:selectRadio value="{!item.isSelected}" layout="pageDirection" border="0" borderVisible="false">
                            <apex:selectOptions value="{!item.prList}" />
                        </apex:selectRadio>
</apex:outputPanel>

When it is rendering in Visualforce it is placing a border around each radio button:

 User-added image

Has anyone see this and been able to fix it?

I have something strange happening in my test code and I can't figure out what's happening.

 

I have to following code:

//other code to create O1 exists above. 

ApexPages.StandardController sc = new ApexPages.standardController(O1);

    cntrCreateCompanyProduct CCP = new cntrCreateCompanyProduct(sc);

    CCP.newCP(); //creates a new ComProd varible and loads it.

    if(CCP.ComProd != null) system.debug('testing comp is not null');

    System.AssertEquals(CCP.ComProd,null);

 

So I see the debug message in my debug log, which means that CCP.ComProd is not null however the Assert is firing causing my test code to fail at this point?

 

I'm not sure what I'm missing.

I have a button on a visualforce page that will generate a report using a url in another window, similar to the code below:

 

<apex:commandButton value="Submit" action="{!controlleraction}"  onClick="window.open('/apex/VFPage');"/>

 

What I want to do is to stop the onClick event from happening if the controlleraction has an error.  Basically when they click the button I need to run some validations to make sure the report won't be blank or contain in correct data.  So I want to first run a validation routine in the controller, if it passes then I want the report to generate.  If not, I don't need the report to open; the controller method will return an error to the page.

 

 

Hello! The amazing people in the developer zone at Dreamforce this year inspired me to start learning apex triggers and visualforce (I am a certified admin currently). I have my first trigger completed without errors and now I need to see if it works!! This is very exciting.  It seems I need to create a new APEX CLASS to test this trigger (the trigger is below).

I have been reading through the online workbooks but really am not sure how to start the logic on this (except to create new class and use the public class type).  Thank you in advance for anyone willing to guide me in the right direction!!!

 

 

trigger HPAJunctionAutoRefresh on HPA__c (after update) {

for( HPA__c parent: Trigger.new)
{

//LIST ALL CHILD RECORDS UNDER HPA_JUNCTION OBJECT AND COMPARE TO PARENT EVERY TIME THE HPA_PARENT IS EDITED
//AND UPDATE THE STATUS FIELD ON CHILD HPA_JUNCTION TO MATCH HPA_PARENT SO THAT WORKFLOWS ARE ACTIVATED TO UPDATE THE ACCOUNT
//WHICH IS THE SECOND MASTER-DETAIL RELATIONSHIP TO THE HPA_JUNCTION

 

List<HPA_Property_Junction__c> children = [ SELECT Id, HPA_Name__c, HPA_Current_Status_Snapshot__c from
HPA_Property_Junction__c where HPA_Name__r.id = :parent.Id];

List<HPA_Property_Junction__c> childrenToUpdate = new List<HPA_Property_Junction__c>();

for(HPA_Property_Junction__c thischild: children )
{
if( thischild.HPA_Current_Status_Snapshot__c != parent.HPA_Current_Status_Text__c)
{
thischild.HPA_Current_Status_Snapshot__c = parent.HPA_Current_Status_Text__c;
childrenToUpdate.add(thischild)
;
}

if( !childrenToUpdate.isEmpty())
{
update childrenToUpdate;
}

}
}
}

  • December 01, 2013
  • Like
  • 0

I have a button on a visualforce page that will generate a report using a url in another window, similar to the code below:

 

<apex:commandButton value="Submit" action="{!controlleraction}"  onClick="window.open('/apex/VFPage');"/>

 

What I want to do is to stop the onClick event from happening if the controlleraction has an error.  Basically when they click the button I need to run some validations to make sure the report won't be blank or contain in correct data.  So I want to first run a validation routine in the controller, if it passes then I want the report to generate.  If not, I don't need the report to open; the controller method will return an error to the page.