• Steve Chadbourn
  • NEWBIE
  • 80 Points
  • Member since 2008

  • Chatter
    Feed
  • 2
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 51
    Replies
We are attempting our first deployment from a dev sandbox to a qa sandbox and are experiencing major issues.
 
We have all sorts of files we are trying to deploy including visualforce pages, apex classes, custom objects, custom fields on standard objects, page layouts, record types, picklist changes etc.
 
We first tried to deploy as much as possible using a package. Because it is a sandbox we can only create unmanaged packages. If we add a class, any referenced fields are added to the package. When we try and deploy the package it fails if any fields already exist. Does using managed packages get round this?
 
Next we tried using the ant deployment tool. We need to use this for at least visualforce pages as they can't be packaged yet. Deployment order seems to matter hugely for ant deployments. If I try and deploy Class A that references Class B and Class B has not yet been deployed it fails. How do I tell ant what order to deploy things in? My manifest (package.xml) has wildcards for each type - should I name every file and order them? Surely not.
 
My main issue with ant relates to the page/controller cross reference - how can I deploy either pages or controllers when they cross reference each other?
 
Besides these two ways I can't see any other way of deployment. There is Eclipse but it used the same API calls that ant uses so same deployment order problem.
 
Surely someone must have worked through this. I have searched the boards but can't see suggestions.
 
Any ideas anyone?
Is there a way to optionally display a section in a page layout? I have a number of sections that contain fields that are linked to a particular record type. I would like to display only those sections that are relevant. This is the Case object.
 
Is this possible?
I have a button that has a disabled="{!someAction}". Under Summer 08 the style used to identify the enabled button looks strange.
 
Here is the button in its initial disabled state:
 
So far all OK. The button then gets enabled and here it starts to look wrong:
 
By contrast here is a normal enabled button:
 
The button works OK ie if you click on the disabled button nothing happens but if you click on the enabled button the action fires. It just looks wrong.
 
This worked fine in Spring 08.
How do I throw an exception? The developers guide helpfully tells me to use the throw statement and provide it with an exception object but then unhelpfully provides the following example:
 
throw <exceptionObject>;
 
I tried:
 
throw new Exception('error message');
 
but get the error - type cannot be constructed: Exception.
 
I did find something that said I could not construct any of the system exceptions so then what excepetion object can I provide to the throw statement?
I'm passed an object id and want to clone it. I'm guessing I need to write a soql query to get an instance of the object then clone it but I don't want to hard code all the field names as they may change. Is there a way to do a select * or a way of getting the object that doesn't involve hard coding?
Not my hamster actually but my formula fields.
 
Our dev sandbox has just had some sort of Summer 08 upgrade. I'm guessing this as all my pages now declare themselves to be API 13.0. I had to open and save all my VF pages before Eclipse could see them.
 
I tried to run my first page and got the error: "An internal server error has occurred". By a process of removing and adding components I narrowed it down to 3 formula fields. 2 no longer display anything. The third causes the internal server error. What heinous act does the formula field try and do I hear you ask? it has one line of code:
 
NOW()
 
The page uses an outputField to display the formula field.
 
Is anyone else having the same problem?
Is there a list of Visualforce bugs that have been fixed in Summer 08? I have the release notes but can't see a bug fix list in there. There has been mention of a number of things that will be fixed in Summer 08 in the last 20 or so threads (eg param assignTo) but I can't find any mention of these in the release notes.
How do I unit test methods in my controller that return a page reference? In particular how do I test that the page returned is the one I expect?
 
Here is a simple method returning a page reference:
 
Code:
public PageReference policiesPage()
{
 return Page.newClaimWzrdPolicies;
}

 
I can't seem to test like this:
 
Code:
PageReference policiesPage = controller.policiesPage();

system.assert( policiesPage == Page.newClaimWzrdPolicies ); 

 
because I'm testing that two instances of an object are the same and I'm guessing they are not for some reason.
 
So how do I test I'm getting the correct page back? I have other methods that can return one of a number of pages depending on certain conditions so I need to test all conditions and all returned pages.
 
Has anyone done this?
I'm trying to write unit tests for a controller extension and am getting a Salesforce error when I try and run it.

Here is part of the controller extension I'm trying to test:

Code:
public class newClaimWizardControllerExtension
{
 private final Case new_case;
 
 public newClaimWizardControllerExtension(ApexPages.StandardController stdController)
 {
  this.new_case = (Case)stdController.getRecord();
 }

 public PageReference policiesPage()
 {
  return Page.newClaimWzrdPolicies;
 }
}

Here is the test class:


Code:
public class newClaimWizardControllerExtensionTests 
{
 public static testMethod void testMyController() 
 {
  newClaimWizardControllerExtension controller = new newClaimWizardControllerExtension(new ApexPages.StandardController());
  
  // test page references
  PageReference policiesPage = controller.policiesPage();
  system.assertEquals(policiesPage, Page.newClaimWzrdPolicies); 
 }
}

 And here is the error I'm getting when I run it:

Code:
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!

Error ID: 879885452-10 

I'm guessing its to do with the way I'm passing a standard controller into the controller extansion constructor. I have tried all sorts of different ways to do this without success. Help!

BTW, do I have to test all the action methods that simply return a page?




I'm trying to get an actionSupport to work with a lookup field.

Code:
<apex:inputField id="adviser" value="{!claimNotification.Adviser__c}">
 <apex:actionSupport action="{!updateAdviserDetails}" event="onchange" immediate="false" status="stat" rerender="adviserEmail,adviserPhone,adviserFax" />
</apex:inputField>



It works if I type the name of the new adviser in the textbox and tab out of the field but does not work if I click the search button next to the lookup field and select a new adviser that way.

How do I trigger the actionSupport when the search button is clicked?


If I create a checkbox field and display it on a visualforce page using inputField it displays with a label on each side:
 
 
It appear fine however when using an outputField. This is different to the behaviour on standard salesforce pages where the label appears correctly on the left when in edit mode.
 
My only workaround at the moment is to drop the label on the left but that leaves the checkbox looking strange with its label on the right where all other controls have labels on the left.
 
Is this a bug? I'm guessing it is the way the control is rendered using the <input tag and can be fixed as it works fine on the standard salesforce pages.
 
 
How do I automatically assign a new case using assignment rules? 
 
It seems that only way to run assignment rules is to tick the case assignment checkbox on the new case page. My problem is that I override the new case page and have written my own new case wizard. I insert a number of new cases at the end of my wizard but cannot get the assignment rules to fire for any of them.
 
I have found details about AssignmetnRuleHeader that can be used through the API to fire rules and want to do something similar in Apex code.
 
Any ideas?
 
I'm using a param component nested inside a commandLink and want to set a controller variable to its value but I can't seem to get it to work.
 
Here is the visualforce code:
 
Code:
<apex:commandLink action="{!test}" value="Select">
 <apex:param assignTo="{!myClient}" value="{!client.Full_Name__c}"/>
</apex:commandLink>

And here is the controller code:
Code:
public class MyController
{
 String myClient;

    public void setMyClient(String s)
    {
     myClient = s;
    }
}

I get an error of Unknown property MyController.myClient.
 
Any ideas?
 
 
I have created a set of wizard pages using visualforce based on the examples in the developers guide. The thing I am struggling with though is how to validate fields on a page when the next/previous button is clicked.
 
I can mark a field as required and it flags an error when I click next. Validation rules however do not seem to fire.
 
I can do a certain amount of validation in the custom controller but how do I display the error message? outputText? This is not really the place for the validation logic either - it should be in the custom object the wizard is based on.
 
Any ideas anyone?
I created a picklist field with three values - One, Two and Three. I set One to be the Default.
 
When I display the picklist field on a visualforce page using inputfield, the drop-down list shows --None-- as the initial item.
 
