function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rupinder jeetrupinder jeet 

retrieve data by using Apex API, depending on role heirarchy.

hi all,

I have a requirement that, I need to send the list of opportunities, depending upon the Owner of the same, to some external application by using Web Services.

In this requirement, the list of opportunities will be depending on the Role hierarchy. A user may have his subordinates, thus the list of opportunities corresponding to him, shall contain all the opportunities which are owned by his subordinates. 

Please tell me the various option by using which, we can implement the requirement.

Please help, as soon as possible. Thanks.

regrads,

rupinder.

advlgxpmadvlgxpm

Is this a "push" to your external application or "pull" from the external application. If a pull from, you need to write some APEX code and enable the class as a web service that your external application can consume. If it is a push to, I'm not quite sure how to do it in batch, but you could look at the capability of the OutboundMessage type in Workflow rules.

rupinder jeetrupinder jeet

hi,

It is a data pull from my org, by external applicaiton. Besides that my requirement is that i need to send  the Opportunities owned by a user + Opportunities owned by his subordinates in the role heirarchy. How do we do that?

Do we directly search in the database by Using SOQLs. But that may hit the maximum SOQL limit. Please correct me if i am wrong, or anyways pls tell me some other approach that can be useful for the requirement.

regrds,

RJS.

rcravenrcraven

Did you ever sort this out?  I have a similar requirement.