2

I am building a custom 'Customizable Forecast' tab from scratch using Visualforce and a custom controller to add some new features. One of my requirements is to forecast off of the 'forecast hierarchy' like the OOTB tab uses, defined in the Setup->Build->Customize->Forecasts (Customizable)->Forecasts Hierarchy. Until now, I've used the UserRoleId Field to find direct reports and subordinate roles/users. How can I use SOQL to query the Forecast Hierarchy for Direct Reports and subordinate users instead? I can not find any info on an object that contains this information.

2

It's still based on UserRole, as far as I understand. That object has a ForecastUserId field:

The ID of the forecast manager associated with this role. Label is User ID.

You can see whether an individual User record has forecasting enabled using the ForecastEnabled field:

Indicates whether the user is enabled as a Forecast Manager (true) or not (false) in customizable forecasting. Forecast managers see forecast rollups from users below them in the forecast hierarchy.

Between these two fields, you should have all the data you would be able to pull from the Forecasts Hierarchy screen.

  • Awesome, this all makes sense. Do you know if this association will always be there? for example, if I check the ForecastEnabled box for a user, will it add their name to the forecast heirarchy screen? I'm a little unclear on how closely these are tied. – laurspellm Dec 27 '17 at 22:16
  • @laurspellm Yes updating these values programmatically reflects in that UI. – Adrian Larson Dec 28 '17 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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