Am I missing something or shouldn't One be the default?
I'm trying to construct a formula field by concatenating a persons title (picklist), first name and last name. The first name and last name are OK but when I try and add the title to the formula I get:
 
Error: Field Claimant_Title__c is a picklist field. Use it with an ISPICKVAL() or CASE() function instead.
 
Here is the formula:
 
Claimant_Title__c & " " & Claimant_First_Name__c & " " & Claimant_Last_Name__c

So how do I get the current value of the picklist field?
I have a checkbox field and a picklist field. I set up a field dependency so that if the checkbox is checked, all the picklist values are available but if the checkbox is unchecked none of them are. It all works fine in the preview.
 
The dependency does not work however on my visualforce page.
 
The page it should work on is one of a number of wizard pages controlled by a custom controller. Should dependencies work with a custom controller?
 
When I refresh my Eclipse object from the server I cannot see any dependency information. Where is this defined?
I'm trying to show a couple of comment boxes using inputField components linked to long text area fields (32,000).
 
Code:
<apex:pageBlockSection title="Other Details" columns="1">
 <apex:inputField value="{!claimNotification.Notifier_Relationship__c}"/>
 <apex:inputField value="{!claimNotification.Notifier_Why_Contact__c}"/>
</apex:pageBlockSection>   

 
I'm showing them in a 1 column pageBlockSection but the rendered textbox is very narrow - about 25% of the width of the section.
 
How do I make the textbox (inputField) wider?
How do I throw an exception? The developers guide helpfully tells me to use the throw statement and provide it with an exception object but then unhelpfully provides the following example:
 
throw <exceptionObject>;
 
I tried:
 
throw new Exception('error message');
 
but get the error - type cannot be constructed: Exception.
 
I did find something that said I could not construct any of the system exceptions so then what excepetion object can I provide to the throw statement?
We are attempting our first deployment from a dev sandbox to a qa sandbox and are experiencing major issues.
 
We have all sorts of files we are trying to deploy including visualforce pages, apex classes, custom objects, custom fields on standard objects, page layouts, record types, picklist changes etc.
 
We first tried to deploy as much as possible using a package. Because it is a sandbox we can only create unmanaged packages. If we add a class, any referenced fields are added to the package. When we try and deploy the package it fails if any fields already exist. Does using managed packages get round this?
 
Next we tried using the ant deployment tool. We need to use this for at least visualforce pages as they can't be packaged yet. Deployment order seems to matter hugely for ant deployments. If I try and deploy Class A that references Class B and Class B has not yet been deployed it fails. How do I tell ant what order to deploy things in? My manifest (package.xml) has wildcards for each type - should I name every file and order them? Surely not.
 
My main issue with ant relates to the page/controller cross reference - how can I deploy either pages or controllers when they cross reference each other?
 
Besides these two ways I can't see any other way of deployment. There is Eclipse but it used the same API calls that ant uses so same deployment order problem.
 
Surely someone must have worked through this. I have searched the boards but can't see suggestions.
 
Any ideas anyone?
Is there a way to optionally display a section in a page layout? I have a number of sections that contain fields that are linked to a particular record type. I would like to display only those sections that are relevant. This is the Case object.
 
Is this possible?
I have a button that has a disabled="{!someAction}". Under Summer 08 the style used to identify the enabled button looks strange.
 
Here is the button in its initial disabled state:
 
So far all OK. The button then gets enabled and here it starts to look wrong:
 
By contrast here is a normal enabled button:
 
The button works OK ie if you click on the disabled button nothing happens but if you click on the enabled button the action fires. It just looks wrong.
 
This worked fine in Spring 08.
How do I throw an exception? The developers guide helpfully tells me to use the throw statement and provide it with an exception object but then unhelpfully provides the following example:
 
throw <exceptionObject>;
 
I tried:
 
throw new Exception('error message');
 
but get the error - type cannot be constructed: Exception.
 
