0

I am trying to check if collaborative forecasts is enable in a Organization, for that i am using the following code:

        LOG.log(Level.INFO, "Check if the collaborative forecasting is enabled");
        setUpConnection(FORCE_METADATA_API);

        ReadResult readResult = metadataConnection.readMetadata("ForecastingSettings", new String[]{"Forecasting.settings"});

        if (readResult.getRecords().length > 0) {
            ForecastingSettings forecastSettings = (ForecastingSettings) readResult.getRecords()[0];
            enableForecasts = forecastSettings.isEnableForecasts();
        }

But i am receiving the following exception message:

INVALID_TYPE: This type of metadata is not available for this organization

2 Answers 2

0

So in my research on this i have found a Help Article outlining the differences between collaborative and Customizable forecasting. It seems many of these features for the collaborative forecasting are not available in "Professional Edition" for opportunities. It is very likely that you are running into issues along this path. Maybe this will help some.

This HERE may also be helpful in ensuring the setup is correct. I would suggest however checking ahead of casting the returned object to first perform a check if the metadata type is exposed in your connection. If the metadata cannot be found you can handle it differently.

4
  • 1
    Thanks for your answer, but i am using collaborative forecasting and the link is related to customizable forecasting. Commented Jul 11, 2018 at 14:28
  • @RodrigoBirriel you are correct - i have found a better informative bit of information comparatively about these items and have updated my post. I believe that it is likely that your version still does not support this metadata for opportunities.
    – Ronnie
    Commented Jul 12, 2018 at 3:31
  • 1
    At the end, we found the root cause, it is because the forecasting.setting is not available in some organization because of forecast3 perm is turn off, this flag it is not available for sysadmin, only bt user can access. Sometimes happens when you have customizable forecasting or territory management enabled in your organization. Thanks for your help. Commented Jul 13, 2018 at 15:19
  • you're welcome - if you feel my answer helped lead you in the right direction please accept it as the answer you want in order to help other users in the future. Thanks!
    – Ronnie
    Commented Jul 13, 2018 at 21:07
0

At the end, we found the root cause, it is because the forecasting.setting is not available in some organization because of forecast3 perm is turn off, this flag it is not available for sysadmin, only bt user can access. Sometimes happens when you have customizable forecasting or territory management enabled in your organization. Thanks for your help.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .