• cnewman
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi All,

I'm really struggling to get my head around apex test clases. I've build a very basic save controller to help with a function on a small but of VisualForce page. It simply redirects back to the apex page when you save the record.
I just don't know how to build the test class for it. Here's my code:

public with sharing class DemoExtension
{
   ApexPages.StandardController stdCtrl;
   // extension constructor
   public DemoExtension(ApexPages.StandardController std)
   {
      stdCtrl=std;
   }

   public PageReference save()
   {
      stdCtrl.save();
      PageReference pr=Page.Demo_Q_and_A;
      pr.setRedirect(false);
      return pr;
   }
}
How do I build a class to test the save function?

Thanks
Hi Everyone,

Is there anyway I can have a confirmation box ask which action, from two options, I want to perform or cancel the operation?

I need a button on the Opportunity, that once pressed asks if you want to postone, close or cancel the action. First two options will change the status accordingly and the last will close the box and action nothing.

I'm familiar with the normal Yes/No confirmation box, not sure if this is possible?

Thanks
Chris
Hi All,

So we have a booked training date, I'm using a button to set this as cancelled or postponed which puts the date currently in the "Booked Training Date" into another field (Original training date), however when I try and use the date from my Training_Session__c.Booked_Training_Date__c I receive an error message saying the format is not correct for the date type:

A problem with the OnClick JavaScript for this button or link was encountered:

{faultcode:'soapenv:Client', faultstring:''0.000868917576961271' is not a valid value for the type xsd:date', }


I've also put in an alert to see what my date field is outputting, as you can see above it's '0.000868917576961271' ... WHY?!?!

This is driving me round the bend, I just want to update one custom date field with the date from another field. do I need to convert it or format it?

Hopefully someone can help :)

Thanks
Chris
Hi All,

New to Salesforce Developmet and trying to replace the save button on my Visualforce page with a custom save button.

This is a custom object related to an Opportunity, when this object is saved I need it to update the lookup field on the opportunity to the ID of the object I'm saving.

Is this possible, can I update a seperate object when I save?

Thanks


Hi Everyone,

Is there anyway I can have a confirmation box ask which action, from two options, I want to perform or cancel the operation?

I need a button on the Opportunity, that once pressed asks if you want to postone, close or cancel the action. First two options will change the status accordingly and the last will close the box and action nothing.

I'm familiar with the normal Yes/No confirmation box, not sure if this is possible?

Thanks
Chris
Hi All,

I'm really struggling to get my head around apex test clases. I've build a very basic save controller to help with a function on a small but of VisualForce page. It simply redirects back to the apex page when you save the record.
I just don't know how to build the test class for it. Here's my code:

public with sharing class DemoExtension
{
   ApexPages.StandardController stdCtrl;
   // extension constructor
   public DemoExtension(ApexPages.StandardController std)
   {
      stdCtrl=std;
   }

   public PageReference save()
   {
      stdCtrl.save();
      PageReference pr=Page.Demo_Q_and_A;
      pr.setRedirect(false);
      return pr;
   }
}
How do I build a class to test the save function?

Thanks
Hi Everyone,

Is there anyway I can have a confirmation box ask which action, from two options, I want to perform or cancel the operation?

I need a button on the Opportunity, that once pressed asks if you want to postone, close or cancel the action. First two options will change the status accordingly and the last will close the box and action nothing.

I'm familiar with the normal Yes/No confirmation box, not sure if this is possible?

Thanks
Chris