• ggaop
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 1
    Replies

Is there any place where I can get the Visualforce code for the default page generated by Force.com for a custom object. I am trying to create a VisualForce page, but I am having trouble doing so..

 

Regards,

 

J

  • June 20, 2009
  • Like
  • 0

I am trying to adequate test covergae for packaging. However, I have a Custom Controller extension that has a web service callout. With this I get 53 percent coverage. Looks like I cannot execute Web Service callouts in testMethods.

 

If I execute Apex code in SystemLog window, I get an error

 

22:13:31 ERROR - Evaluation error: System.StringException: Test.setCurrentPage() can only be called from testMethods 

 

Any suggestions on how I should proceed?

 

Thanks, 

 

J

  • May 11, 2009
  • Like
  • 0

I have the following constructor for a Custom Controller extension

 

public MyController(ApexPages.StandardController stdController) {
        this.mya = (MyAccount__c)stdController.getRecord();
    } 

 

How do I create a Controller for testing?

 

Thanks in advance, 

 

J

  • May 10, 2009
  • Like
  • 0

I need to reference a custom controller extension field in my VisualForce page. How do I do this?

 

This is what I have

 

<apex:page standardController="MyAccount__c" extensions="MyController">
<apex:pageBlock title="Error Messages">
<apex:outputText > {!getMessages} </apex:outputText>
</apex:pageBlock>
</apex:page>

 

 

In MyController class

 

public String getMessages() {

   ...

}

 

I get an error that getMessages is not part of MyAccount__c

 

Thanks, 

 

J

Message Edited by ggaop on 05-04-2009 02:23 PM
Message Edited by ggaop on 05-04-2009 02:25 PM
  • May 04, 2009
  • Like
  • 0

I cannot seem to add custom components in an object layout. Is this s restriction ?

 

Thanks, 

 

J

  • May 04, 2009
  • Like
  • 0

Are there any best practices docs for UI design. I have a project with 30 custom objects.

 

Is it normal to have an app with 30 tabs?

How do you make a tab for a composite object?

What is the optimal number of tabs per application?

 

These are some of the questions that come to mind immediately. 

 

Thanks in advance.

 

J

  • May 04, 2009
  • Like
  • 0

I have the following class. However, when I run the test, I get 0 % coverage. Am I doing something wrong?

  

public class AData {
   public String address { get; set; }
   public String city { get; set; }
   public String zip { get; set; }
   public String checkingBalance { get; set; }
   public String messages { get; set; }
   
   static TestMethod void runTestCase() {
      AData mfData = new AData();
      mfData.address = '704 Holcroft Ave';
      mfData.city = 'Toronto';
      mfData.zip = 'M17 43N';
      mfData.checkingBalance = '123.12';
      mfData.messages = 'ABC';
      
      String address = mfData.address;
      System.assert(address == mfData.address);
      String city = mfData.city;
      System.assert(city == mfData.city);
      String zip = mfData.zip;
      System.assert(zip == mfData.zip);
      String checkingBalance = mfData.checkingBalance;
      System.assert(checkingBalance == mfData.checkingBalance);
      String messages = mfData.messages;
      System.assert(messages == mfData.messages);
   }

}
  • May 04, 2009
  • Like
  • 0

I have a customer detail page on which I have added a custom button. The custom button links to a VisualForce page in which I have specified a controller extension. There is a method which gets invoked, performs a Web Service Callout and updates the record. 

 

Everything works like a charm. 

 

I would like to enhance the custom detail page to add an error message from the remote server. 

 

Any suggestions on how I should go about?

 

Thanks in advance

 

J

 

in the custom controller, I have 

 

.....

 

theId = ApexPages.currentPage().getParameters().get('id');

 

.....

 

PageReference pageRef = new PageReference('/' + theID);

pageRef.setRedirect = true;

return pageRef;

 

 

Message Edited by ggaop on 05-04-2009 11:24 AM
  • May 04, 2009
  • Like
  • 0

I have the following constructor for a Custom Controller extension

 

public MyController(ApexPages.StandardController stdController) {
        this.mya = (MyAccount__c)stdController.getRecord();
    } 

 

How do I create a Controller for testing?

 

Thanks in advance, 

 

J

  • May 10, 2009
  • Like
  • 0