+ Start a Discussion

OpportunitySplit Sobject Type and apex code in managed package

Use case: I have a JS button on opportunity detail page. It opens a visualforce page. On VF page load, it runs a check on OpportunitySplit object type (runs a SOQL on OpportunitySplit and checks for records). Problem is, I can't deploy this code into the SF account where Opportunity Split feature is not enabled, and I have to add this JS button, VF page and controller into package.
Any suggestion how I can achieve that? I don't want to do this validation (query) in js button.
I tried to make this post smaller, can provide more info if needed.