Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I'm attempting to install a managed package into a customers sandbox org. This is in existing package that has been installed into a dozen or so other orgs with no issue.

In this particular Sandbox the install starts, but then fails with the message:

Your request to install package "XYZ Package Managed" was unsuccessful. None of the data or setup information in your salesforce.com organization was affected.

If your install continues to fail, contact Salesforce CRM Support through your normal channels and provide the following information.

Organization: XYZ, Inc. (00DW00000000000)
User: SomeSandboxUser (005600000000000)
Package: XYZ Package Managed (04t400000000000)
Error Number: 914272613-778 (973378243)

Package Install Failed

An error has occurred during a package install operation.

Thank You, salesforce.com

So the first thing I did was open a Support case with Salesforce.

The response was:

Below is the error detail I see as the cause for package installation failure.

Multiple install problems encountered [null:= 
Invalid type: XyzController: SomeDependantController: Invalid= 
type: XyzController, null: Invalid type: XyzController: Test_XYZ= 
Map: Invalid type: XyzController, null: Invalid type: XyzController: Te= 
st_XYZHelper: Invalid type: XyzController, null: D= 
ependent class is invalid and needs recompilation: 
AB2.SomeDependantController: line 126, column 33: Invalid ty= 
pe: XyzController: Test_SomeDependantController: Dependent cla= 
ss is invalid and needs recompilation:

It appears something went wrong with my XyzController Class in this Org which subsequently broke all the dependant classes.

But why would it only be breaking in this Org and not all the other orgs it has been installed in?

Surely the class must of compiled when the managed package was initially being created.


Another back and forth with Salesforce Support and I'm getting closer. My managed package class isn't compiling due to the error:

No such column FiscalYear on entity Opportunity. If you are attempting to use a custom field, be sure to append the __c after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

FiscalYear might only be available if the organisation has setup fiscal details in their setup - there is definitely some reason that it doesn't exist.

You could test for the existence of the field using the system describe information, then if it does exist reference it via a string (as opposed to using the field name directly in code), thereby making your code tolerant of orgs which do not have this field.

// do not do this
theYear = theOppty.FiscalYear;

// do this
if (fieldExists)
{
  theYear = ((SObject)theOppty).get('FiscalYear');
}
share|improve this answer
1  
Thanks. As you say, I'll need to use the metadata to figure out if the field exists and switch to dynamic SOQL for the associated queries. I think I've traced the cause of the missing fields to the use of custom fiscal years. "Your organization will not be able to use fiscal period columns in opportunity, opportunity with product, or opportunity with schedule reports" –  Daniel Ballinger Feb 12 '13 at 2:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.