• natty dread
  • NEWBIE
  • 50 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies

I have a survey that I want to display based on the selection in a picklist. The survey branches depending on which option is selected. I'd like to use jQuery to hide and show the pertinent survey questions but the .change function doesn't seem to be doing anything. I just started messing around with jQuery yesterday so please be patient with me if I am missng something obvious. I'm at  a loss... Any help would be appreciated. 

 

(Note: I have tried using a jQuery static resource and it did not make any difference.)

 

the javascript

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.js" type="text/javascript"></script>
<script type="text/javascript"> $(document).ready(function(){ $('#theQuestions').hide(); $('#thePlan').change(function(){ if ($('#thePlan').val() == 'PPO') { $('#theQuestions').show(); $('#MAO').hide(); $('#DSNP').hide(); $('#CSNP').hide(); } }); }); </script>

 the visualforce

<div class="theFields">
   <p><apex:outputLabel >Type</apex:outputLabel></p>
   <apex:inputField value="{!c.Plan_Type__c}" id="thePlan" />
</div>

<div class="greybox" id="theQuestions"> 
  
   <div class="ques">
      <p>General Question?</p>
      <div class="selRad">
         <apex:selectRadio value="{!c.Question1__c}" >
	    <apex:selectOptions value="{!items}" />
	 </apex:selectRadio>
      </div>
   </div>
   <div class="ques" id="MAO">
      <p>MAO Question?</p>
      <div class="selRad">
         <apex:selectRadio value="{!c.Question2__c}" >
	    <apex:selectOptions value="{!items}" />
	 </apex:selectRadio>
      </div>
   </div>
   <div class="ques" id="PPO">
      <p>PPO Question?</p>
      <div class="selRad">
         <apex:selectRadio value="{!c.Question3__c}" >
	    <apex:selectOptions value="{!items}" />
	 </apex:selectRadio>
      </div>
   </div>
   <div class="ques" id="DSNP">
      <p>DSNP Question?</p>
      <div class="selRad">
         <apex:selectRadio value="{!c.Question4__c}" >
	    <apex:selectOptions value="{!items}" />
	 </apex:selectRadio>
      </div>
   </div>
   <div class="ques" id="CSNP">
      <p>CSNP Question?</p>
      <div class="selRad">
         <apex:selectRadio value="{!c.Question5__c}" >
	    <apex:selectOptions value="{!items}" />
	 </apex:selectRadio>
      </div>
   </div>

</div>

 

I have a requirement to build a report showing only inbound calls received after 5PM for the last 6 months. With Salesforces lack of a time field I'm have a hard time figuring out how to filter for this. Any suggestions?

 

-Natty

I have a trigger that simply pulls the time out of a DateTime field and displays it in the 'hh:mm a' format. I'd like this trigger to fire after a new record is inserted OR if an existing record is updated.

 

I'm very new to the dev side of force.com but I managed to get a working trigger and 100% test coverage but I'm only updating after insert. How would I get this to fire after an update as well? Code below: 

 

trigger time_test on Test__c (after insert) {
	Set<Id> Ids = new Set<Id>();
	
	for (Test__c tests : Trigger.new){
		Ids.add(tests.Id);
	}
	
	List<Test__c> test_list = new List<Test__c>([SELECT Id, Name, Time_Stamp__c, Custom_Time__c FROM Test__c l WHERE CreatedDate = today]);
	
	for(Test__c tests : test_list){
		String my_time = tests.Time_Stamp__c.format('hh:mm a');
		tests.Custom_Time__c = my_time;
		update tests;
	}
}

Any help at all would be greatly appreciated. 

 

-Natty

I have a requirement to build a report showing only inbound calls received after 5PM for the last 6 months. With Salesforces lack of a time field I'm have a hard time figuring out how to filter for this. Any suggestions?

 

-Natty

Do we need to write a test class for trigger at all, becoz it says more than 1% is fine.

 

does it effect the org wide coverage??

 

can any one give me some insight into triggers and test coverage???

 

Thanks,

  • March 21, 2012
  • Like
  • 0

I have a trigger that simply pulls the time out of a DateTime field and displays it in the 'hh:mm a' format. I'd like this trigger to fire after a new record is inserted OR if an existing record is updated.

 

I'm very new to the dev side of force.com but I managed to get a working trigger and 100% test coverage but I'm only updating after insert. How would I get this to fire after an update as well? Code below: 

 

trigger time_test on Test__c (after insert) {
	Set<Id> Ids = new Set<Id>();
	
	for (Test__c tests : Trigger.new){
		Ids.add(tests.Id);
	}
	
	List<Test__c> test_list = new List<Test__c>([SELECT Id, Name, Time_Stamp__c, Custom_Time__c FROM Test__c l WHERE CreatedDate = today]);
	
	for(Test__c tests : test_list){
		String my_time = tests.Time_Stamp__c.format('hh:mm a');
		tests.Custom_Time__c = my_time;
		update tests;
	}
}

Any help at all would be greatly appreciated. 

 

-Natty

How to create events on calendar for custom objects

 

How to add default invitees whenver an event is created

 

 

 

This just started today (9/26/2011) and won't let me save the file to force.com. The file is a long existing apex class. Only making some minor changes.

 

 

Save error: Unable to perform save on all files:

 

com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

 

I deleted the whole project and re-added it. I was able to get everything back, then tried to make changes again. Same error. I tried to refresh my file from the ORG and received a pop up with the same error.