• Steve Chadbourn
  • NEWBIE
  • 110 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?
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

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)