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 have a managed package that currently requires the Product Schedule feature due to references to the OpportunityLineItemSchedule.

This blocks attempts by orgs without the feature enabled with the message:

Missing Organization Feature: ProductSchedule

Managed Package that requires Product Schedule

If I remove all code references to OpportunityLineItemSchedule from the code and instead use dynamic SOQL will the feature dependency be removed from the managed package?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes, but you'll need to remove all static references to that type (not just SOQL, also variable declarations will need to be moved to generic SObjects, etc). Dynamic SOQL and SObject get/sets are not validated / processed until runtime.

You'll need to be more careful after doing this, since it will obviously make your code more prone to runtime errors. Also you won't be able to get code coverage on the part of your app that talks to OpportunityLineItemSchedule if you want those tests to pass in non-enabled orgs.

share|improve this answer
    
Thankfully my references to OpportunityLineItemSchedule are limited to one class and the associated tests, so it shouldn't be to difficult to rework. More generally, it makes me wonder what the options for reworking a trigger would be? I guess the trigger would need to be defined outside the managed package and then call into a global method. –  Daniel Ballinger Feb 27 '13 at 22:57

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.