I did find something that said I could not construct any of the system exceptions so then what excepetion object can I provide to the throw statement?
I'm passed an object id and want to clone it. I'm guessing I need to write a soql query to get an instance of the object then clone it but I don't want to hard code all the field names as they may change. Is there a way to do a select * or a way of getting the object that doesn't involve hard coding?
Is there a way to reference the index number of an object in a repeat component. For example like the following

 
Code:
<apex:repeat value="Account.Contacts" var="Contact" id="contacts_list">
  Array Index : {![some variable that gives the index of the element in the array]}
</apex:repeat>

Thanks!

 

Not my hamster actually but my formula fields.
 
Our dev sandbox has just had some sort of Summer 08 upgrade. I'm guessing this as all my pages now declare themselves to be API 13.0. I had to open and save all my VF pages before Eclipse could see them.
 
I tried to run my first page and got the error: "An internal server error has occurred". By a process of removing and adding components I narrowed it down to 3 formula fields. 2 no longer display anything. The third causes the internal server error. What heinous act does the formula field try and do I hear you ask? it has one line of code:
 
NOW()
 
The page uses an outputField to display the formula field.
 
Is anyone else having the same problem?
I have an apex:inputCheckBox, I'm trying to use the attribute value="{!ChkBoxVal}". In my custom controller, I declared Boolean ChkBoxVal - I tried to make it Public. I've looked around for some sample code, but failed. How do I declare it? How do I get it from page to page, like in the Wizard example?

Thanks,
I'm not able to get the required attribute on input controls to correctly display the red bar next to the control.

For example:
Code:
<apex:page standardController="Case">
  <apex:form>
    <apex:pageBlock title="Case Edit" mode="edit">
        <apex:pageBlockButtons>
          <apex:commandButton action="{!save}" value="Save"></apex:commandButton>
          <apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton>
        </apex:pageBlockButtons>
      <apex:pageBlockSection title="Case Comments" columns="1">
        <apex:pageBlockSectionItem>
          <apex:outputLabel value="Subject" for="case__subject"/>
          <apex:inputText required="true" value="{!case.Subject}"/>
        </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>

 


If I change inputText to inputField, the control will display properly. From the documentation, it appears to me that this should work with inputText, inputTextarea, etc.


Message Edited by james2000 on 05-14-2008 04:37 PM

Hi,


I have added about 100 custom fields in the standard Account object in sandbox . How can we deploy these 100 fields to Production? I tried from eclipse IDE(force.com IDE) but did not find the Account object XML to deploy. Currently the only way I can think of is to manually create these 100 custom fields in production.

Appreciate all help in this.

Regards,
Ambili

  • May 09, 2008
  • Like
  • 0
Hi,
 
I want to create a clone copy of standard object - Account and all the associated validation rules in S-Control.
Is it possible to clone the standard object using AJAX or any other way in S-Control ?
 
 
Thanks
Rameshwar
How do I unit test methods in my controller that return a page reference? In particular how do I test that the page returned is the one I expect?
 
Here is a simple method returning a page reference:
 
Code:
public PageReference policiesPage()
{
 return Page.newClaimWzrdPolicies;
}

 
I can't seem to test like this:
 
Code:
PageReference policiesPage = controller.policiesPage();

system.assert( policiesPage == Page.newClaimWzrdPolicies ); 

 
because I'm testing that two instances of an object are the same and I'm guessing they are not for some reason.
 
So how do I test I'm getting the correct page back? I have other methods that can return one of a number of pages depending on certain conditions so I need to test all conditions and all returned pages.
 
Has anyone done this?
    Is there any way to handle validation errors in VisualForce?

    As an example, I define a field in a object with some standard salesforce validations rule (e.g a number must be between 0 and 9).

   I am putting a table of these objects.

   Currently, if I type 11 in the field, I get a cryptic visualforce error, not a standard salesforce error which will show me the exact location of the error (row and column)